Mercurial > emacs
changeset 28344:54fda0e8528a
Weed out redundant uses of `function'
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 27 Mar 2000 04:29:55 +0000 |
parents | 4ecf90324237 |
children | 7d1e7bfa5ae1 |
files | man/cl.texi man/custom.texi man/dired-x.texi man/ediff.texi man/faq.texi man/gnus-faq.texi |
diffstat | 6 files changed, 61 insertions(+), 66 deletions(-) [+] |
line wrap: on
line diff
--- a/man/cl.texi Mon Mar 27 04:20:08 2000 +0000 +++ b/man/cl.texi Mon Mar 27 04:29:55 2000 +0000 @@ -1765,7 +1765,7 @@ @example (defun add-to-list (x list) - (mapcar (function (lambda (y) (+ x y))) list)) + (mapcar (lambda (y) (+ x y))) list) (add-to-list 7 '(1 2 5)) @result{} (8 9 12) @end example @@ -5483,7 +5483,7 @@ collect (if flag x (funcall func x)))) (defun add-odd-elements (list x) - (map-odd-elements (function (lambda (a) (+ a x))) list)) + (map-odd-elements (lambda (a) (+ a x))) list) @end example @noindent
--- a/man/custom.texi Mon Mar 27 04:20:08 2000 +0000 +++ b/man/custom.texi Mon Mar 27 04:29:55 2000 +0000 @@ -734,8 +734,8 @@ @group (add-hook 'c-mode-common-hook - (function (lambda () - (c-add-style "my-style" my-c-style t)))) + (lambda () + (c-add-style "my-style" my-c-style t))) @end group @end example
--- a/man/dired-x.texi Mon Mar 27 04:20:08 2000 +0000 +++ b/man/dired-x.texi Mon Mar 27 04:29:55 2000 +0000 @@ -290,17 +290,17 @@ @example (add-hook 'dired-load-hook - (function (lambda () - (load "dired-x") - ;; Set dired-x global variables here. For example: - ;; (setq dired-guess-shell-gnutar "gtar") - ;; (setq dired-x-hands-off-my-keys nil) - ))) + (lambda () + (load "dired-x") + ;; Set dired-x global variables here. For example: + ;; (setq dired-guess-shell-gnutar "gtar") + ;; (setq dired-x-hands-off-my-keys nil) + )) (add-hook 'dired-mode-hook - (function (lambda () - ;; Set dired-x buffer-local variables here. For example: - ;; (setq dired-omit-files-p t) - ))) + (lambda () + ;; Set dired-x buffer-local variables here. For example: + ;; (setq dired-omit-files-p t) + )) @end example @noindent @@ -367,13 +367,13 @@ @example (add-hook 'dired-load-hook - (function (lambda () - (load "dired-x") - ;; Bind dired-x-find-file. - (setq dired-x-hands-off-my-keys nil) - ;; Make sure our binding preference is invoked. - (dired-x-bind-find-file) - ))) + (lambda () + (load "dired-x") + ;; Bind dired-x-find-file. + (setq dired-x-hands-off-my-keys nil) + ;; Make sure our binding preference is invoked. + (dired-x-bind-find-file) + )) @end example Alternatively, you can set the variable @emph{before} @file{dired-x.el} is @@ -381,11 +381,11 @@ @example (add-hook 'dired-load-hook - (function (lambda () - ;; Bind dired-x-find-file. - (setq dired-x-hands-off-my-keys nil) - (load "dired-x") - ))) + (lambda () + ;; Bind dired-x-find-file. + (setq dired-x-hands-off-my-keys nil) + (load "dired-x") + )) @end example @node Special Notes, Omitting Files in Dired, Optional Installation File At Point, Installation
--- a/man/ediff.texi Mon Mar 27 04:20:08 2000 +0000 +++ b/man/ediff.texi Mon Mar 27 04:29:55 2000 +0000 @@ -1569,13 +1569,13 @@ @smallexample (add-hook 'ediff-load-hook - (function (lambda () - (set-face-foreground - ediff-current-diff-face-B "blue") - (set-face-background - ediff-current-diff-face-B "red") - (make-face-italic - ediff-current-diff-face-B)))) + (lambda () + (set-face-foreground + ediff-current-diff-face-B "blue") + (set-face-background + ediff-current-diff-face-B "red") + (make-face-italic + ediff-current-diff-face-B))) @end smallexample @strong{Note:} To set Ediff's faces, use only @code{copy-face} or
--- a/man/faq.texi Mon Mar 27 04:20:08 2000 +0000 +++ b/man/faq.texi Mon Mar 27 04:29:55 2000 +0000 @@ -1237,9 +1237,8 @@ (file-error nil)) (add-hook 'XXX-mode-hook - (function - (lambda () - (setq abbrev-mode t)))) + (lambda () + (setq abbrev-mode t))) @end lisp @node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests @@ -1389,9 +1388,8 @@ @lisp (add-hook 'XXX-mode-hook - (function - (lambda () - (setq case-fold-search nil)))) + (lambda () + (setq case-fold-search nil))) @end lisp @node Wrapping words automatically, Spell-checkers, Controlling case sensitivity, Common requests @@ -2014,8 +2012,8 @@ @lisp (add-hook 'dired-load-hook - (function (lambda () - (load "dired-x")))) + (lambda () + (load "dired-x"))) @end lisp With dired-x loaded, @kbd{M-o} toggles omitting in each dired buffer. @@ -3802,8 +3800,8 @@ @lisp (add-hook 'tex-mode-hook - (function (lambda () - (local-set-key (quote [f1]) (quote help-for-help))))) + (lambda () + (local-set-key (quote [f1]) (quote help-for-help)))) @end lisp @@ -3868,13 +3866,11 @@ variable to this "lambda function." For example, @lisp -(setq term-setup-hook - (function - (lambda () - (cond ((string-match "\\`vt220" (or (getenv "TERM") "")) - ;; Make vt220's "Do" key behave like M-x: - (global-set-key [do] 'execute-extended-command)) - )))) +(add-hook 'term-setup-hook + (lambda () + (when (string-match "\\`vt220" (or (getenv "TERM") "")) + ;; Make vt220's "Do" key behave like M-x: + (global-set-key [do] 'execute-extended-command)))) @end lisp For information on what Emacs does every time it is started, see the
--- a/man/gnus-faq.texi Mon Mar 27 04:20:08 2000 +0000 +++ b/man/gnus-faq.texi Mon Mar 27 04:29:55 2000 +0000 @@ -529,22 +529,21 @@ ;;; Don't auto-select first article if reading sources, or archives or ;;; jobs postings, etc. and just display the summary buffer (add-hook 'gnus-select-group-hook - (function - (lambda () - (cond ((string-match "sources" gnus-newsgroup-name) - (setq gnus-auto-select-first nil)) - ((string-match "jobs" gnus-newsgroup-name) - (setq gnus-auto-select-first nil)) - ((string-match "comp\\.archives" gnus-newsgroup-name) - (setq gnus-auto-select-first nil)) - ((string-match "reviews" gnus-newsgroup-name) - (setq gnus-auto-select-first nil)) - ((string-match "announce" gnus-newsgroup-name) - (setq gnus-auto-select-first nil)) - ((string-match "binaries" gnus-newsgroup-name) - (setq gnus-auto-select-first nil)) - (t - (setq gnus-auto-select-first t)))))) + (lambda () + (cond ((string-match "sources" gnus-newsgroup-name) + (setq gnus-auto-select-first nil)) + ((string-match "jobs" gnus-newsgroup-name) + (setq gnus-auto-select-first nil)) + ((string-match "comp\\.archives" gnus-newsgroup-name) + (setq gnus-auto-select-first nil)) + ((string-match "reviews" gnus-newsgroup-name) + (setq gnus-auto-select-first nil)) + ((string-match "announce" gnus-newsgroup-name) + (setq gnus-auto-select-first nil)) + ((string-match "binaries" gnus-newsgroup-name) + (setq gnus-auto-select-first nil)) + (t + (setq gnus-auto-select-first t))))) @end lisp @item