]> git.eshelyaron.com Git - emacs.git/commitdiff
Weed out redundant uses of `function'
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 27 Mar 2000 04:29:55 +0000 (04:29 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 27 Mar 2000 04:29:55 +0000 (04:29 +0000)
man/cl.texi
man/custom.texi
man/dired-x.texi
man/ediff.texi
man/faq.texi
man/gnus-faq.texi

index a2f7b78e758d56d5f8c744abca2d540c11309934..8f5914d6a83130a8ce86454869253fc28717e707 100644 (file)
@@ -1765,7 +1765,7 @@ closures:
 
 @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 @@ Emacs Lisp:
         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
index 90aa679dae821beab9cb98bb87c509b1215e0120..9fd6c363cf87ddd475499459880bef5a3d1da8e5 100644 (file)
@@ -734,8 +734,8 @@ lambda expression.
 
 @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
 
index 8860dff61e2faae8e46b978fa6e3cdce3a7c29d7..87d03afe2661e33e55edb69223013bf00058f64c 100644 (file)
@@ -290,17 +290,17 @@ initialization file @file{default.el} in the @file{site-lisp} directory, put
 
 @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 @@ If you choose to have @file{dired-x.el} bind @code{dired-x-find-file} over
 
 @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 @@ loaded
 
 @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
index 1f46cea648a192baddc8377bf1cfa9d83452fadc..8547b3fb72a9734bec2da335745fbcfa12100ac3 100644 (file)
@@ -1569,13 +1569,13 @@ faces, you can modify them when Ediff is being loaded using
 
 @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
index feb463aef9fc43881057d3237507adafdc6e627d..fca16c0d51ec712706f2bb1735b44edc7582729a 100644 (file)
@@ -1237,9 +1237,8 @@ Put this in your @file{.emacs} file:
   (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 @@ mode's hook.  For example:
 
 @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 @@ load dired-x by adding the following to your @file{.emacs} file:
 
 @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 @@ For example, in tex-mode, a local binding might be
 
 @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 @@ of either the @code{term-setup-hook} or @code{window-setup-hook}
 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
index a899e7def4521f77af8b52a3a7e5f607f16dee0b..466c1636fa4af22fa9e5dbaffb2fe7d0dce0858f 100644 (file)
@@ -529,22 +529,21 @@ This is what I use...customize as necessary...
 ;;; 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