emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b03f74e 2/4: Don't quote lambdas in several places


From: Stefan Kangas
Subject: master b03f74e 2/4: Don't quote lambdas in several places
Date: Thu, 1 Oct 2020 09:28:27 -0400 (EDT)

branch: master
commit b03f74e0f2a578b1580e8b1c368665850ee7f808
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Don't quote lambdas in several places
    
    * admin/find-gc.el (find-gc-unsafe):
    * lisp/align.el (align-rules-list):
    * lisp/comint.el (comint-arguments):
    * lisp/double.el (isearch-mode-map):
    * lisp/ehelp.el (electric-help-command-loop):
    * lisp/emacs-lisp/cl-macs.el (cl-defstruct):
    * lisp/emulation/cua-rect.el (cua--copy-rectangle-as-kill)
    (cua-copy-rectangle-as-text):
    * lisp/eshell/esh-var.el (eshell-parse-variable-ref):
    * lisp/hexl.el (hexl-insert-multibyte-char):
    * lisp/international/titdic-cnv.el (tsang-quick-converter)
    (ziranma-converter):
    * lisp/language/tibet-util.el (tibetan-decompose-precomposition-alist):
    * lisp/mail/mailalias.el (mail-get-names):
    * lisp/mh-e/mh-e.el (mh-auto-fields-list, mh-identity-default):
    * lisp/mouse.el (mouse-buffer-menu-map, mouse-buffer-menu-alist):
    * lisp/play/gametree.el (gametree-make-heading-function):
    * lisp/shell.el (shell--command-completion-data):
    * lisp/talk.el (talk-update-buffers):
    * lisp/tempo.el (tempo-insert-template, tempo-is-user-element)
    (tempo-build-collection):
    * lisp/term.el (term-input-filter, term-pager-help):
    * lisp/textmodes/table.el (table-delete-column):
    * lisp/url/url-cache.el (url-cache-create-filename-human-readable):
    * lisp/textmodes/tex-mode.el (latex-imenu-create-index): Don't quote
    lambdas.
---
 admin/find-gc.el                 |  4 ++--
 lisp/align.el                    |  6 +++---
 lisp/comint.el                   |  2 +-
 lisp/double.el                   |  2 +-
 lisp/ehelp.el                    |  4 ++--
 lisp/emacs-lisp/cl-macs.el       |  2 +-
 lisp/emulation/cua-rect.el       |  4 ++--
 lisp/eshell/esh-var.el           |  4 ++--
 lisp/hexl.el                     |  4 ++--
 lisp/international/titdic-cnv.el |  4 ++--
 lisp/language/tibet-util.el      |  2 +-
 lisp/mail/mailalias.el           |  2 +-
 lisp/mh-e/mh-e.el                |  4 ++--
 lisp/mouse.el                    |  8 ++++----
 lisp/play/gametree.el            |  4 ++--
 lisp/shell.el                    |  2 +-
 lisp/talk.el                     |  2 +-
 lisp/tempo.el                    | 14 +++++++-------
 lisp/term.el                     |  8 ++++----
 lisp/textmodes/table.el          |  4 ++--
 lisp/textmodes/tex-mode.el       |  2 +-
 lisp/url/url-cache.el            |  4 ++--
 22 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/admin/find-gc.el b/admin/find-gc.el
index 9bab377..7de2474 100644
--- a/admin/find-gc.el
+++ b/admin/find-gc.el
@@ -73,8 +73,8 @@ Also store it in `find-gc-unsafe-list'."
   (find-unsafe-funcs 'Fgarbage_collect)
   (setq find-gc-unsafe-list
        (sort find-gc-unsafe-list
-             (function (lambda (x y)
-                         (string-lessp (car x) (car y)))))))
+              (lambda (x y)
+                (string-lessp (car x) (car y))))))
 
 ;;; This does a depth-first search to find all functions that can
 ;;; ultimately call the function "target".  The result is an a-list
diff --git a/lisp/align.el b/lisp/align.el
index 61387b2..e3bdf77 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -389,7 +389,7 @@ The possible settings for `align-region-separate' are:
      (regexp   . "\\(^\\s-+[^( \t\n]\\|(\\(\\S-+\\)\\s-+\\)\\S-+\\(\\s-+\\)")
      (group    . 3)
      (modes    . align-lisp-modes)
-     (run-if   . ,(function (lambda () current-prefix-arg))))
+     (run-if   . ,(lambda () current-prefix-arg)))
 
     (lisp-alist-dot
      (regexp   . "\\(\\s-*\\)\\.\\(\\s-*\\)")
@@ -463,7 +463,7 @@ The possible settings for `align-region-separate' are:
      (regexp   . ",\\(\\s-*\\)[^/ \t\n]")
      (repeat   . t)
      (modes    . align-c++-modes)
-     (run-if   . ,(function (lambda () current-prefix-arg))))
+     (run-if   . ,(lambda () current-prefix-arg)))
                                        ;      (valid
                                        ;       . ,(function
                                        ;         (lambda ()
@@ -480,7 +480,7 @@ The possible settings for `align-region-separate' are:
      (regexp   . ",\\(\\s-*\\)[^# \t\n]")
      (repeat   . t)
      (modes    . (append align-perl-modes '(python-mode)))
-     (run-if   . ,(function (lambda () current-prefix-arg))))
+     (run-if   . ,(lambda () current-prefix-arg)))
 
     (c++-comment
      (regexp   . "\\(\\s-*\\)\\(//.*\\|/\\*.*\\*/\\s-*\\)$")
diff --git a/lisp/comint.el b/lisp/comint.el
index b966fae..6119476 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1773,7 +1773,7 @@ Argument 0 is the command name."
               ((>= mth 0) (1- (- count mth)))
               (t          (1- (- mth))))))
       (mapconcat
-       (function (lambda (a) a)) (nthcdr n (nreverse (nthcdr m args))) " "))))
+       (lambda (a) a) (nthcdr n (nreverse (nthcdr m args))) " "))))
 
 ;;
 ;; Input processing stuff
diff --git a/lisp/double.el b/lisp/double.el
index 639d041..8e50900 100644
--- a/lisp/double.el
+++ b/lisp/double.el
@@ -99,7 +99,7 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
     (load-library "isearch"))
 
 (define-key isearch-mode-map [ignore]
-  (function (lambda () (interactive) (isearch-update))))
+  (lambda () (interactive) (isearch-update)))
 
 (defun double-translate-key (prompt)
   ;; Translate input events using double map.
diff --git a/lisp/ehelp.el b/lisp/ehelp.el
index ad39116..8137320 100644
--- a/lisp/ehelp.el
+++ b/lisp/ehelp.el
@@ -219,7 +219,7 @@ BUFFER is put back into its original major mode."
                             'electric-help-retain))))
       (Electric-command-loop
         'exit
-       (function (lambda ()
+        (lambda ()
          (sit-for 0) ;necessary if last command was end-of-buffer or
                      ;beginning-of-buffer - otherwise pos-visible-in-window-p
                      ;will yield a wrong result.
@@ -241,7 +241,7 @@ BUFFER is put back into its original major mode."
                  (t
                   (cond (standard "Press SPC to scroll, DEL to scroll back, q 
to exit, r to retain ")
                         (both)
-                        (t (setq both (substitute-command-keys "Press 
\\[scroll-up] to scroll, \\[scroll-down] to scroll back, \\[electric-help-exit] 
to exit, \\[electric-help-retain] to retain ")))))))))
+                         (t (setq both (substitute-command-keys "Press 
\\[scroll-up] to scroll, \\[scroll-down] to scroll back, \\[electric-help-exit] 
to exit, \\[electric-help-retain] to retain "))))))))
                    t))))
 
 
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 19cdbd7..147a0a8 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2969,7 +2969,7 @@ Supported keywords for slots are:
               constrs))
     (pcase-dolist (`(,cname ,args ,doc) constrs)
       (let* ((anames (cl--arglist-args args))
-            (make (cl-mapcar (function (lambda (s d) (if (memq s anames) s d)))
+             (make (cl-mapcar (lambda (s d) (if (memq s anames) s d))
                              slots defaults))
             ;; `cl-defsubst' is fundamentally broken: it substitutes
              ;; its arguments into the body's `sexp' much too naively
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index d2c6dd0..9c3251e 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -735,7 +735,7 @@ If command is repeated at same position, delete the 
rectangle."
     (setq cua--last-killed-rectangle (cons (and kill-ring (car kill-ring)) 
killed-rectangle))
     (if ring
         (kill-new (mapconcat
-                   (function (lambda (row) (concat row "\n")))
+                   (lambda (row) (concat row "\n"))
                    killed-rectangle "")))))
 
 (defun cua--activate-rectangle ()
@@ -1071,7 +1071,7 @@ The text previously in the rectangle is overwritten by 
the blanks."
         (cua--copy-rectangle-to-global-mark t))
     (let* ((rect (cua--extract-rectangle))
            (text (mapconcat
-                  (function (lambda (row) (concat row "\n")))
+                  (lambda (row) (concat row "\n"))
                   rect "")))
       (setq arg (cua--prefix-arg arg))
       (if cua--register
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 96838d4..7388279 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -463,8 +463,8 @@ Possible options are:
                    (eshell-as-subcommand ,(eshell-parse-command cmd))
                    (ignore
                     (nconc eshell-this-command-hook
-                           (list (function (lambda ()
-                                              (delete-file ,temp))))))
+                           (list (lambda ()
+                                   (delete-file ,temp)))))
                    (quote ,temp)))
             (goto-char (1+ end)))))))
    ((eq (char-after) ?\()
diff --git a/lisp/hexl.el b/lisp/hexl.el
index 38eca77..0c31d96 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -886,7 +886,7 @@ and their encoded form is inserted byte by byte."
              (when (null encoded)
               (setq internal (encode-coding-string internal 'utf-8-emacs)
                     internal-hex
-                    (mapconcat (function (lambda (c) (format "%x" c)))
+                     (mapconcat (lambda (c) (format "%x" c))
                                internal " "))
               (if (yes-or-no-p
                    (format-message
@@ -899,7 +899,7 @@ and their encoded form is inserted byte by byte."
                  (substitute-command-keys "try \\[hexl-insert-hex-string]"))))
             (while (> num 0)
               (mapc
-               (function (lambda (c) (hexl-insert-char c 1))) encoded)
+                (lambda (c) (hexl-insert-char c 1)) encoded)
               (setq num (1- num))))))))
 
 (defun hexl-self-insert-command (arg)
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index a6dcd02..2da8635 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -795,7 +795,7 @@ To get complete usage, invoke \"emacs -batch -f 
batch-titdic-convert -h\"."
            (forward-line 1)))
        (maphash #'(lambda (key val) (setq dic (cons (cons key val) dic)))
                 table)))
-    (setq dic (sort dic (function (lambda (x y) (string< (car x ) (car y))))))
+    (setq dic (sort dic (lambda (x y) (string< (car x ) (car y)))))
     (dolist (elt dic)
       (insert (format "(%S\t%S)\n" (car elt) (cdr elt))))
     (let ((punctuation '((";" "$(0!'!2!"!#!.!/(B" "$(G!'!2!"!#!.!/(B")
@@ -956,7 +956,7 @@ method `chinese-tonepy' with which you must specify tones 
by digits
                             (setq trans (mapconcat 'identity trans "")))))
                     (setq dic (cons (cons key trans) dic)))
                 table)))
-    (setq dic (sort dic (function (lambda (x y) (string< (car x) (car y))))))
+    (setq dic (sort dic (lambda (x y) (string< (car x) (car y)))))
     (goto-char (point-max))
     (insert (format "%S\n" "$A::WVJdHk!K!>WTH;!?!K(B
 
diff --git a/lisp/language/tibet-util.el b/lisp/language/tibet-util.el
index 8684cdb..04369f6 100644
--- a/lisp/language/tibet-util.el
+++ b/lisp/language/tibet-util.el
@@ -275,7 +275,7 @@ The returned string has no composition information."
            (compose-region from to components)))))))
 
 (defvar tibetan-decompose-precomposition-alist
-  (mapcar (function (lambda (x) (cons (string-to-char (cdr x)) (car x))))
+  (mapcar (lambda (x) (cons (string-to-char (cdr x)) (car x)))
          tibetan-precomposition-rule-alist))
 
 ;;;###autoload
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el
index 1f68873..2b76539 100644
--- a/lisp/mail/mailalias.el
+++ b/lisp/mail/mailalias.el
@@ -517,7 +517,7 @@ PREFIX is the string we want to complete."
            (setq mail-names
                  (sort (append (if (consp mail-aliases)
                                    (mapcar
-                                    (function (lambda (a) (list (car a))))
+                                     (lambda (a) (list (car a)))
                                     mail-aliases))
                                (if (consp mail-local-names)
                                    mail-local-names)
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index dd05d69..e8a660a 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -1550,7 +1550,7 @@ as the result is undefined."
                                ,(append
                                  '(radio)
                                  (mapcar
-                                  (function (lambda (arg) `(const ,arg)))
+                                  (lambda (arg) `(const ,arg))
                                   (mapcar 'car mh-identity-list))))
                          (cons :tag "Fcc Field"
                                (const "fcc")
@@ -1577,7 +1577,7 @@ See `mh-identity-list'."
   :type (append
          '(radio)
          (cons '(const :tag "None" nil)
-               (mapcar (function (lambda (arg) `(const ,arg)))
+               (mapcar (lambda (arg) `(const ,arg))
                        (mapcar 'car mh-identity-list))))
   :group 'mh-identity
   :package-version '(MH-E . "7.1"))
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 06fdca1..9e7eee6 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -2206,8 +2206,8 @@ and selects that window."
          ;; Sort the list to put the most popular major modes first.
          (setq split-by-major-mode
                (sort split-by-major-mode
-                     (function (lambda (elt1 elt2)
-                                 (> (length elt1) (length elt2))))))
+                      (lambda (elt1 elt2)
+                        (> (length elt1) (length elt2)))))
          ;; Make a separate submenu for each major mode
          ;; that has more than one buffer,
          ;; unless all the remaining buffers are less than 1/10 of them.
@@ -2248,8 +2248,8 @@ and selects that window."
        head)
     (setq buffers
          (sort buffers
-               (function (lambda (elt1 elt2)
-                           (string< (buffer-name elt1) (buffer-name elt2))))))
+                (lambda (elt1 elt2)
+                  (string< (buffer-name elt1) (buffer-name elt2)))))
     (setq tail buffers)
     (while tail
       (or (eq ?\s (aref (buffer-name (car tail)) 0))
diff --git a/lisp/play/gametree.el b/lisp/play/gametree.el
index ba74afc..a9417e9 100644
--- a/lisp/play/gametree.el
+++ b/lisp/play/gametree.el
@@ -121,8 +121,8 @@ Has to contain \"%d\" to output the actual number."
   :group 'gametree)
 
 (defcustom gametree-make-heading-function
-  (function (lambda (level)
-              (insert (make-string level ?*))))
+  (lambda (level)
+    (insert (make-string level ?*)))
   "A function of one numeric argument, LEVEL, to insert a heading at point.
 You should change this if you change `outline-regexp'."
   :type 'function
diff --git a/lisp/shell.el b/lisp/shell.el
index 6129e5e..226bdf4 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -1208,7 +1208,7 @@ Returns t if successful."
         (cwd (file-name-as-directory (expand-file-name default-directory)))
         (ignored-extensions
          (and comint-completion-fignore
-              (mapconcat (function (lambda (x) (concat (regexp-quote x) 
"\\'")))
+               (mapconcat (lambda (x) (concat (regexp-quote x) "\\'"))
                          comint-completion-fignore "\\|")))
         (dir "") (comps-in-dir ())
         (file "") (abs-file-name "") (completions ()))
diff --git a/lisp/talk.el b/lisp/talk.el
index 5541b0a..a18cf26 100644
--- a/lisp/talk.el
+++ b/lisp/talk.el
@@ -90,7 +90,7 @@ Each element has the form (DISPLAY FRAME BUFFER).")
       (let ((frame (nth 1 (car tail)))
            (this-buffer (nth 2 (car tail)))
            (buffers
-            (mapcar (function (lambda (elt) (nth 2 elt)))
+             (mapcar (lambda (elt) (nth 2 elt))
                     talk-display-alist)))
        ;; Put this display's own talk buffer
        ;; at the front of the list.
diff --git a/lisp/tempo.el b/lisp/tempo.el
index bc398e7..c2280de 100644
--- a/lisp/tempo.el
+++ b/lisp/tempo.el
@@ -306,8 +306,8 @@ mode, ON-REGION is ignored and assumed true if the region 
is active."
            (goto-char tempo-region-start))
        (save-excursion
          (tempo-insert-mark (point-marker))
-         (mapc (function (lambda (elt)
-                           (tempo-insert elt on-region)))
+          (mapc (lambda (elt)
+                  (tempo-insert elt on-region))
                (symbol-value template))
          (tempo-insert-mark (point-marker)))
        (tempo-forward-mark))
@@ -449,9 +449,9 @@ never prompted."
   "Tries all the user-defined element handlers in `tempo-user-elements'."
   ;; Sigh... I need (some list)
   (catch 'found
-    (mapc (function (lambda (handler)
-                     (let ((result (funcall handler element)))
-                       (if result (throw 'found result)))))
+    (mapc (lambda (handler)
+            (let ((result (funcall handler element)))
+              (if result (throw 'found result))))
          tempo-user-elements)
     (throw 'found nil)))
 
@@ -640,11 +640,11 @@ If `tempo-dirty-collection' is nil, the old collection is 
reused."
               tempo-collection)
          (setq tempo-collection
                (apply (function append)
-                      (mapcar (function (lambda (tag-list)
+                       (mapcar (lambda (tag-list)
                                        ; If the format for
                                        ; tempo-local-tags changes,
                                        ; change this
-                                          (eval (car tag-list))))
+                                 (eval (car tag-list)))
                               tempo-local-tags))))
     (setq tempo-dirty-collection nil)))
 
diff --git a/lisp/term.el b/lisp/term.el
index 69681f7..ff8b3f0 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -554,7 +554,7 @@ See also `term-dynamic-complete'.
 This is a good thing to set in mode hooks.")
 
 (defvar term-input-filter
-  (function (lambda (str) (not (string-match "\\`\\s *\\'" str))))
+  (lambda (str) (not (string-match "\\`\\s *\\'" str)))
   "Predicate for filtering additions to input history.
 Only inputs answering true to this function are saved on the input
 history list.  Default is to save anything that isn't all whitespace.")
@@ -3640,8 +3640,8 @@ The top-most line is line 0."
   (message "Terminal-emulator pager break help...")
   (sit-for 0)
   (with-electric-help
-    (function (lambda ()
-               (princ (substitute-command-keys
+    (lambda ()
+      (princ (substitute-command-keys
 "\\<term-pager-break-map>\
 Terminal-emulator MORE break.\n\
 Type one of the following keys:\n\n\
@@ -3659,7 +3659,7 @@ Type one of the following keys:\n\n\
 Any other key is passed through to the program
 running under the terminal emulator and disables pager processing until
 all pending output has been dealt with."))
-               nil))))
+      nil)))
 
 (defun term-pager-continue (new-count)
   (let ((process (get-buffer-process (current-buffer))))
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 391e757..936edf1 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -3503,9 +3503,9 @@ column must consists from cells of same width."
       (let ((cell-list (table--vertical-cell-list 'top-to-bottom)))
        (unless
            (and (table--uniform-list-p
-                 (mapcar (function (lambda (cell) (car (table--get-coordinate 
(car cell))))) cell-list))
+                  (mapcar (lambda (cell) (car (table--get-coordinate (car 
cell)))) cell-list))
                 (table--uniform-list-p
-                 (mapcar (function (lambda (cell) (car (table--get-coordinate 
(cdr cell))))) cell-list)))
+                  (mapcar (lambda (cell) (car (table--get-coordinate (cdr 
cell)))) cell-list)))
          (error "Cells in this column are not in uniform width"))
        (unless lu-coord
          (setq lu-coord (table--get-coordinate (caar cell-list))))
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index a905d14..11db25c 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -422,7 +422,7 @@ An alternative value is \" . \", if you use a font with a 
narrow period."
        (push (cons "--" (match-beginning 0)) menu))
 
       ;; Sort in increasing buffer position order.
-      (sort menu (function (lambda (a b) (< (cdr a) (cdr b))))))))
+      (sort menu (lambda (a b) (< (cdr a) (cdr b)))))))
 
 ;;;;
 ;;;; Outline support
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index a67e5dc..056ad1e 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -125,8 +125,8 @@ The actual return value is the last modification time of 
the cache file."
 
        (setq fname (and fname
                         (mapconcat
-                         (function (lambda (x)
-                                     (if (= x ?~) "" (char-to-string x))))
+                          (lambda (x)
+                            (if (= x ?~) "" (char-to-string x)))
                          fname ""))
              fname (cond
                     ((null fname) nil)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]