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)
(cherry picked from commit
0e76716c5faa5e91ac3913b02ba4dc690cf5df83)
(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)
(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)
(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))
"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.
(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)
(?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))
(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.
;; 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
(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
(defun ibuffer-mark-modified-buffers ()
"Mark all modified buffers."
(interactive "" ibuffer-mode)
- (ibuffer-mark-on-buffer
- (lambda (buf) (buffer-modified-p buf))))
+ (ibuffer-mark-on-buffer #'buffer-modified-p))
;;;###autoload
(defun ibuffer-mark-unsaved-buffers ()
;; ;; 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? "
(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.
(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)))
(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.
(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
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 "/")
"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.
(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))
(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)))
,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))))
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
;; 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)
'("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)
(newline
(mapconcat #'identity values "\n"))
(split
- (cl-mapcan (lambda (v) (split-string v)) values))
+ (cl-mapcan #'split-string values))
((t)
(org-last values))
(otherwise
(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))
(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)
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)
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)
,@(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
(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