1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

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.
This commit is contained in:
Stefan Kangas 2020-09-30 16:18:50 +02:00
parent 6cbc253aa0
commit b03f74e0f2
22 changed files with 46 additions and 46 deletions

View file

@ -73,8 +73,8 @@ Also store it in `find-gc-unsafe-list'."
(find-unsafe-funcs 'Fgarbage_collect) (find-unsafe-funcs 'Fgarbage_collect)
(setq find-gc-unsafe-list (setq find-gc-unsafe-list
(sort find-gc-unsafe-list (sort find-gc-unsafe-list
(function (lambda (x y) (lambda (x y)
(string-lessp (car x) (car y))))))) (string-lessp (car x) (car y))))))
;;; This does a depth-first search to find all functions that can ;;; This does a depth-first search to find all functions that can
;;; ultimately call the function "target". The result is an a-list ;;; ultimately call the function "target". The result is an a-list

View file

@ -389,7 +389,7 @@ The possible settings for `align-region-separate' are:
(regexp . "\\(^\\s-+[^( \t\n]\\|(\\(\\S-+\\)\\s-+\\)\\S-+\\(\\s-+\\)") (regexp . "\\(^\\s-+[^( \t\n]\\|(\\(\\S-+\\)\\s-+\\)\\S-+\\(\\s-+\\)")
(group . 3) (group . 3)
(modes . align-lisp-modes) (modes . align-lisp-modes)
(run-if . ,(function (lambda () current-prefix-arg)))) (run-if . ,(lambda () current-prefix-arg)))
(lisp-alist-dot (lisp-alist-dot
(regexp . "\\(\\s-*\\)\\.\\(\\s-*\\)") (regexp . "\\(\\s-*\\)\\.\\(\\s-*\\)")
@ -463,7 +463,7 @@ The possible settings for `align-region-separate' are:
(regexp . ",\\(\\s-*\\)[^/ \t\n]") (regexp . ",\\(\\s-*\\)[^/ \t\n]")
(repeat . t) (repeat . t)
(modes . align-c++-modes) (modes . align-c++-modes)
(run-if . ,(function (lambda () current-prefix-arg)))) (run-if . ,(lambda () current-prefix-arg)))
; (valid ; (valid
; . ,(function ; . ,(function
; (lambda () ; (lambda ()
@ -480,7 +480,7 @@ The possible settings for `align-region-separate' are:
(regexp . ",\\(\\s-*\\)[^# \t\n]") (regexp . ",\\(\\s-*\\)[^# \t\n]")
(repeat . t) (repeat . t)
(modes . (append align-perl-modes '(python-mode))) (modes . (append align-perl-modes '(python-mode)))
(run-if . ,(function (lambda () current-prefix-arg)))) (run-if . ,(lambda () current-prefix-arg)))
(c++-comment (c++-comment
(regexp . "\\(\\s-*\\)\\(//.*\\|/\\*.*\\*/\\s-*\\)$") (regexp . "\\(\\s-*\\)\\(//.*\\|/\\*.*\\*/\\s-*\\)$")

View file

@ -1773,7 +1773,7 @@ Argument 0 is the command name."
((>= mth 0) (1- (- count mth))) ((>= mth 0) (1- (- count mth)))
(t (1- (- mth)))))) (t (1- (- mth))))))
(mapconcat (mapconcat
(function (lambda (a) a)) (nthcdr n (nreverse (nthcdr m args))) " ")))) (lambda (a) a) (nthcdr n (nreverse (nthcdr m args))) " "))))
;; ;;
;; Input processing stuff ;; Input processing stuff

View file

@ -99,7 +99,7 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
(load-library "isearch")) (load-library "isearch"))
(define-key isearch-mode-map [ignore] (define-key isearch-mode-map [ignore]
(function (lambda () (interactive) (isearch-update)))) (lambda () (interactive) (isearch-update)))
(defun double-translate-key (prompt) (defun double-translate-key (prompt)
;; Translate input events using double map. ;; Translate input events using double map.

View file

@ -219,7 +219,7 @@ BUFFER is put back into its original major mode."
'electric-help-retain)))) 'electric-help-retain))))
(Electric-command-loop (Electric-command-loop
'exit 'exit
(function (lambda () (lambda ()
(sit-for 0) ;necessary if last command was end-of-buffer or (sit-for 0) ;necessary if last command was end-of-buffer or
;beginning-of-buffer - otherwise pos-visible-in-window-p ;beginning-of-buffer - otherwise pos-visible-in-window-p
;will yield a wrong result. ;will yield a wrong result.
@ -241,7 +241,7 @@ BUFFER is put back into its original major mode."
(t (t
(cond (standard "Press SPC to scroll, DEL to scroll back, q to exit, r to retain ") (cond (standard "Press SPC to scroll, DEL to scroll back, q to exit, r to retain ")
(both) (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)))) t))))

View file

@ -2969,7 +2969,7 @@ Supported keywords for slots are:
constrs)) constrs))
(pcase-dolist (`(,cname ,args ,doc) constrs) (pcase-dolist (`(,cname ,args ,doc) constrs)
(let* ((anames (cl--arglist-args args)) (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)) slots defaults))
;; `cl-defsubst' is fundamentally broken: it substitutes ;; `cl-defsubst' is fundamentally broken: it substitutes
;; its arguments into the body's `sexp' much too naively ;; its arguments into the body's `sexp' much too naively

View 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)) (setq cua--last-killed-rectangle (cons (and kill-ring (car kill-ring)) killed-rectangle))
(if ring (if ring
(kill-new (mapconcat (kill-new (mapconcat
(function (lambda (row) (concat row "\n"))) (lambda (row) (concat row "\n"))
killed-rectangle ""))))) killed-rectangle "")))))
(defun cua--activate-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)) (cua--copy-rectangle-to-global-mark t))
(let* ((rect (cua--extract-rectangle)) (let* ((rect (cua--extract-rectangle))
(text (mapconcat (text (mapconcat
(function (lambda (row) (concat row "\n"))) (lambda (row) (concat row "\n"))
rect ""))) rect "")))
(setq arg (cua--prefix-arg arg)) (setq arg (cua--prefix-arg arg))
(if cua--register (if cua--register

View file

@ -463,8 +463,8 @@ Possible options are:
(eshell-as-subcommand ,(eshell-parse-command cmd)) (eshell-as-subcommand ,(eshell-parse-command cmd))
(ignore (ignore
(nconc eshell-this-command-hook (nconc eshell-this-command-hook
(list (function (lambda () (list (lambda ()
(delete-file ,temp)))))) (delete-file ,temp)))))
(quote ,temp))) (quote ,temp)))
(goto-char (1+ end))))))) (goto-char (1+ end)))))))
((eq (char-after) ?\() ((eq (char-after) ?\()

View file

@ -886,7 +886,7 @@ and their encoded form is inserted byte by byte."
(when (null encoded) (when (null encoded)
(setq internal (encode-coding-string internal 'utf-8-emacs) (setq internal (encode-coding-string internal 'utf-8-emacs)
internal-hex internal-hex
(mapconcat (function (lambda (c) (format "%x" c))) (mapconcat (lambda (c) (format "%x" c))
internal " ")) internal " "))
(if (yes-or-no-p (if (yes-or-no-p
(format-message (format-message
@ -899,7 +899,7 @@ and their encoded form is inserted byte by byte."
(substitute-command-keys "try \\[hexl-insert-hex-string]")))) (substitute-command-keys "try \\[hexl-insert-hex-string]"))))
(while (> num 0) (while (> num 0)
(mapc (mapc
(function (lambda (c) (hexl-insert-char c 1))) encoded) (lambda (c) (hexl-insert-char c 1)) encoded)
(setq num (1- num)))))))) (setq num (1- num))))))))
(defun hexl-self-insert-command (arg) (defun hexl-self-insert-command (arg)

View file

@ -795,7 +795,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"."
(forward-line 1))) (forward-line 1)))
(maphash #'(lambda (key val) (setq dic (cons (cons key val) dic))) (maphash #'(lambda (key val) (setq dic (cons (cons key val) dic)))
table))) 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) (dolist (elt dic)
(insert (format "(%S\t%S)\n" (car elt) (cdr elt)))) (insert (format "(%S\t%S)\n" (car elt) (cdr elt))))
(let ((punctuation '((";" "$(0!'!2!"!#!.!/(B" "$(G!'!2!"!#!.!/(B") (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 trans (mapconcat 'identity trans "")))))
(setq dic (cons (cons key trans) dic))) (setq dic (cons (cons key trans) dic)))
table))) 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)) (goto-char (point-max))
(insert (format "%S\n" "$A::WVJdHk!K!>WTH;!?!K(B (insert (format "%S\n" "$A::WVJdHk!K!>WTH;!?!K(B

View file

@ -275,7 +275,7 @@ The returned string has no composition information."
(compose-region from to components))))))) (compose-region from to components)))))))
(defvar tibetan-decompose-precomposition-alist (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)) tibetan-precomposition-rule-alist))
;;;###autoload ;;;###autoload

View file

@ -517,7 +517,7 @@ PREFIX is the string we want to complete."
(setq mail-names (setq mail-names
(sort (append (if (consp mail-aliases) (sort (append (if (consp mail-aliases)
(mapcar (mapcar
(function (lambda (a) (list (car a)))) (lambda (a) (list (car a)))
mail-aliases)) mail-aliases))
(if (consp mail-local-names) (if (consp mail-local-names)
mail-local-names) mail-local-names)

View file

@ -1550,7 +1550,7 @@ as the result is undefined."
,(append ,(append
'(radio) '(radio)
(mapcar (mapcar
(function (lambda (arg) `(const ,arg))) (lambda (arg) `(const ,arg))
(mapcar 'car mh-identity-list)))) (mapcar 'car mh-identity-list))))
(cons :tag "Fcc Field" (cons :tag "Fcc Field"
(const "fcc") (const "fcc")
@ -1577,7 +1577,7 @@ See `mh-identity-list'."
:type (append :type (append
'(radio) '(radio)
(cons '(const :tag "None" nil) (cons '(const :tag "None" nil)
(mapcar (function (lambda (arg) `(const ,arg))) (mapcar (lambda (arg) `(const ,arg))
(mapcar 'car mh-identity-list)))) (mapcar 'car mh-identity-list))))
:group 'mh-identity :group 'mh-identity
:package-version '(MH-E . "7.1")) :package-version '(MH-E . "7.1"))

View file

@ -2206,8 +2206,8 @@ and selects that window."
;; Sort the list to put the most popular major modes first. ;; Sort the list to put the most popular major modes first.
(setq split-by-major-mode (setq split-by-major-mode
(sort split-by-major-mode (sort split-by-major-mode
(function (lambda (elt1 elt2) (lambda (elt1 elt2)
(> (length elt1) (length elt2)))))) (> (length elt1) (length elt2)))))
;; Make a separate submenu for each major mode ;; Make a separate submenu for each major mode
;; that has more than one buffer, ;; that has more than one buffer,
;; unless all the remaining buffers are less than 1/10 of them. ;; unless all the remaining buffers are less than 1/10 of them.
@ -2248,8 +2248,8 @@ and selects that window."
head) head)
(setq buffers (setq buffers
(sort buffers (sort buffers
(function (lambda (elt1 elt2) (lambda (elt1 elt2)
(string< (buffer-name elt1) (buffer-name elt2)))))) (string< (buffer-name elt1) (buffer-name elt2)))))
(setq tail buffers) (setq tail buffers)
(while tail (while tail
(or (eq ?\s (aref (buffer-name (car tail)) 0)) (or (eq ?\s (aref (buffer-name (car tail)) 0))

View file

@ -121,8 +121,8 @@ Has to contain \"%d\" to output the actual number."
:group 'gametree) :group 'gametree)
(defcustom gametree-make-heading-function (defcustom gametree-make-heading-function
(function (lambda (level) (lambda (level)
(insert (make-string level ?*)))) (insert (make-string level ?*)))
"A function of one numeric argument, LEVEL, to insert a heading at point. "A function of one numeric argument, LEVEL, to insert a heading at point.
You should change this if you change `outline-regexp'." You should change this if you change `outline-regexp'."
:type 'function :type 'function

View file

@ -1208,7 +1208,7 @@ Returns t if successful."
(cwd (file-name-as-directory (expand-file-name default-directory))) (cwd (file-name-as-directory (expand-file-name default-directory)))
(ignored-extensions (ignored-extensions
(and comint-completion-fignore (and comint-completion-fignore
(mapconcat (function (lambda (x) (concat (regexp-quote x) "\\'"))) (mapconcat (lambda (x) (concat (regexp-quote x) "\\'"))
comint-completion-fignore "\\|"))) comint-completion-fignore "\\|")))
(dir "") (comps-in-dir ()) (dir "") (comps-in-dir ())
(file "") (abs-file-name "") (completions ())) (file "") (abs-file-name "") (completions ()))

View file

@ -90,7 +90,7 @@ Each element has the form (DISPLAY FRAME BUFFER).")
(let ((frame (nth 1 (car tail))) (let ((frame (nth 1 (car tail)))
(this-buffer (nth 2 (car tail))) (this-buffer (nth 2 (car tail)))
(buffers (buffers
(mapcar (function (lambda (elt) (nth 2 elt))) (mapcar (lambda (elt) (nth 2 elt))
talk-display-alist))) talk-display-alist)))
;; Put this display's own talk buffer ;; Put this display's own talk buffer
;; at the front of the list. ;; at the front of the list.

View file

@ -306,8 +306,8 @@ mode, ON-REGION is ignored and assumed true if the region is active."
(goto-char tempo-region-start)) (goto-char tempo-region-start))
(save-excursion (save-excursion
(tempo-insert-mark (point-marker)) (tempo-insert-mark (point-marker))
(mapc (function (lambda (elt) (mapc (lambda (elt)
(tempo-insert elt on-region))) (tempo-insert elt on-region))
(symbol-value template)) (symbol-value template))
(tempo-insert-mark (point-marker))) (tempo-insert-mark (point-marker)))
(tempo-forward-mark)) (tempo-forward-mark))
@ -449,9 +449,9 @@ never prompted."
"Tries all the user-defined element handlers in `tempo-user-elements'." "Tries all the user-defined element handlers in `tempo-user-elements'."
;; Sigh... I need (some list) ;; Sigh... I need (some list)
(catch 'found (catch 'found
(mapc (function (lambda (handler) (mapc (lambda (handler)
(let ((result (funcall handler element))) (let ((result (funcall handler element)))
(if result (throw 'found result))))) (if result (throw 'found result))))
tempo-user-elements) tempo-user-elements)
(throw 'found nil))) (throw 'found nil)))
@ -640,11 +640,11 @@ If `tempo-dirty-collection' is nil, the old collection is reused."
tempo-collection) tempo-collection)
(setq tempo-collection (setq tempo-collection
(apply (function append) (apply (function append)
(mapcar (function (lambda (tag-list) (mapcar (lambda (tag-list)
; If the format for ; If the format for
; tempo-local-tags changes, ; tempo-local-tags changes,
; change this ; change this
(eval (car tag-list)))) (eval (car tag-list)))
tempo-local-tags)))) tempo-local-tags))))
(setq tempo-dirty-collection nil))) (setq tempo-dirty-collection nil)))

View file

@ -554,7 +554,7 @@ See also `term-dynamic-complete'.
This is a good thing to set in mode hooks.") This is a good thing to set in mode hooks.")
(defvar term-input-filter (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. "Predicate for filtering additions to input history.
Only inputs answering true to this function are saved on the input Only inputs answering true to this function are saved on the input
history list. Default is to save anything that isn't all whitespace.") 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...") (message "Terminal-emulator pager break help...")
(sit-for 0) (sit-for 0)
(with-electric-help (with-electric-help
(function (lambda () (lambda ()
(princ (substitute-command-keys (princ (substitute-command-keys
"\\<term-pager-break-map>\ "\\<term-pager-break-map>\
Terminal-emulator MORE break.\n\ Terminal-emulator MORE break.\n\
Type one of the following keys:\n\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 Any other key is passed through to the program
running under the terminal emulator and disables pager processing until running under the terminal emulator and disables pager processing until
all pending output has been dealt with.")) all pending output has been dealt with."))
nil)))) nil)))
(defun term-pager-continue (new-count) (defun term-pager-continue (new-count)
(let ((process (get-buffer-process (current-buffer)))) (let ((process (get-buffer-process (current-buffer))))

View file

@ -3503,9 +3503,9 @@ column must consists from cells of same width."
(let ((cell-list (table--vertical-cell-list 'top-to-bottom))) (let ((cell-list (table--vertical-cell-list 'top-to-bottom)))
(unless (unless
(and (table--uniform-list-p (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 (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")) (error "Cells in this column are not in uniform width"))
(unless lu-coord (unless lu-coord
(setq lu-coord (table--get-coordinate (caar cell-list)))) (setq lu-coord (table--get-coordinate (caar cell-list))))

View file

@ -422,7 +422,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
(push (cons "--" (match-beginning 0)) menu)) (push (cons "--" (match-beginning 0)) menu))
;; Sort in increasing buffer position order. ;; 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 ;;;; Outline support

View file

@ -125,8 +125,8 @@ The actual return value is the last modification time of the cache file."
(setq fname (and fname (setq fname (and fname
(mapconcat (mapconcat
(function (lambda (x) (lambda (x)
(if (= x ?~) "" (char-to-string x)))) (if (= x ?~) "" (char-to-string x)))
fname "")) fname ""))
fname (cond fname (cond
((null fname) nil) ((null fname) nil)