1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 02:50:26 -08:00

Evaluate some unnecessarily quoted lambdas

* lisp/cedet/semantic/complete.el
(semantic-displayer-tooltip-max-tags):
* lisp/emacs-lisp/benchmark.el (benchmark-run-compiled):
* lisp/emacs-lisp/package.el (package--default-summary)
(package-menu-filter-by-version):
* lisp/eshell/em-pred.el (eshell-pred-file-time):
* lisp/progmodes/verilog-mode.el (verilog-auto-lineup)
(verilog-auto-reset-widths, verilog-auto-arg-format)
(verilog-auto-inst-vector, verilog-auto-inst-template-numbers):
* lisp/textmodes/bibtex.el (bibtex-dialect):
* test/lisp/autoinsert-tests.el
(autoinsert-tests-define-auto-insert-before)
(autoinsert-tests-define-auto-insert-after): Remove some unnecessary
quoting around anonymous functions.
This commit is contained in:
Basil L. Contovounesios 2020-06-21 13:42:14 +01:00
parent 4cc6854cd4
commit 1ecd350f38
7 changed files with 28 additions and 30 deletions

View file

@ -1635,7 +1635,7 @@ This will not happen if you directly set this variable via `setq'."
:group 'semantic :group 'semantic
:version "24.3" :version "24.3"
:type 'integer :type 'integer
:set '(lambda (sym var) :set (lambda (sym var)
(set-default sym var) (set-default sym var)
(when (boundp 'x-max-tooltip-size) (when (boundp 'x-max-tooltip-size)
(setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size)))))) (setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size))))))

View file

@ -81,7 +81,7 @@ result. The overhead of the `lambda's is accounted for."
(gcs (make-symbol "gcs")) (gcs (make-symbol "gcs"))
(gc (make-symbol "gc")) (gc (make-symbol "gc"))
(code (byte-compile `(lambda () ,@forms))) (code (byte-compile `(lambda () ,@forms)))
(lambda-code (byte-compile '(lambda ())))) (lambda-code (byte-compile (lambda ()))))
`(let ((,gc gc-elapsed) `(let ((,gc gc-elapsed)
(,gcs gcs-done)) (,gcs gcs-done))
(list ,(if (or (symbolp repetitions) (> repetitions 1)) (list ,(if (or (symbolp repetitions) (> repetitions 1))

View file

@ -441,7 +441,7 @@ synchronously."
&aux &aux
(name (intern name-string)) (name (intern name-string))
(version (version-to-list version-string)) (version (version-to-list version-string))
(reqs (mapcar #'(lambda (elt) (reqs (mapcar (lambda (elt)
(list (car elt) (list (car elt)
(version-to-list (cadr elt)))) (version-to-list (cadr elt))))
(if (eq 'quote (car requirements)) (if (eq 'quote (car requirements))
@ -3871,9 +3871,9 @@ If VERSION is nil or the empty string, show all packages."
(package-menu--generate t t) (package-menu--generate t t)
(package-menu--filter-by (package-menu--filter-by
(let ((fun (pcase predicate (let ((fun (pcase predicate
('= 'version-list-=) ('= #'version-list-=)
('< 'version-list-<) ('< #'version-list-<)
('> '(lambda (a b) (not (version-list-<= a b)))) ('> (lambda (a b) (not (version-list-<= a b))))
(_ (error "Unknown predicate: %s" predicate)))) (_ (error "Unknown predicate: %s" predicate))))
(ver (version-to-list version))) (ver (version-to-list version)))
(lambda (pkg-desc) (lambda (pkg-desc)

View file

@ -451,11 +451,9 @@ resultant list of strings."
`(lambda (file) `(lambda (file)
(let ((attrs (file-attributes file))) (let ((attrs (file-attributes file)))
(if attrs (if attrs
(,(if (eq qual ?-) (,(cond ((eq qual ?-) #'time-less-p)
'time-less-p ((eq qual ?+) (lambda (a b) (time-less-p b a)))
(if (eq qual ?+) (#'time-equal-p))
'(lambda (a b) (time-less-p b a))
'time-equal-p))
,when (nth ,attr-index attrs))))))) ,when (nth ,attr-index attrs)))))))
(defun eshell-pred-file-type (type) (defun eshell-pred-file-type (type)

View file

@ -605,7 +605,7 @@ are lineup only when \\[verilog-pretty-declarations] is typed."
(function :tag "Other")) (function :tag "Other"))
:group 'verilog-mode-indent ) :group 'verilog-mode-indent )
(put 'verilog-auto-lineup 'safe-local-variable (put 'verilog-auto-lineup 'safe-local-variable
'(lambda (x) (memq x '(nil all assignments declarations)))) (lambda (x) (memq x '(nil all assignments declarations))))
(defcustom verilog-indent-level 3 (defcustom verilog-indent-level 3
"Indentation of Verilog statements with respect to containing block." "Indentation of Verilog statements with respect to containing block."
@ -1118,7 +1118,7 @@ SystemVerilog designs."
:type 'boolean :type 'boolean
:group 'verilog-mode-auto) :group 'verilog-mode-auto)
(put 'verilog-auto-reset-widths 'safe-local-variable (put 'verilog-auto-reset-widths 'safe-local-variable
'(lambda (x) (memq x '(nil t unbased)))) (lambda (x) (memq x '(nil t unbased))))
(defcustom verilog-assignment-delay "" (defcustom verilog-assignment-delay ""
"Text used for delays in delayed assignments. Add a trailing space if set." "Text used for delays in delayed assignments. Add a trailing space if set."
@ -1138,7 +1138,7 @@ line."
(const :tag "Line up Assignment statements" single)) (const :tag "Line up Assignment statements" single))
:group 'verilog-mode-auto) :group 'verilog-mode-auto)
(put 'verilog-auto-arg-format 'safe-local-variable (put 'verilog-auto-arg-format 'safe-local-variable
'(lambda (x) (memq x '(packed single)))) (lambda (x) (memq x '(packed single))))
(defcustom verilog-auto-arg-sort nil (defcustom verilog-auto-arg-sort nil
"Non-nil means AUTOARG signal names will be sorted, not in declaration order. "Non-nil means AUTOARG signal names will be sorted, not in declaration order.
@ -1263,7 +1263,7 @@ otherwise no vectors if sizes match (like using nil)."
:group 'verilog-mode-auto :group 'verilog-mode-auto
:type '(choice (const nil) (const t) (const unsigned))) :type '(choice (const nil) (const t) (const unsigned)))
(put 'verilog-auto-inst-vector 'safe-local-variable (put 'verilog-auto-inst-vector 'safe-local-variable
'(lambda (x) (memq x '(nil t unsigned)))) (lambda (x) (memq x '(nil t unsigned))))
(defcustom verilog-auto-inst-template-numbers nil (defcustom verilog-auto-inst-template-numbers nil
"If true, when creating templated ports with AUTOINST, add a comment. "If true, when creating templated ports with AUTOINST, add a comment.
@ -1280,7 +1280,7 @@ won't merge conflict."
:group 'verilog-mode-auto :group 'verilog-mode-auto
:type '(choice (const nil) (const t) (const lhs))) :type '(choice (const nil) (const t) (const lhs)))
(put 'verilog-auto-inst-template-numbers 'safe-local-variable (put 'verilog-auto-inst-template-numbers 'safe-local-variable
'(lambda (x) (memq x '(nil t lhs)))) (lambda (x) (memq x '(nil t lhs))))
(defcustom verilog-auto-inst-template-required nil (defcustom verilog-auto-inst-template-required nil
"If non-nil, when creating a port with AUTOINST, require a template. "If non-nil, when creating a port with AUTOINST, require a template.

View file

@ -850,9 +850,9 @@ Predefined dialects include BibTeX and biblatex."
To interactively change the dialect use the command `bibtex-set-dialect'." To interactively change the dialect use the command `bibtex-set-dialect'."
:group 'bibtex :group 'bibtex
:version "24.1" :version "24.1"
:set '(lambda (symbol value) :set (lambda (symbol value)
(set-default symbol value) (set-default symbol value)
;; `bibtex-set-dialect' is undefined during loading (no problem) ;; `bibtex-set-dialect' is undefined during loading (no problem).
(if (fboundp 'bibtex-set-dialect) (if (fboundp 'bibtex-set-dialect)
(bibtex-set-dialect value))) (bibtex-set-dialect value)))
:type '(choice (const BibTeX) :type '(choice (const BibTeX)

View file

@ -79,10 +79,10 @@
(ert-deftest autoinsert-tests-define-auto-insert-before () (ert-deftest autoinsert-tests-define-auto-insert-before ()
(let ((auto-insert-alist (let ((auto-insert-alist
(list (cons 'text-mode '(lambda () (insert "foo"))))) (list (cons 'text-mode (lambda () (insert "foo")))))
(auto-insert-query nil)) (auto-insert-query nil))
(define-auto-insert 'text-mode (define-auto-insert 'text-mode
'(lambda () (insert "bar"))) (lambda () (insert "bar")))
(with-temp-buffer (with-temp-buffer
(text-mode) (text-mode)
(auto-insert) (auto-insert)
@ -90,10 +90,10 @@
(ert-deftest autoinsert-tests-define-auto-insert-after () (ert-deftest autoinsert-tests-define-auto-insert-after ()
(let ((auto-insert-alist (let ((auto-insert-alist
(list (cons 'text-mode '(lambda () (insert "foo"))))) (list (cons 'text-mode (lambda () (insert "foo")))))
(auto-insert-query nil)) (auto-insert-query nil))
(define-auto-insert 'text-mode (define-auto-insert 'text-mode
'(lambda () (insert "bar")) (lambda () (insert "bar"))
t) t)
(with-temp-buffer (with-temp-buffer
(text-mode) (text-mode)