aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-04-30 19:20:12 +0200
committerLars Ingebrigtsen2016-04-30 19:20:12 +0200
commit9392193be56eebdfac702a0bbb5e954088371c7a (patch)
tree65ce8a90be60658b9e44fc8a879e7d78897a2ace
parent77c5f4554ebb3b7c7d49bc881e45a550f6c93987 (diff)
downloademacs-9392193be56eebdfac702a0bbb5e954088371c7a.tar.gz
emacs-9392193be56eebdfac702a0bbb5e954088371c7a.zip
Transform mentions of `eval-after-load' to `with-eval-after-load'
* doc/lispref/loading.texi (Hooks for Loading): Update text to not mention `eval-after-load' (bug#20038).
-rw-r--r--doc/emacs/text.texi3
-rw-r--r--doc/emacs/trouble.texi2
-rw-r--r--doc/lispref/loading.texi11
-rw-r--r--doc/lispref/tips.texi12
-rw-r--r--doc/misc/eudc.texi22
-rw-r--r--doc/misc/gnus-faq.texi75
-rw-r--r--doc/misc/gnus.texi16
-rw-r--r--doc/misc/rcirc.texi56
-rw-r--r--doc/misc/tramp.texi6
9 files changed, 101 insertions, 102 deletions
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index e19925025d7..66f01b495d1 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -1302,7 +1302,8 @@ it in order for this to take effect.
1302automatically by putting the following in your init file: 1302automatically by putting the following in your init file:
1303 1303
1304@example 1304@example
1305(eval-after-load "outline" '(require 'foldout)) 1305(with-eval-after-load "outline"
1306 (require 'foldout))
1306@end example 1307@end example
1307 1308
1308@node Org Mode 1309@node Org Mode
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index bd347b076d4..f4e3393ea9d 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -1362,7 +1362,7 @@ Appendix, elisp, Emacs Lisp Reference}.
1362@end ifclear 1362@end ifclear
1363 1363
1364@item 1364@item
1365Avoid using @code{defadvice} or @code{eval-after-load} for Lisp code 1365Avoid using @code{defadvice} or @code{with-eval-after-load} for Lisp code
1366to be included in Emacs. 1366to be included in Emacs.
1367 1367
1368@item 1368@item
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 06900a49477..d2d38d7fb5e 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -1089,11 +1089,12 @@ execution of the rest of @var{body}.
1089@end defmac 1089@end defmac
1090 1090
1091Normally, well-designed Lisp programs should not use 1091Normally, well-designed Lisp programs should not use
1092@code{eval-after-load}. If you need to examine and set the variables 1092@code{with-eval-after-load}. If you need to examine and set the
1093defined in another library (those meant for outside use), you can do 1093variables defined in another library (those meant for outside use),
1094it immediately---there is no need to wait until the library is loaded. 1094you can do it immediately---there is no need to wait until the library
1095If you need to call functions defined by that library, you should load 1095is loaded. If you need to call functions defined by that library, you
1096the library, preferably with @code{require} (@pxref{Named Features}). 1096should load the library, preferably with @code{require} (@pxref{Named
1097Features}).
1097 1098
1098@node Dynamic Modules 1099@node Dynamic Modules
1099@section Emacs Dynamic Modules 1100@section Emacs Dynamic Modules
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 0a3d244157e..d12de7aee2d 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -200,12 +200,12 @@ It is likewise a bad idea for one Lisp package to advise a function in
200another Lisp package (@pxref{Advising Functions}). 200another Lisp package (@pxref{Advising Functions}).
201 201
202@item 202@item
203Avoid using @code{eval-after-load} in libraries and packages 203Avoid using @code{eval-after-load} and @code{with-eval-after-load} in
204(@pxref{Hooks for Loading}). This feature is meant for personal 204libraries and packages (@pxref{Hooks for Loading}). This feature is
205customizations; using it in a Lisp program is unclean, because it 205meant for personal customizations; using it in a Lisp program is
206modifies the behavior of another Lisp file in a way that's not visible 206unclean, because it modifies the behavior of another Lisp file in a
207in that file. This is an obstacle for debugging, much like advising a 207way that's not visible in that file. This is an obstacle for
208function in the other package. 208debugging, much like advising a function in the other package.
209 209
210@item 210@item
211If a file does replace any of the standard functions or library 211If a file does replace any of the standard functions or library
diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi
index da63975c2e5..53f1beb1a0c 100644
--- a/doc/misc/eudc.texi
+++ b/doc/misc/eudc.texi
@@ -177,12 +177,10 @@ initialization file to add a shortcut for email address expansion in
177email composition buffers (@pxref{Inline Query Expansion}) 177email composition buffers (@pxref{Inline Query Expansion})
178 178
179@lisp 179@lisp
180(eval-after-load 180(with-eval-after-load "message"
181 "message" 181 (define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline))
182 '(define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) 182(with-eval-after-load "sendmail"
183(eval-after-load 183 (define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline))
184 "sendmail"
185 '(define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline))
186@end lisp 184@end lisp
187 185
188@menu 186@menu
@@ -271,8 +269,8 @@ LDAP:
271@vindex eudc-server-hotlist 269@vindex eudc-server-hotlist
272@vindex ldap-host-parameters-alist 270@vindex ldap-host-parameters-alist
273@lisp 271@lisp
274(eval-after-load "message" 272(with-eval-after-load "message"
275 '(define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) 273 (define-key message-mode-map (kbd "TAB") 'eudc-expand-inline))
276(customize-set-variable 'eudc-server-hotlist 274(customize-set-variable 'eudc-server-hotlist
277 '(("" . bbdb) 275 '(("" . bbdb)
278 ("ldaps://ldap.gnu.org" . ldap))) 276 ("ldaps://ldap.gnu.org" . ldap)))
@@ -327,8 +325,8 @@ configure EUDC for LDAP:
327@vindex eudc-server-hotlist 325@vindex eudc-server-hotlist
328@vindex ldap-host-parameters-alist 326@vindex ldap-host-parameters-alist
329@lisp 327@lisp
330(eval-after-load "message" 328(with-eval-after-load "message"
331 '(define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) 329 (define-key message-mode-map (kbd "TAB") 'eudc-expand-inline))
332(customize-set-variable 'eudc-server-hotlist 330(customize-set-variable 'eudc-server-hotlist
333 '(("" . bbdb) 331 '(("" . bbdb)
334 ("ldaps://ldap.gnu.org" . ldap))) 332 ("ldaps://ldap.gnu.org" . ldap)))
@@ -356,8 +354,8 @@ and the @file{.emacs} expressions become:
356@vindex eudc-server-hotlist 354@vindex eudc-server-hotlist
357@vindex ldap-host-parameters-alist 355@vindex ldap-host-parameters-alist
358@lisp 356@lisp
359(eval-after-load "message" 357(with-eval-after-load "message"
360 '(define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) 358 (define-key message-mode-map (kbd "TAB") 'eudc-expand-inline))
361(customize-set-variable 'eudc-server-hotlist 359(customize-set-variable 'eudc-server-hotlist
362 '(("" . bbdb) ("" . ldap))) 360 '(("" . bbdb) ("" . ldap)))
363(customize-set-variable 'ldap-host-parameters-alist 361(customize-set-variable 'ldap-host-parameters-alist
diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi
index 90bb10f6c35..5a49f4ac325 100644
--- a/doc/misc/gnus-faq.texi
+++ b/doc/misc/gnus-faq.texi
@@ -584,10 +584,10 @@ Now we need to tell Gnus, where to get its mail from. If
584it's a POP3 server, then you need something like this: 584it's a POP3 server, then you need something like this:
585 585
586@example 586@example
587(eval-after-load "mail-source" 587(with-eval-after-load "mail-source"
588 '(add-to-list 'mail-sources '(pop :server "pop.YourProvider.net" 588 (add-to-list 'mail-sources '(pop :server "pop.YourProvider.net"
589 :user "yourUserName" 589 :user "yourUserName"
590 :password "yourPassword"))) 590 :password "yourPassword")))
591@end example 591@end example
592@noindent 592@noindent
593 593
@@ -596,8 +596,8 @@ your password there. If you want to read your mail from a
596traditional spool file on your local machine, it's 596traditional spool file on your local machine, it's
597 597
598@example 598@example
599(eval-after-load "mail-source" 599(with-eval-after-load "mail-source"
600 '(add-to-list 'mail-sources '(file :path "/path/to/spool/file")) 600 (add-to-list 'mail-sources '(file :path "/path/to/spool/file"))
601@end example 601@end example
602@noindent 602@noindent
603 603
@@ -605,9 +605,9 @@ If it's a Maildir, with one file per message as used by
605postfix, Qmail and (optionally) fetchmail it's 605postfix, Qmail and (optionally) fetchmail it's
606 606
607@example 607@example
608(eval-after-load "mail-source" 608(with-eval-after-load "mail-source"
609 '(add-to-list 'mail-sources '(maildir :path "/path/to/Maildir/" 609 (add-to-list 'mail-sources '(maildir :path "/path/to/Maildir/"
610 :subdirs ("cur" "new"))) 610 :subdirs ("cur" "new")))
611@end example 611@end example
612@noindent 612@noindent
613 613
@@ -616,10 +616,10 @@ in one directory, for example because procmail already split your
616mail, it's 616mail, it's
617 617
618@example 618@example
619(eval-after-load "mail-source" 619(with-eval-after-load "mail-source"
620 '(add-to-list 'mail-sources 620 (add-to-list 'mail-sources
621 '(directory :path "/path/to/procmail-dir/" 621 '(directory :path "/path/to/procmail-dir/"
622 :suffix ".prcml"))) 622 :suffix ".prcml")))
623@end example 623@end example
624@noindent 624@noindent
625 625
@@ -850,10 +850,9 @@ text part if it's available. How to do it?
850Say 850Say
851 851
852@example 852@example
853(eval-after-load "mm-decode" 853(with-eval-after-load "mm-decode"
854 '(progn 854 (add-to-list 'mm-discouraged-alternatives "text/html")
855 (add-to-list 'mm-discouraged-alternatives "text/html") 855 (add-to-list 'mm-discouraged-alternatives "text/richtext"))
856 (add-to-list 'mm-discouraged-alternatives "text/richtext")))
857@end example 856@end example
858@noindent 857@noindent
859 858
@@ -1577,14 +1576,14 @@ if you already use Gnus 5.10, if you still use 5.8.8 or
15775.9 try this instead: 15765.9 try this instead:
1578 1577
1579@example 1578@example
1580(eval-after-load "gnus-msg" 1579(with-eval-after-load "gnus-msg"
1581 '(unless (boundp 'gnus-confirm-mail-reply-to-news) 1580 (unless (boundp 'gnus-confirm-mail-reply-to-news)
1582 (defadvice gnus-summary-reply (around reply-in-news activate) 1581 (defadvice gnus-summary-reply (around reply-in-news activate)
1583 "Request confirmation when replying to news." 1582 "Request confirmation when replying to news."
1584 (interactive) 1583 (interactive)
1585 (when (or (not (gnus-news-group-p gnus-newsgroup-name)) 1584 (when (or (not (gnus-news-group-p gnus-newsgroup-name))
1586 (y-or-n-p "Really reply by mail to article author? ")) 1585 (y-or-n-p "Really reply by mail to article author? "))
1587 ad-do-it)))) 1586 ad-do-it))))
1588@end example 1587@end example
1589@noindent 1588@noindent
1590 1589
@@ -1599,8 +1598,8 @@ Since 5.10 Gnus doesn't generate a sender header by
1599default. For older Gnus' try this in @file{~/.gnus.el}: 1598default. For older Gnus' try this in @file{~/.gnus.el}:
1600 1599
1601@example 1600@example
1602(eval-after-load "message" 1601(with-eval-after-load "message"
1603 '(add-to-list 'message-syntax-checks '(sender . disabled))) 1602 (add-to-list 'message-syntax-checks '(sender . disabled)))
1604@end example 1603@end example
1605@noindent 1604@noindent
1606 1605
@@ -1665,14 +1664,14 @@ in @file{~/.gnus.el}. If you use Gnus 5.9 or earlier, you can use this
1665instead (works for newer versions as well): 1664instead (works for newer versions as well):
1666 1665
1667@example 1666@example
1668(eval-after-load "message" 1667(with-eval-after-load "message"
1669 '(let ((fqdn "yourmachine.yourdomain.tld"));; <-- Edit this! 1668 (let ((fqdn "yourmachine.yourdomain.tld"));; <-- Edit this!
1670 (if (boundp 'message-user-fqdn) 1669 (if (boundp 'message-user-fqdn)
1671 (setq message-user-fqdn fqdn) 1670 (setq message-user-fqdn fqdn)
1672 (gnus-message 1 "Redefining `message-make-fqdn'.") 1671 (gnus-message 1 "Redefining `message-make-fqdn'.")
1673 (defun message-make-fqdn () 1672 (defun message-make-fqdn ()
1674 "Return user's fully qualified domain name." 1673 "Return user's fully qualified domain name."
1675 fqdn)))) 1674 fqdn))))
1676@end example 1675@end example
1677@noindent 1676@noindent
1678 1677
@@ -2195,7 +2194,7 @@ An other idea would be to byte compile your @file{~/.gnus.el} (say
2195@samp{M-x byte-compile-file RET ~/.gnus.el 2194@samp{M-x byte-compile-file RET ~/.gnus.el
2196RET} to do it). Finally, if you have require 2195RET} to do it). Finally, if you have require
2197statements in your .gnus, you could replace them with 2196statements in your .gnus, you could replace them with
2198eval-after-load, which loads the stuff not at startup 2197@code{with-eval-after-load}, which loads the stuff not at startup
2199time, but when it's needed. Say you've got this in your 2198time, but when it's needed. Say you've got this in your
2200@file{~/.gnus.el}: 2199@file{~/.gnus.el}:
2201 2200
@@ -2209,8 +2208,8 @@ then as soon as you start Gnus, message.el is loaded. If
2209you replace it with 2208you replace it with
2210 2209
2211@example 2210@example
2212(eval-after-load "message" 2211(with-eval-after-load "message"
2213 '(add-to-list 'message-syntax-checks '(sender . disabled))) 2212 (add-to-list 'message-syntax-checks '(sender . disabled)))
2214@end example 2213@end example
2215@noindent 2214@noindent
2216 2215
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index f8b61250bb9..df673fc099f 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -17148,9 +17148,9 @@ summary buffer.
17148 (gnus-summary-mark-as-read-forward 1)) 17148 (gnus-summary-mark-as-read-forward 1))
17149 (gnus-summary-scroll-up arg)))) 17149 (gnus-summary-scroll-up arg))))
17150 17150
17151(eval-after-load "gnus" 17151(with-eval-after-load "gnus"
17152 #'(define-key gnus-summary-mode-map 17152 (define-key gnus-summary-mode-map
17153 (kbd "<RET>") 'browse-nnrss-url)) 17153 (kbd "<RET>") 'browse-nnrss-url))
17154(add-to-list 'nnmail-extra-headers nnrss-url-field) 17154(add-to-list 'nnmail-extra-headers nnrss-url-field)
17155@end lisp 17155@end lisp
17156 17156
@@ -17166,11 +17166,11 @@ Parameters}) in order to display @samp{text/html} parts only in
17166 17166
17167@lisp 17167@lisp
17168;; @r{Set the default value of @code{mm-discouraged-alternatives}.} 17168;; @r{Set the default value of @code{mm-discouraged-alternatives}.}
17169(eval-after-load "gnus-sum" 17169(with-eval-after-load "gnus-sum"
17170 '(add-to-list 17170 (add-to-list
17171 'gnus-newsgroup-variables 17171 'gnus-newsgroup-variables
17172 '(mm-discouraged-alternatives 17172 '(mm-discouraged-alternatives
17173 . '("text/html" "image/.*")))) 17173 . '("text/html" "image/.*"))))
17174 17174
17175;; @r{Display @samp{text/html} parts in @code{nnrss} groups.} 17175;; @r{Display @samp{text/html} parts in @code{nnrss} groups.}
17176(add-to-list 17176(add-to-list
diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi
index 0098e2049d8..cdead72c630 100644
--- a/doc/misc/rcirc.texi
+++ b/doc/misc/rcirc.texi
@@ -880,11 +880,11 @@ because @code{defun-rcirc-command} is not yet available, and without
880@code{rcirc} loaded, the command wouldn't do us much good anyway. 880@code{rcirc} loaded, the command wouldn't do us much good anyway.
881 881
882@smallexample 882@smallexample
883(eval-after-load 'rcirc 883(with-eval-after-load 'rcirc
884 '(defun-rcirc-command sv (arg) 884 (defun-rcirc-command sv (arg)
885 "Boast about rcirc." 885 "Boast about rcirc."
886 (interactive "i") 886 (interactive "i")
887 (rcirc-send-message process target 887 (rcirc-send-message process target
888 (concat "I use " rcirc-id-string)))) 888 (concat "I use " rcirc-id-string))))
889@end smallexample 889@end smallexample
890 890
@@ -904,29 +904,29 @@ copies of every channel buffer, one dead and one live.
904The real answer, therefore, is a @code{/reconnect} command: 904The real answer, therefore, is a @code{/reconnect} command:
905 905
906@smallexample 906@smallexample
907(eval-after-load 'rcirc 907(with-eval-after-load 'rcirc
908 '(defun-rcirc-command reconnect (arg) 908 (defun-rcirc-command reconnect (arg)
909 "Reconnect the server process." 909 "Reconnect the server process."
910 (interactive "i") 910 (interactive "i")
911 (unless process 911 (unless process
912 (error "There's no process for this target")) 912 (error "There's no process for this target"))
913 (let* ((server (car (process-contact process))) 913 (let* ((server (car (process-contact process)))
914 (port (process-contact process :service)) 914 (port (process-contact process :service))
915 (nick (rcirc-nick process)) 915 (nick (rcirc-nick process))
916 channels query-buffers) 916 channels query-buffers)
917 (dolist (buf (buffer-list)) 917 (dolist (buf (buffer-list))
918 (with-current-buffer buf 918 (with-current-buffer buf
919 (when (eq process (rcirc-buffer-process)) 919 (when (eq process (rcirc-buffer-process))
920 (remove-hook 'change-major-mode-hook 920 (remove-hook 'change-major-mode-hook
921 'rcirc-change-major-mode-hook) 921 'rcirc-change-major-mode-hook)
922 (if (rcirc-channel-p rcirc-target) 922 (if (rcirc-channel-p rcirc-target)
923 (setq channels (cons rcirc-target channels)) 923 (setq channels (cons rcirc-target channels))
924 (setq query-buffers (cons buf query-buffers)))))) 924 (setq query-buffers (cons buf query-buffers))))))
925 (delete-process process) 925 (delete-process process)
926 (rcirc-connect server port nick 926 (rcirc-connect server port nick
927 rcirc-default-user-name 927 rcirc-default-user-name
928 rcirc-default-full-name 928 rcirc-default-full-name
929 channels)))) 929 channels))))
930@end smallexample 930@end smallexample
931 931
932@node GNU Free Documentation License 932@node GNU Free Documentation License
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 45518b2ce79..3bc83565409 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -3132,9 +3132,9 @@ Since @file{filecache} remembers visited places, add the remote
3132directory to the cache: 3132directory to the cache:
3133 3133
3134@lisp 3134@lisp
3135(eval-after-load "filecache" 3135(with-eval-after-load "filecache"
3136 '(file-cache-add-directory 3136 (file-cache-add-directory
3137 "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")) 3137 "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))
3138@end lisp 3138@end lisp
3139 3139
3140Then use directory completion in the minibuffer with @kbd{C-x C-f 3140Then use directory completion in the minibuffer with @kbd{C-x C-f