]> git.eshelyaron.com Git - emacs.git/commitdiff
Expose some lambdas currently hidden in quoted data
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 24 Mar 2025 21:14:26 +0000 (17:14 -0400)
committerEshel Yaron <me@eshelyaron.com>
Tue, 25 Mar 2025 18:19:28 +0000 (19:19 +0100)
* lisp/language/chinese.el ("Chinese-GB", "Chinese-BIG5")
("Chinese-CNS", "Chinese-EUC-TW", "Chinese-GBK"):
* lisp/isearch.el (isearch-menu-bar-map):
* lisp/international/mule-cmds.el (language-info-custom-alist):
* lisp/font-lock.el (cpp-font-lock-keywords):
* lisp/cus-start.el (<toplevel>): Expose lambda-expressions to the compiler.

(cherry picked from commit f66c92a793557f6ac14f6dd07ad97f3a6057b3c9)

lisp/cus-start.el
lisp/font-lock.el
lisp/international/mule-cmds.el
lisp/isearch.el
lisp/language/chinese.el

index a1dc852c99065b57badd3ebcf9cf502218baee8c..2a75817dc85c576fe1366c3f8c314ea6bafaf678 100644 (file)
             (word-wrap display boolean)
              (word-wrap-by-category
               display boolean "28.1"
-              :set (lambda (symbol value)
-                     (set-default symbol value)
-                     (when value (require 'kinsoku))))
+              :set ,(lambda (symbol value)
+                      (set-default symbol value)
+                      (when value (require 'kinsoku))))
             (selective-display-ellipses display boolean)
             (indicate-empty-lines fringe boolean)
             (indicate-buffer-boundaries
@@ -157,9 +157,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             (cursor-in-non-selected-windows
              cursor ,cursor-type-types nil
              :tag "Cursor In Non-selected Windows"
-             :set (lambda (symbol value)
-                    (set-default symbol value)
-                    (force-mode-line-update t)))
+             :set ,(lambda (symbol value)
+                     (set-default symbol value)
+                     (force-mode-line-update t)))
             (transient-mark-mode editing-basics boolean nil
                                  :standard (not noninteractive)
                                  :initialize custom-initialize-delay
@@ -220,8 +220,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
                            (coding-system
                             :tag "Single coding system"
                             :value undecided
-                            :match (lambda (widget value)
-                                     (and value (not (functionp value)))))
+                            :match ,(lambda (_widget value)
+                                      (and value (not (functionp value)))))
                            (function :value ignore))))
             ;; dispnew.c
             (baud-rate display integer)
@@ -307,7 +307,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
               frames (choice
                       (const :tag "Off" :value nil)
                       (const :tag "On" :value t)
-                      (const :tag "Auto-raise" :value auto-raise)) "26.1")
+                      (const :tag "Auto-raise" :value auto-raise))
+              "26.1")
              (yes-or-no-prompt menu string "30.1")
             ;; fontset.c
             ;; FIXME nil is the initial value, fontset.el setqs it.
@@ -696,7 +697,8 @@ since it could result in memory overflow and make Emacs crash."
              display (choice
                       (const :tag "Off" :value nil)
                       (const :tag "Immediate" :value t)
-                      (number :tag "Delay by secs" :value 0.5)) "22.1")
+                      (number :tag "Delay by secs" :value 0.5))
+              "22.1")
              (tool-bar-style
              frames (choice
                      (const :tag "Images" :value image)
@@ -704,18 +706,19 @@ since it could result in memory overflow and make Emacs crash."
                      (const :tag "Both, text below image" :value both)
                      (const :tag "Both, text to right of image" :value both-horiz)
                      (const :tag "Both, text to left of image" :value text-image-horiz)
-                     (const :tag "System default" :value nil)) "24.1")
+                     (const :tag "System default" :value nil))
+              "24.1")
              (tool-bar-max-label-size frames integer "24.1")
              (tab-bar-position
               tab-bar (choice
                        (const :tag "Tab bar above tool bar" nil)
                        (const :tag "Tab bar below tool bar" t))
               "27.1"
-              :set (lambda (sym val)
-                     (set-default sym val)
-                     ;; Redraw the bars:
-                     (tab-bar-mode -1)
-                     (tab-bar-mode 1)))
+              :set ,(lambda (sym val)
+                      (set-default sym val)
+                      ;; Redraw the bars:
+                      (tab-bar-mode -1)
+                      (tab-bar-mode 1)))
             (auto-hscroll-mode scrolling
                                 (choice
                                  (const :tag "Don't scroll automatically"
@@ -810,7 +813,7 @@ since it could result in memory overflow and make Emacs crash."
                       :format "%v")
                integer)
               "27.1"
-              :safe (lambda (value) (or (booleanp value) (integerp value))))
+              :safe ,(lambda (value) (or (booleanp value) (integerp value))))
              (display-fill-column-indicator-character
               display-fill-column-indicator
               (choice
@@ -822,7 +825,7 @@ since it could result in memory overflow and make Emacs crash."
                       :value nil)
                character)
               "27.1"
-              :safe (lambda (value) (or (characterp value) (null value))))
+              :safe ,(lambda (value) (or (characterp value) (null value))))
              (composition-break-at-point display boolean "29.1")
             ;; xfaces.c
             (scalable-fonts-allowed
index fa12bd7aa531e18bbcc75ea398b9ee87cbaa8ecf..f1e72186d150e209cbc2acde62d7fe33957919da 100644 (file)
@@ -2402,16 +2402,16 @@ This should be an integer.  Used in `cpp-font-lock-keywords'.")
        1 font-lock-string-face prepend)
      ;;
      ;; Fontify function macro names.
-     '("^#[ \t]*define[ \t]+\\([[:alpha:]_][[:alnum:]_$]*\\)("
+     `("^#[ \t]*define[ \t]+\\([[:alpha:]_][[:alnum:]_$]*\\)("
        (1 font-lock-function-name-face prepend)
        ;;
        ;; Macro arguments.
-       ((lambda (limit)
-         (re-search-forward
-          "\\(?:\\([[:alpha:]_][[:alnum:]_]*\\)[,]?\\)"
-          (or (save-excursion (re-search-forward ")" limit t))
-              limit)
-          t))
+       (,(lambda (limit)
+          (re-search-forward
+           "\\(?:\\([[:alpha:]_][[:alnum:]_]*\\)[,]?\\)"
+           (or (save-excursion (re-search-forward ")" limit t))
+               limit)
+           t))
        nil nil (1 font-lock-variable-name-face prepend)))
      ;;
      ;; Fontify symbol names in #elif or #if ... defined preprocessor directives.
index d246ef477c75da4ab388a49c0b4209c348a9aba1..5bd271b844fc0c8417b3c70813af77d3704af8be 100644 (file)
@@ -2020,13 +2020,13 @@ See `set-language-info-alist' for use in programs."
             (set-language-info-alist (car elt) (cdr elt)))
           ;; re-set the environment in case its parameters changed
           (set-language-environment current-language-environment)))
-  :type '(alist
+  :type `(alist
          :key-type (string :tag "Language environment"
                            :completions
-                            (lambda (string pred action)
-                              (let ((completion-ignore-case t))
-                                (complete-with-action
-                                 action language-info-alist string pred))))
+                            ,(lambda (string pred action)
+                               (let ((completion-ignore-case t))
+                                 (complete-with-action
+                                  action language-info-alist string pred))))
          :value-type
          (alist :key-type symbol
                 :options ((documentation string)
index d99fc47412cf8f6f0534fb8093979bc61b17733f..c30d2cde0c5c4ce83d944c61892b7ada53a97989 100644 (file)
@@ -645,10 +645,10 @@ This is like `describe-bindings', but displays only Isearch keys."
 
 (easy-menu-define isearch-menu-bar-map  isearch-mode-map
   "Menu for `isearch-mode'."
-  '("Isearch"
+  `("Isearch"
     ["Cancel search" isearch-cancel
      :help "Cancel current search and return to starting point"
-     :filter (lambda (binding)
+     :filter ,(lambda (binding)
                (if isearch-success 'isearch-abort binding))]
     ["Remove characters not found" isearch-abort
      :help "Quit current search"
index d8bd6bea506be740d9c62a8452ff6250e772117c..cacafc2d8842173440a14835ed68207512403411 100644 (file)
 (coding-system-put 'chinese-hz :ascii-compatible-p nil)
 
 (set-language-info-alist
- "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng)
+ "Chinese-GB" `((charset chinese-gb2312 chinese-sisheng)
                (iso639-language . zh)
                 (cjk-locale-symbol . zh_CN)
-               (setup-function . (lambda ()
-                                   (use-cjk-char-width-table 'zh_CN)))
+               (setup-function . ,(lambda ()
+                                    (use-cjk-char-width-table 'zh_CN)))
                (exit-function . use-default-char-width-table)
                (coding-system chinese-iso-8bit iso-2022-cn chinese-hz)
                (coding-priority chinese-iso-8bit chinese-gbk chinese-big5
 (define-coding-system-alias 'cp950 'chinese-big5)
 
 (set-language-info-alist
- "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2)
+ "Chinese-BIG5" `((charset chinese-big5-1 chinese-big5-2)
                  (iso639-language . zh)
                   (cjk-locale-symbol . zh_HK)
-                 (setup-function . (lambda ()
-                                     (use-cjk-char-width-table 'zh_HK)))
+                 (setup-function . ,(lambda ()
+                                      (use-cjk-char-width-table 'zh_HK)))
                  (exit-function . use-default-char-width-table)
                  (coding-system chinese-big5 chinese-iso-7bit)
                  (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit
 (define-coding-system-alias 'euc-taiwan 'euc-tw)
 
 (set-language-info-alist
- "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2
+ "Chinese-CNS" `((charset chinese-cns11643-1 chinese-cns11643-2
                          chinese-cns11643-3 chinese-cns11643-4
                          chinese-cns11643-5 chinese-cns11643-6
                          chinese-cns11643-7)
                 (iso639-language . zh)
                  (cjk-locale-symbol . zh_TW)
-                (setup-function . (lambda ()
-                                    (use-cjk-char-width-table 'zh_TW)))
+                (setup-function . ,(lambda ()
+                                     (use-cjk-char-width-table 'zh_TW)))
                 (exit-function . use-default-char-width-table)
                 (coding-system iso-2022-cn euc-tw)
                 (coding-priority iso-2022-cn euc-tw chinese-big5
@@ -216,14 +216,14 @@ accepts Big5 for input also (which is then converted to CNS)."))
  '("Chinese"))
 
 (set-language-info-alist
- "Chinese-EUC-TW" '((charset chinese-cns11643-1 chinese-cns11643-2
+ "Chinese-EUC-TW" `((charset chinese-cns11643-1 chinese-cns11643-2
                             chinese-cns11643-3 chinese-cns11643-4
                             chinese-cns11643-5 chinese-cns11643-6
                             chinese-cns11643-7 chinese-big5-1 chinese-big5-2)
                    (iso639-language . zh)
                     (cjk-locale-symbol . zh_TW)
-                   (setup-function . (lambda ()
-                                       (use-cjk-char-width-table 'zh_TW)))
+                   (setup-function . ,(lambda ()
+                                        (use-cjk-char-width-table 'zh_TW)))
                    (exit-function . use-default-char-width-table)
                    (coding-system euc-tw iso-2022-cn)
                    (coding-priority euc-tw chinese-big5 iso-2022-cn
@@ -250,11 +250,11 @@ converted to CNS)."))
 (define-coding-system-alias 'windows-936 'chinese-gbk)
 
 (set-language-info-alist
- "Chinese-GBK" '((charset chinese-gbk)
+ "Chinese-GBK" `((charset chinese-gbk)
                 (iso639-language . zh)
                  (cjk-locale-symbol . zh_CN)
-                (setup-function . (lambda ()
-                                    (use-cjk-char-width-table 'zh_CN)))
+                (setup-function . ,(lambda ()
+                                     (use-cjk-char-width-table 'zh_CN)))
                 (exit-function . use-default-char-width-table)
                 (coding-system chinese-gbk)
                 (coding-priority gbk iso-2022-cn chinese-big5