Browse Source

Backport commit e135414b2 from Emacs

with-eval-after-load is a cleaner, standard feature that works
for every file
* doc/org-manual.org (Handling Links):
Replace load-hooks with with-eval-after-load

Replace doc references to load-hooks
e135414b271e71c16e28efc2e3f29b803ab67424
Glenn Morris
Thu Jan 16 21:53:37 2020 -0800
Glenn Morris 5 years ago
parent
commit
173d2d9862
1 changed files with 3 additions and 4 deletions
  1. 3 4
      doc/org-manual.org

+ 3 - 4
doc/org-manual.org

@@ -3467,10 +3467,9 @@ generally, act on links.
   this also to {{{kbd(M-n)}}} and {{{kbd(M-p)}}}.
 
   #+begin_src emacs-lisp
-  (add-hook 'org-load-hook
-            (lambda ()
-              (define-key org-mode-map "\M-n" 'org-next-link)
-              (define-key org-mode-map "\M-p" 'org-previous-link)))
+  (with-eval-after-load 'org
+    (define-key org-mode-map "\M-n" 'org-next-link)
+    (define-key org-mode-map "\M-p" 'org-previous-link))
   #+end_src
 
 ** Using Links Outside Org