# HG changeset patch # User Stefan Monnier # Date 954131395 0 # Node ID 54fda0e8528ae251ebfbfc7c8cc2794d8fdec64c # Parent 4ecf9032423785f06f4344298a8833689921faa7 Weed out redundant uses of `function' diff -r 4ecf90324237 -r 54fda0e8528a man/cl.texi --- 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 diff -r 4ecf90324237 -r 54fda0e8528a man/custom.texi --- 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 diff -r 4ecf90324237 -r 54fda0e8528a man/dired-x.texi --- 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 diff -r 4ecf90324237 -r 54fda0e8528a man/ediff.texi --- 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 diff -r 4ecf90324237 -r 54fda0e8528a man/faq.texi --- 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 diff -r 4ecf90324237 -r 54fda0e8528a man/gnus-faq.texi --- 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