From: Stefan Monnier Date: Mon, 24 Mar 2025 21:14:26 +0000 (-0400) Subject: Expose some lambdas currently hidden in quoted data X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ff0a7dee7553ce3a73720c5739e0e85826de02d;p=emacs.git Expose some lambdas currently hidden in quoted data * 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 (): Expose lambda-expressions to the compiler. (cherry picked from commit f66c92a793557f6ac14f6dd07ad97f3a6057b3c9) --- diff --git a/lisp/cus-start.el b/lisp/cus-start.el index a1dc852c990..2a75817dc85 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -102,9 +102,9 @@ (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 diff --git a/lisp/font-lock.el b/lisp/font-lock.el index fa12bd7aa53..f1e72186d15 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -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. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index d246ef477c7..5bd271b844f 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -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) diff --git a/lisp/isearch.el b/lisp/isearch.el index d99fc47412c..c30d2cde0c5 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -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" diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el index d8bd6bea506..cacafc2d884 100644 --- a/lisp/language/chinese.el +++ b/lisp/language/chinese.el @@ -109,11 +109,11 @@ (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 @@ -141,11 +141,11 @@ (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 @@ -195,14 +195,14 @@ (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