From 0b2d1fed547aeea9716b59e66459c0857f7e31a6 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 22 Oct 2014 21:06:48 -0400 Subject: Prevent advice redefinition warnings With Emacs 24.4 release, these produce warnings at startup. --- lisp/init-grep.el | 3 ++- lisp/init-org.el | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/init-grep.el b/lisp/init-grep.el index 530e712..ca1b8df 100644 --- a/lisp/init-grep.el +++ b/lisp/init-grep.el @@ -16,7 +16,8 @@ entering `ch' is equivalent to `*.[ch]'.") (defadvice rgrep (after hide-grep-header activate) (hide-grep-header)) (defadvice lgrep (after hide-grep-hxoeader activate) (hide-grep-header)) (defadvice grep-find (after hide-grep-header activate) (hide-grep-header)) -(defadvice vc-git-grep (after hide-grep-header activate) (hide-grep-header)) +(after 'vc-git + (defadvice vc-git-grep (after hide-grep-header activate) (hide-grep-header))) (key-chord-define-global ",z" 'rgrep) diff --git a/lisp/init-org.el b/lisp/init-org.el index ab25cf2..f856fee 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -248,16 +248,17 @@ context will be shown for above heading." ;;; Agenda -(defadvice org-agenda-list (around org-agenda-fullscreen activate) - "Start agenda in fullscreen. +(after 'org-agenda + (defadvice org-agenda-list (around org-agenda-fullscreen activate) + "Start agenda in fullscreen. After agenda loads, delete other windows. `org-agenda-restore-windows-after-quit' should non-nil to restore the previous window configuration. If `org-agenda-sticky' is non-nil, configurations with more than one window do not seem to be restored properly." - ad-do-it - (delete-other-windows)) + ad-do-it + (delete-other-windows))) (setq org-agenda-restore-windows-after-quit t org-agenda-sticky nil) -- cgit v1.2.3 From 300cdc452130c2c6c7c76063abc3e9794edde29d Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 22 Oct 2014 21:11:05 -0400 Subject: Rewrite doi-at-point This stopped working when I upgraded to Emacs 24.4. Using 'url' with `thing-at-point' doesn't seem to work anymore, so instead use text properties. --- lisp/init-bib.el | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lisp/init-bib.el b/lisp/init-bib.el index ae15305..f254b0a 100644 --- a/lisp/init-bib.el +++ b/lisp/init-bib.el @@ -63,16 +63,12 @@ point." (browse-url (org-link-escape-browser (concat org-doi-server-url doi)))) (defun km/doi-at-point () - "Return DOI at point. -This is a hack that uses `(thing-at-point 'url)' and then removes -the leading 'http://'. The DOI format is not verified in any -way." + "Return DOI at point." (save-excursion - (when (equal (thing-at-point 'word) "doi") - (backward-word) - (re-search-forward "doi:[ \t\n]*")) - (--if-let (thing-at-point 'url) - (replace-regexp-in-string "http://" "" it) - (user-error "No DOI found at point")))) + (let ((doi (cadr (get-text-property (point) 'htmlize-link)))) + (when (or (not doi) + (not (string-prefix-p "doi:" doi))) + (user-error "No DOI found at point")) + (replace-regexp-in-string "doi:" "" doi)))) (provide 'init-bib) -- cgit v1.2.3 From c61c59b28a98573075a968666b897255ac56e67e Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 22 Oct 2014 21:11:46 -0400 Subject: Turn off electric-indent mode This is enabled by default in Emacs 24.4. --- lisp/init-editing.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/init-editing.el b/lisp/init-editing.el index acd01c8..c24c32a 100644 --- a/lisp/init-editing.el +++ b/lisp/init-editing.el @@ -150,6 +150,8 @@ and '<<<' mark the bounds of the narrowed region. (define-key km/editing-map "i" 'indent-relative) +(electric-indent-mode -1) + ;; From http://whattheemacsd.com/key-bindings.el-01.html (defun km/goto-line-with-feedback () "Show line numbers temporarily, while prompting for the line number input" -- cgit v1.2.3