]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't quote lambdas in several places
authorStefan Kangas <stefan@marxist.se>
Wed, 30 Sep 2020 14:18:50 +0000 (16:18 +0200)
committerStefan Kangas <stefan@marxist.se>
Thu, 1 Oct 2020 13:28:14 +0000 (15:28 +0200)
* 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.

22 files changed:
admin/find-gc.el
lisp/align.el
lisp/comint.el
lisp/double.el
lisp/ehelp.el
lisp/emacs-lisp/cl-macs.el
lisp/emulation/cua-rect.el
lisp/eshell/esh-var.el
lisp/hexl.el
lisp/international/titdic-cnv.el
lisp/language/tibet-util.el
lisp/mail/mailalias.el
lisp/mh-e/mh-e.el
lisp/mouse.el
lisp/play/gametree.el
lisp/shell.el
lisp/talk.el
lisp/tempo.el
lisp/term.el
lisp/textmodes/table.el
lisp/textmodes/tex-mode.el
lisp/url/url-cache.el

index 9bab3776a5164ddd63a4ac91d6d66132e3aa680d..7de2474b828c6fb2c0929629d178c64f0f267bd6 100644 (file)
@@ -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
index 61387b23dc7235f47574bc6c289ffc4f584c6af4..e3bdf77002e088d96a10d777ae9dd6714374838e 100644 (file)
@@ -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-*\\)$")
index b966fae9364dad1051056b4c92402344a944ea36..611947605fb35c524ac78c913df5e48f7c55f553 100644 (file)
@@ -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))) " "))))
 \f
 ;;
 ;; Input processing stuff
index 639d041a1dc02409ec5ba8d1ccc89380461dedd0..8e5090034cfc4d2fbd1aee377d6d67625555305a 100644 (file)
@@ -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.
index ad39116c6806e66003a652e548598bd323acc789..81373202c51138fb840e368ee4f2fb763982435a 100644 (file)
@@ -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))))
 
 
index 19cdbd7aeb5bb2eb48a5696bfad6ea821bf0f1aa..147a0a8f5a42b8a08ce438b2c8a306a6c8e9fa5c 100644 (file)
@@ -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
index d2c6dd06b6cc86b4c03968635e33a87c1d30a9bd..9c3251e0e6f7160a42a004a71edaa077d68593e0 100644 (file)
@@ -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
index 96838d4132752cf963a24f39f663c6641abae3b2..7388279f15789cdf2b6a76ae1cad6115b7814d5b 100644 (file)
@@ -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) ?\()
index 38eca77e260107454637cfc993862ae01cbfc427..0c31d964577ba90f45cfef9020138150e245a0b9 100644 (file)
@@ -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)
index a6dcd02dc689aa4c4c2ed078c25adaf88bde563b..2da8635f80b89a28e6457954ba759a3713fced11 100644 (file)
@@ -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 '((";" "\e$(0!'!2!"!#!.!/\e(B" "\e$(G!'!2!"!#!.!/\e(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" "\e$A::WVJdHk!K!>WTH;!?!K\e(B
 
index 8684cdb1338b4f0000ca929215e3db5dfdc56126..04369f6af87359ab4ec564a8e2189fff9d7fd663 100644 (file)
@@ -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
index 1f688734d478287f4baeb9ece7b51ff237f6166e..2b76539e1523a28b3125be8360615ea49e0883cd 100644 (file)
@@ -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)
index dd05d691c91bddd7b0c1c5a86ab34b828f747200..e8a660aab244b014107cd5b7f320c7493137417c 100644 (file)
@@ -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"))
index 06fdca12b9c1034e2f3fa6bb7aeb6ed0db04a3d5..9e7eee61e57f7b14a38a403a8ce88c57276b6c41 100644 (file)
@@ -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))
index ba74afce298fa4f83c85daede14824ed55a5a3c3..a9417e9e0ac817032c727678a5e8dbd7206cd697 100644 (file)
@@ -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
index 6129e5efc84294bf911374b7e713321d65df8712..226bdf4d9198db7847a4dc2fc2de35211586b393 100644 (file)
@@ -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 ()))
index 5541b0a4c692ba1c9b523167c528c0bb5db8301f..a18cf263435e41dfb85afaebbd8ee938422c7623 100644 (file)
@@ -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.
index bc398e7eb6735f95bf9033e786ca68eecf6f6ce1..c2280dedc881d2c57b80cede34f4170f04370c4a 100644 (file)
@@ -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)))
 
index 69681f706c0c29440b14b73088bf1ad25a08a816..ff8b3f00f34d706a55d562e1a567aa1ea445ae13 100644 (file)
@@ -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))))
index 391e7570b5f60a67a65e50098beaa26ba12ecf7c..936edf17ac166d64da9e25e0f9e1f1b12dbdf0ee 100644 (file)
@@ -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))))
index a905d148009603c25fbd7eed27670ef07eaa3af9..11db25cb7a258ae2005ce352b0ed74cd191b8714 100644 (file)
@@ -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)))))))
 \f
 ;;;;
 ;;;; Outline support
index a67e5dcd1259009d3e5f6fa07d2463ab7c9b554b..056ad1e0188204dfa55dea10794d4fab0a965563 100644 (file)
@@ -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)