]> git.eshelyaron.com Git - emacs.git/commitdiff
Use 'compf' in a few more places.
authorEshel Yaron <me@eshelyaron.com>
Thu, 20 Feb 2025 20:58:10 +0000 (21:58 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 20 Feb 2025 20:58:10 +0000 (21:58 +0100)
lisp/cus-edit.el
lisp/format.el
lisp/net/secrets.el
lisp/org/org-lint.el
lisp/textmodes/table.el

index 48ea56ba84ee1c0bfb157b8ab700b27302f519d4..3d2b80929426c5ad52476c4b367288410a4e2745 100644 (file)
@@ -1171,8 +1171,7 @@ for the MODE to customize."
   (customize-group (custom-group-of-mode mode)))
 
 (put 'customize-mode 'minibuffer-action
-     (cons (lambda (m) (save-selected-window (customize-mode (intern m))))
-           "customize"))
+     (cons (compf save-selected-window customize-mode intern) "customize"))
 
 (defun customize-read-group ()
   (let* ((sym (symbol-at-point))
@@ -1216,8 +1215,7 @@ If OTHER-WINDOW is non-nil, display in another window."
       (pop-to-buffer-same-window name)))))
 
 (put 'customize-group 'minibuffer-action
-     (cons (compf save-selected-window customize-group)
-           "customize"))
+     (cons (compf save-selected-window customize-group) "customize"))
 
 ;;;###autoload
 (defun customize-group-other-window (&optional group)
@@ -1244,8 +1242,7 @@ If OTHER-WINDOW is non-nil, display in another window."
       (message "`%s' is an alias for `%s'" symbol basevar))))
 
 (put 'customize-option 'minibuffer-action
-     (cons (lambda (v) (save-selected-window (customize-option (intern v))))
-           "customize"))
+     (cons (compf save-selected-window customize-option intern) "customize"))
 
 (defface custom-boolean-option-on
   '((t :inherit success))
@@ -1508,8 +1505,7 @@ suggest to customize that face, if it's customizable."
                       (custom-unlispify-tag-name face))))))
 
 (put 'customize-face 'minibuffer-action
-     (cons (lambda (f) (save-selected-window (customize-face (intern f))))
-           "customize"))
+     (cons (compf save-selected-window customize-face intern) "customize"))
 
 ;;;###autoload
 (defun customize-face-other-window (&optional face)
@@ -1631,8 +1627,7 @@ If TYPE is `groups', include only groups."
      "*Customize Apropos*")))
 
 (put 'customize-apropos 'minibuffer-action
-     (cons (compf save-selected-window customize-apropos)
-           "customize-apropos"))
+     (cons (compf save-selected-window customize-apropos) "customize-apropos"))
 
 ;;;###autoload
 (defun customize-apropos-options (regexp &optional _ignored)
@@ -5863,8 +5858,7 @@ changes."
                                (custom-unlispify-tag-name icon))))
 
 (put 'customize-icon 'minibuffer-action
-     (cons (lambda (i) (save-selected-window (customize-icon (intern i))))
-           "customize"))
+     (cons (compf save-selected-window customize-icon intern) "customize"))
 
 (defun custom-icon-state-set (widget &optional state)
   "Set the state of WIDGET to STATE."
index 855d7a73f92ceba4c321e797b576abb43bb19ec1..03d7be4a08173584ba54945846f54ba8c5479395 100644 (file)
@@ -476,8 +476,7 @@ a list (ABSOLUTE-FILE-NAME SIZE)."
   "Read and return the name of a format.
 Return value is a list, like `buffer-file-format'; it may be nil.
 Formats are defined in `format-alist'.  Optional arg is the PROMPT to use."
-  (let* ((table (mapcar (lambda (x) (list (symbol-name (car x))))
-                       format-alist))
+  (let* ((table (mapcar (compf list symbol-name car) format-alist))
         (ans (completing-read (or prompt "Format: ") table nil t)))
     (if (not (equal "" ans)) (list (intern ans)))))
 
index 049def1dc8d0dc749702d2cecbf6e5d02bcecb4f..27f332d7d6a809f92f1633a73a97b90f6d2eda1e 100644 (file)
@@ -852,7 +852,7 @@ to their attributes."
            (1+ (length "password"))
            (mapcar
             ;; Attribute names have a leading ":", which will be suppressed.
-            (lambda (attribute) (length (symbol-name (car attribute))))
+            (compf length symbol-name car)
             attributes)))))
     (cons
      ;; The password widget.
index 5ed251944c5155bc6f8af1a99524f3e329e85cd7..a6e8cf5acbe57885efa3b16db97f824c2ca9ecac 100644 (file)
@@ -517,7 +517,7 @@ instead"
   (let* ((deprecated-babel-properties
          ;; DIR is also used for attachments.
          (delete "dir"
-                 (mapcar (lambda (arg) (downcase (symbol-name (car arg))))
+                 (mapcar (compf downcase symbol-name car)
                          org-babel-common-header-args-w-values)))
         (deprecated-re
          (format "\\`%s[ \t]" (regexp-opt deprecated-babel-properties t))))
index 938a4c8c46d4759a707d96a78ec6ecac229c7c7e..00362cb1e6c587d13792d9ecb10d0717f9fe9a23 100644 (file)
@@ -3432,9 +3432,9 @@ consists from cells of same height."
       (let ((cell-list (table--horizontal-cell-list 'left-to-right)))
        (unless
            (and (table--uniform-list-p
-                 (mapcar (lambda (cell) (cdr (table--get-coordinate (car cell)))) cell-list))
+                 (mapcar (compf cdr table--get-coordinate car) cell-list))
                 (table--uniform-list-p
-                 (mapcar (lambda (cell) (cdr (table--get-coordinate (cdr cell)))) cell-list)))
+                 (mapcar (compf cdr table--get-coordinate cdr) cell-list)))
          (error "Cells in this row are not in uniform height"))
        (unless lu-coord
          (setq lu-coord (table--get-coordinate (caar cell-list))))
@@ -3493,9 +3493,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 (lambda (cell) (car (table--get-coordinate (car cell)))) cell-list))
+                  (mapcar (compf car table--get-coordinate car) cell-list))
                 (table--uniform-list-p
-                  (mapcar (lambda (cell) (car (table--get-coordinate (cdr cell)))) cell-list)))
+                  (mapcar (compf car table--get-coordinate cdr) cell-list)))
          (error "Cells in this column are not in uniform width"))
        (unless lu-coord
          (setq lu-coord (table--get-coordinate (caar cell-list))))