Delete redundant lambdas around unary functions
This is not just stylistic, but also slightly faster. These are all regular defuns, of course, as this won't work with macros and defsubsts. * lisp/calc/calc-nlfit.el (math-nlfit-fit-curve) (calc-fit-hubbert-linear-curve): * lisp/calendar/cal-tex.el (cal-tex-latexify-list): * lisp/calendar/todo-mode.el (todo-sort): * lisp/cedet/semantic/ctxt.el (semantic-ctxt-end-of-symbol-default) (semantic-ctxt-current-symbol-default): * lisp/cedet/semantic/symref.el (semantic-symref-result-get-files): * lisp/cedet/semantic/texi.el (semantic-texi-command-completion-list): * lisp/descr-text.el (describe-char): * lisp/emacs-lisp/eieio-datadebug.el (data-debug-add-specialized-thing): * lisp/emacs-lisp/rmc.el (read-multiple-choice--short-answers): * lisp/eshell/em-pred.el (eshell-modifier-alist): * lisp/gnus/gnus-cache.el (gnus-cache-articles-in-group): * lisp/gnus/gnus-dired.el (gnus-dired-attach): * lisp/help-mode.el (help-package-def): * lisp/ibuf-ext.el (ibuffer-mark-modified-buffers): * lisp/image/image-dired.el: * lisp/international/quail.el (quail-keyseq-translate) (quail-get-translations): * lisp/isearch.el (isearch-pre-command-hook) (search-within-boundaries): * lisp/mail/supercite.el (sc-ask): * lisp/mh-e/mh-e.el (mh-variant-set): * lisp/net/rcirc.el (rcirc-nick-channels, rcirc-channel-nicks): (rcirc-browse-url): * lisp/obsolete/thumbs.el (thumbs-cleanup-thumbsdir): * lisp/org/org-agenda.el (org-agenda-filter-completion-function): * lisp/org/org-table.el (org-table-eval-formula): * lisp/org/org.el (org-set-regexps-and-options): * lisp/org/ox.el (org-export--get-inbuffer-options): * lisp/ses.el (ses-range): * lisp/textmodes/emacs-news-mode.el (emacs-news--buttonize): * lisp/textmodes/ispell.el (ispell-begin-tex-skip-regexp): * lisp/vc/vc-cvs.el (vc-cvs-stay-local-p): * lisp/window.el (window--state-get-1): * test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-all-groups-work): Delete redundant lambdas around unary functions. (Bug#66816)
This commit is contained in:
parent
14e0f214e6
commit
0e76716c5f
32 changed files with 41 additions and 53 deletions
|
@ -678,7 +678,7 @@
|
|||
(sdata (if (math-contains-sdev-p ydata)
|
||||
(mapcar (lambda (x) (math-get-sdev x t)) ydata)
|
||||
nil))
|
||||
(ydata (mapcar (lambda (x) (math-get-value x)) ydata))
|
||||
(ydata (mapcar #'math-get-value ydata))
|
||||
(calc-curve-varnames nil)
|
||||
(calc-curve-coefnames nil)
|
||||
(calc-curve-nvars 1)
|
||||
|
@ -757,7 +757,7 @@
|
|||
(sdata (if (math-contains-sdev-p pdata)
|
||||
(mapcar (lambda (x) (math-get-sdev x t)) pdata)
|
||||
nil))
|
||||
(pdata (mapcar (lambda (x) (math-get-value x)) pdata))
|
||||
(pdata (mapcar #'math-get-value pdata))
|
||||
(poverqdata (math-map-binop 'math-div pdata qdata))
|
||||
(parmvals (math-nlfit-least-squares qdata poverqdata sdata sdevv))
|
||||
(finalparms (list (nth 0 parmvals)
|
||||
|
|
|
@ -1600,7 +1600,7 @@ FINAL-SEPARATOR is non-nil."
|
|||
(or separator (setq separator "\\\\"))
|
||||
(let (result)
|
||||
(setq result
|
||||
(mapconcat (lambda (x) (cal-tex-LaTeXify-string x))
|
||||
(mapconcat #'cal-tex-LaTeXify-string
|
||||
(dolist (d date-list (reverse result))
|
||||
(and (car d)
|
||||
(calendar-date-equal date (car d))
|
||||
|
|
|
@ -3772,7 +3772,7 @@ option `todo-categories-align'."
|
|||
"Return a copy of LIST, possibly sorted according to KEY."
|
||||
(let* ((l (copy-sequence list))
|
||||
(fn (if (eq key 'alpha)
|
||||
(lambda (x) (upcase x)) ; Alphabetize case insensitively.
|
||||
#'upcase ; Alphabetize case insensitively.
|
||||
(lambda (x) (todo-get-count key x))))
|
||||
;; Keep track of whether the last sort by key was descending or
|
||||
;; ascending.
|
||||
|
|
|
@ -362,7 +362,7 @@ This will move past type/field names when applicable.
|
|||
Depends on `semantic-type-relation-separator-character', and will
|
||||
work on C like languages."
|
||||
(if point (goto-char point))
|
||||
(let* ((fieldsep1 (mapconcat (lambda (a) (regexp-quote a))
|
||||
(let* ((fieldsep1 (mapconcat #'regexp-quote
|
||||
semantic-type-relation-separator-character
|
||||
"\\|"))
|
||||
;; NOTE: The [ \n] expression below should used \\s-, but that
|
||||
|
@ -446,7 +446,7 @@ This will include a list of type/field names when applicable.
|
|||
Depends on `semantic-type-relation-separator-character'."
|
||||
(save-excursion
|
||||
(if point (goto-char point))
|
||||
(let* ((fieldsep1 (mapconcat (lambda (a) (regexp-quote a))
|
||||
(let* ((fieldsep1 (mapconcat #'regexp-quote
|
||||
semantic-type-relation-separator-character
|
||||
"\\|"))
|
||||
;; NOTE: The [ \n] expression below should used \\s-, but that
|
||||
|
|
|
@ -243,7 +243,7 @@ unmodified as components of their parent tags."
|
|||
;; table, and reorganize them into buckets based on class.
|
||||
;;
|
||||
(defvar semantic-bucketize-tag-class
|
||||
;; Must use lambda because `semantic-tag-class' is a macro.
|
||||
;; Must use lambda because `semantic-tag-class' is a defsubst.
|
||||
(lambda (tok) (semantic-tag-class tok))
|
||||
"Function used to get a symbol describing the class of a tag.
|
||||
This function must take one argument of a semantic tag.
|
||||
|
@ -401,6 +401,7 @@ buckets with the bucket function."
|
|||
;; get embedded types to scan and make copies
|
||||
;; of them.
|
||||
(mapcar
|
||||
;; Must use lambda because `semantic-tag-clone' is a defsubst.
|
||||
(lambda (tok) (semantic-tag-clone tok))
|
||||
(semantic-find-tags-by-class 'type
|
||||
(semantic-tag-type-members (car decent-list)))))
|
||||
|
|
|
@ -398,7 +398,7 @@ this list.")
|
|||
(if (slot-boundp result 'hit-files)
|
||||
(oref result hit-files)
|
||||
(let* ((lines (oref result hit-lines))
|
||||
(files (mapcar (lambda (a) (cdr a)) lines))
|
||||
(files (mapcar #'cdr lines))
|
||||
(ans nil))
|
||||
(setq ans (list (car files))
|
||||
files (cdr files))
|
||||
|
|
|
@ -385,7 +385,7 @@ Optional argument POINT is where to look for the environment."
|
|||
))
|
||||
|
||||
(defvar semantic-texi-command-completion-list
|
||||
(append (mapcar (lambda (a) (car a)) texinfo-section-list)
|
||||
(append (mapcar #'car texinfo-section-list)
|
||||
texinfo-environments
|
||||
;; Is there a better list somewhere? Here are few
|
||||
;; of the top of my head.
|
||||
|
|
|
@ -407,8 +407,7 @@ The character information includes:
|
|||
(composition-string nil)
|
||||
(disp-vector (and display-table (aref display-table char)))
|
||||
(multibyte-p enable-multibyte-characters)
|
||||
(overlays (mapcar (lambda (o) (overlay-properties o))
|
||||
(overlays-at pos)))
|
||||
(overlays (mapcar #'overlay-properties (overlays-at pos)))
|
||||
(char-description (if (< char 128)
|
||||
(single-key-description char)
|
||||
(string (if (not multibyte-p)
|
||||
|
|
|
@ -111,7 +111,7 @@ PREBUTTONTEXT is some text between PREFIX and the object button."
|
|||
)))))))
|
||||
|
||||
;;; Augment the Data debug thing display list.
|
||||
(data-debug-add-specialized-thing (lambda (thing) (eieio-object-p thing))
|
||||
(data-debug-add-specialized-thing #'eieio-object-p
|
||||
#'data-debug-insert-object-button)
|
||||
|
||||
;;; DEBUG METHODS
|
||||
|
|
|
@ -191,7 +191,7 @@ Usage example:
|
|||
(format
|
||||
"%s (%s): "
|
||||
prompt
|
||||
(mapconcat (lambda (e) (cdr e)) altered-names ", ")))
|
||||
(mapconcat #'cdr altered-names ", ")))
|
||||
tchar buf wrong-char answer command)
|
||||
(save-window-excursion
|
||||
(save-excursion
|
||||
|
|
|
@ -122,7 +122,7 @@ The format of each entry is
|
|||
(?e . (lambda (lst) (mapcar #'file-name-extension lst)))
|
||||
(?t . (lambda (lst) (mapcar #'file-name-nondirectory lst)))
|
||||
(?q . #'identity) ; Obsolete as of Emacs 31.1.
|
||||
(?u . (lambda (lst) (seq-uniq lst)))
|
||||
(?u . #'seq-uniq)
|
||||
(?o . (lambda (lst) (sort lst #'string-lessp)))
|
||||
(?O . (lambda (lst) (sort lst #'string-greaterp)))
|
||||
(?j . (eshell-join-members))
|
||||
|
|
|
@ -502,7 +502,7 @@ Returns the list of articles removed."
|
|||
(file-name-coding-system nnmail-pathname-coding-system))
|
||||
(when (file-exists-p dir)
|
||||
(setq articles
|
||||
(sort (mapcar (lambda (name) (string-to-number name))
|
||||
(sort (mapcar #'string-to-number
|
||||
(directory-files dir nil "\\`[0-9]+\\'" t))
|
||||
#'<))
|
||||
;; Update the cache active file, just to synch more.
|
||||
|
|
|
@ -136,10 +136,8 @@ filenames."
|
|||
;; warn if user tries to attach without any files marked
|
||||
(if (null files-to-attach)
|
||||
(error "No files to attach")
|
||||
(setq files-str
|
||||
(mapconcat
|
||||
(lambda (f) (file-name-nondirectory f))
|
||||
files-to-attach ", "))
|
||||
(setq files-str (mapconcat #'file-name-nondirectory
|
||||
files-to-attach ", "))
|
||||
(setq bufs (gnus-dired-mail-buffers))
|
||||
|
||||
;; set up destination mail composition buffer
|
||||
|
|
|
@ -368,7 +368,7 @@ The format is (FUNCTION ARGS...).")
|
|||
|
||||
(define-button-type 'help-package-def
|
||||
:supertype 'help-xref
|
||||
'help-function (lambda (file) (dired file))
|
||||
'help-function #'dired
|
||||
'help-echo "mouse-2, RET: visit package directory")
|
||||
|
||||
(define-button-type 'help-theme-def
|
||||
|
|
|
@ -1872,8 +1872,7 @@ Otherwise buffers whose name matches an element of
|
|||
(defun ibuffer-mark-modified-buffers ()
|
||||
"Mark all modified buffers."
|
||||
(interactive)
|
||||
(ibuffer-mark-on-buffer
|
||||
(lambda (buf) (buffer-modified-p buf))))
|
||||
(ibuffer-mark-on-buffer #'buffer-modified-p))
|
||||
|
||||
;;;###autoload
|
||||
(defun ibuffer-mark-unsaved-buffers ()
|
||||
|
|
|
@ -2084,7 +2084,7 @@ when using per-directory thumbnail file storage"))
|
|||
;; ;; Sort function. Compare time between two files.
|
||||
;; (lambda (l1 l2)
|
||||
;; (time-less-p (car l1) (car l2)))))
|
||||
;; (dirsize (apply '+ (mapcar (lambda (x) (cadr x)) files))))
|
||||
;; (dirsize (apply #'+ (mapcar #'cadr files))))
|
||||
;; (while (> dirsize image-dired-dir-max-size)
|
||||
;; (y-or-n-p
|
||||
;; (format "Size of thumbnail directory: %d, delete old file %s? "
|
||||
|
|
|
@ -772,8 +772,7 @@ you type is correctly handled."
|
|||
|
||||
(defun quail-keyseq-translate (keyseq)
|
||||
(apply 'string
|
||||
(mapcar (lambda (x) (quail-keyboard-translate x))
|
||||
keyseq)))
|
||||
(mapcar #'quail-keyboard-translate keyseq)))
|
||||
|
||||
(defun quail-insert-kbd-layout (kbd-layout)
|
||||
"Insert the visual keyboard layout table according to KBD-LAYOUT.
|
||||
|
@ -2144,9 +2143,7 @@ minibuffer and the selected frame has no other windows)."
|
|||
(setq str
|
||||
(format "%s[%s]"
|
||||
str
|
||||
(concat (sort (mapcar (lambda (x) (car x))
|
||||
(cdr map))
|
||||
'<)))))
|
||||
(concat (sort (mapcar #'car (cdr map)) #'<)))))
|
||||
;; Show list of translations.
|
||||
(if (and quail-current-translations
|
||||
(not (quail-deterministic)))
|
||||
|
|
|
@ -3230,7 +3230,7 @@ See more for options in `search-exit-option'."
|
|||
(setq isearch-pre-move-point (point)))
|
||||
;; Append control characters to the search string
|
||||
((eq search-exit-option 'append)
|
||||
(unless (memq nil (mapcar (lambda (k) (characterp k)) key))
|
||||
(unless (memq nil (mapcar #'characterp key))
|
||||
(isearch-process-search-string key key))
|
||||
(setq this-command 'ignore))
|
||||
;; Other characters terminate the search and are then executed normally.
|
||||
|
@ -4654,8 +4654,7 @@ defaults to the value of `isearch-search-fun-default' when nil."
|
|||
(match-data)))))
|
||||
(when found (goto-char found))
|
||||
(when match-data (set-match-data
|
||||
(mapcar (lambda (m) (copy-marker m))
|
||||
match-data))))
|
||||
(mapcar #'copy-marker match-data))))
|
||||
(setq found (funcall
|
||||
(or search-fun (isearch-search-fun-default))
|
||||
string (if bound (if isearch-forward
|
||||
|
|
|
@ -596,7 +596,7 @@ selected letter is returned, or nil if the question was not answered.
|
|||
Note that WORD is a string and LETTER is a character. All LETTERs in
|
||||
the list should be unique."
|
||||
(let* ((prompt (concat
|
||||
(mapconcat (lambda (elt) (car elt)) alist ", ")
|
||||
(mapconcat #'car alist ", ")
|
||||
"? ("
|
||||
(mapconcat
|
||||
(lambda (elt) (char-to-string (cdr elt))) alist "/")
|
||||
|
|
|
@ -878,7 +878,7 @@ finally GNU mailutils MH."
|
|||
(sit-for 5)
|
||||
(setq variant (concat "gnu-mh" (substring variant (match-end 0)))))
|
||||
|
||||
(let ((valid-list (mapcar (lambda (x) (car x)) (mh-variants))))
|
||||
(let ((valid-list (mapcar #'car (mh-variants))))
|
||||
(cond
|
||||
((eq variant 'none))
|
||||
((eq variant 'autodetect)
|
||||
|
|
|
@ -2272,8 +2272,7 @@ PROCESS is the process object for the current connection."
|
|||
"Return list of channels for NICK.
|
||||
PROCESS is the process object for the current connection."
|
||||
(with-rcirc-process-buffer process
|
||||
(mapcar (lambda (x) (car x))
|
||||
(gethash nick rcirc-nick-table))))
|
||||
(mapcar #'car (gethash nick rcirc-nick-table))))
|
||||
|
||||
(defun rcirc-put-nick-channel (process nick channel &optional line)
|
||||
"Add CHANNEL to list associated with NICK.
|
||||
|
@ -2327,7 +2326,7 @@ PROCESS is the process object for the current connection."
|
|||
(if record
|
||||
(setq nicks (cons (cons k (cdr record)) nicks)))))
|
||||
rcirc-nick-table)
|
||||
(mapcar (lambda (x) (car x))
|
||||
(mapcar #'car
|
||||
(sort (nconc pseudo-nicks nicks)
|
||||
(lambda (x y)
|
||||
(let ((lx (or (cdr x) 0))
|
||||
|
@ -3004,8 +3003,8 @@ If ARG is given, opens the URL in a new browser window."
|
|||
(filtered (seq-filter
|
||||
(lambda (x) (>= point (cdr x)))
|
||||
rcirc-urls))
|
||||
(completions (mapcar (lambda (x) (car x)) filtered))
|
||||
(defaults (mapcar (lambda (x) (car x)) filtered)))
|
||||
(completions (mapcar #'car filtered))
|
||||
(defaults (mapcar #'car filtered)))
|
||||
(browse-url (completing-read "Rcirc browse-url: "
|
||||
completions nil nil (car defaults) nil defaults)
|
||||
arg)))
|
||||
|
|
|
@ -204,7 +204,7 @@ reached."
|
|||
,f)))
|
||||
(directory-files (thumbs-thumbsdir) t (image-file-name-regexp)))
|
||||
(lambda (l1 l2) (time-less-p (car l1) (car l2)))))
|
||||
(dirsize (apply #'+ (mapcar (lambda (x) (cadr x)) files-list))))
|
||||
(dirsize (apply #'+ (mapcar #'cadr files-list))))
|
||||
(while (> dirsize thumbs-thumbsdir-max-size)
|
||||
(progn
|
||||
(message "Deleting file %s" (cadr (cdar files-list))))
|
||||
|
|
|
@ -8186,7 +8186,7 @@ FLAG specifies the type of completion operation to perform. This
|
|||
function is passed as a collection function to `completing-read',
|
||||
which see."
|
||||
(let ((completion-ignore-case t) ;tags are case-sensitive
|
||||
(confirm (lambda (x) (stringp x)))
|
||||
(confirm #'stringp)
|
||||
(prefix "")
|
||||
(operator "")
|
||||
table
|
||||
|
|
|
@ -2539,8 +2539,7 @@ location of point."
|
|||
;; replace fields with duration values if relevant
|
||||
(if duration
|
||||
(setq fields
|
||||
(mapcar (lambda (x) (org-table-time-string-to-seconds x))
|
||||
fields)))
|
||||
(mapcar #'org-table-time-string-to-seconds fields)))
|
||||
(if (eq numbers t)
|
||||
(setq fields (mapcar
|
||||
(lambda (x)
|
||||
|
|
|
@ -4283,7 +4283,7 @@ related expressions."
|
|||
'("ARCHIVE" "CATEGORY" "COLUMNS" "PRIORITIES"))))
|
||||
;; Startup options. Get this early since it does change
|
||||
;; behavior for other options (e.g., tags).
|
||||
(let ((startup (cl-mapcan (lambda (value) (split-string value))
|
||||
(let ((startup (cl-mapcan #'split-string
|
||||
(cdr (assoc "STARTUP" alist)))))
|
||||
(dolist (option startup)
|
||||
(pcase (assoc-string option org-startup-options t)
|
||||
|
|
|
@ -1552,7 +1552,7 @@ Assume buffer is in Org mode. Narrowing, if any, is ignored."
|
|||
(newline
|
||||
(mapconcat #'identity values "\n"))
|
||||
(split
|
||||
(cl-mapcan (lambda (v) (split-string v)) values))
|
||||
(cl-mapcan #'split-string values))
|
||||
((t)
|
||||
(org-last values))
|
||||
(otherwise
|
||||
|
|
|
@ -4011,7 +4011,7 @@ Use `math-format-value' as a printer for Calc objects."
|
|||
(unless reorient-x
|
||||
(setq result (mapcar #'nreverse result)))
|
||||
(when transpose
|
||||
(let ((ret (mapcar (lambda (x) (list x)) (pop result))) iter)
|
||||
(let ((ret (mapcar #'list (pop result))) iter)
|
||||
(while result
|
||||
(setq iter ret)
|
||||
(dolist (elt (pop result))
|
||||
|
|
|
@ -260,7 +260,7 @@ untagged NEWS entry."
|
|||
(while (re-search-forward "\"\\(([a-z0-9-]+)[ \n][^\"]\\{1,80\\}\\)\""
|
||||
nil t)
|
||||
(buttonize-region (match-beginning 1) (match-end 1)
|
||||
(lambda (node) (info node))
|
||||
#'info
|
||||
(match-string 1)))))))
|
||||
|
||||
(defun emacs-news--sections (regexp)
|
||||
|
|
|
@ -3310,9 +3310,7 @@ otherwise, the current line is skipped."
|
|||
Generated from `ispell-tex-skip-alists'."
|
||||
(concat
|
||||
;; raw tex keys
|
||||
(mapconcat (lambda (lst) (car lst))
|
||||
(car ispell-tex-skip-alists)
|
||||
"\\|")
|
||||
(mapconcat #'car (car ispell-tex-skip-alists) "\\|")
|
||||
"\\|"
|
||||
;; keys wrapped in begin{}
|
||||
(mapconcat (lambda (lst)
|
||||
|
|
|
@ -790,7 +790,7 @@ and that it passes `vc-cvs-global-switches' to it before FLAGS."
|
|||
If FILE is a list of files, return non-nil if any of them
|
||||
individually should stay local."
|
||||
(if (listp file)
|
||||
(delq nil (mapcar (lambda (arg) (vc-cvs-stay-local-p arg)) file))
|
||||
(delq nil (mapcar #'vc-cvs-stay-local-p file))
|
||||
(let ((stay-local vc-cvs-stay-local))
|
||||
(if (symbolp stay-local) stay-local
|
||||
(let ((dirname (if (file-directory-p file)
|
||||
|
|
|
@ -6309,8 +6309,7 @@ specific buffers."
|
|||
,@(when next-buffers
|
||||
`((next-buffers
|
||||
. ,(if writable
|
||||
(mapcar (lambda (buffer) (buffer-name buffer))
|
||||
next-buffers)
|
||||
(mapcar #'buffer-name next-buffers)
|
||||
next-buffers))))
|
||||
,@(when prev-buffers
|
||||
`((prev-buffers
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
(ert-deftest shortdoc-all-groups-work ()
|
||||
"Test that all defined shortdoc groups display correctly."
|
||||
(dolist (group (mapcar (lambda (x) (car x)) shortdoc--groups))
|
||||
(dolist (group (mapcar #'car shortdoc--groups))
|
||||
(let ((buf-name (format "*Shortdoc %s*" group)) buf)
|
||||
(unwind-protect
|
||||
(progn
|
||||
|
|
Loading…
Add table
Reference in a new issue