From 62761d423e5b5e5b004ef1ca907ee66935a6f93f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 28 Dec 2020 07:31:44 +0100 Subject: [PATCH] Remove redundant 'function's around lambda in vhdl-mode.el * lisp/progmodes/vhdl-mode.el (fboundp, vhdl-sort-alist, lambda) (vhdl-create-mode-menu, vhdl-set-offset, vhdl-set-style) (vhdl-regress-line, vhdl-align-inline-comment-region-1) (vhdl-resolve-paths, vhdl-generate-makefile-1) (vhdl-submit-bug-report): Remove redundant 'function's around lambda. --- lisp/progmodes/vhdl-mode.el | 95 +++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 489092f58e6..375ac9eb5ff 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -2286,7 +2286,7 @@ Ignore byte-compiler warnings you might see." (setq contents (nconc (if (and (car dirs) (not full)) - (mapcar (function (lambda (name) (concat (car dirs) name))) + (mapcar (lambda (name) (concat (car dirs) name)) this-dir-contents) this-dir-contents) contents)))) @@ -2563,7 +2563,7 @@ conversion." (defun vhdl-sort-alist (alist) "Sort ALIST." - (sort alist (function (lambda (a b) (string< (car a) (car b)))))) + (sort alist (lambda (a b) (string< (car a) (car b))))) (defun vhdl-get-subdirs (directory) "Recursively get subdirectories of DIRECTORY." @@ -2941,10 +2941,9 @@ STRING are replaced by `-' and substrings are converted to lower case." ;; set up electric character functions to work with ;; `delete-selection-mode' (Emacs) and `pending-delete-mode' (XEmacs) (mapc - (function - (lambda (sym) - (put sym 'delete-selection t) ; for `delete-selection-mode' (Emacs) - (put sym 'pending-delete t))) ; for `pending-delete-mode' (XEmacs) + (lambda (sym) + (put sym 'delete-selection t) ; for `delete-selection-mode' (Emacs) + (put sym 'pending-delete t)) ; for `pending-delete-mode' (XEmacs) '(vhdl-electric-space vhdl-electric-tab vhdl-electric-return @@ -3317,7 +3316,7 @@ STRING are replaced by `-' and substrings are converted to lower case." (setq menu-list (if vhdl-project-sort (sort menu-list - (function (lambda (a b) (string< (elt a 0) (elt b 0))))) + (lambda (a b) (string< (elt a 0) (elt b 0)))) (nreverse menu-list))) (vhdl-menu-split menu-list "Project")) '("--" "--" @@ -5566,9 +5565,8 @@ offset for that syntactic element. Optional ADD-P says to add SYMBOL to (if current-prefix-arg " or add" "") ": ") (mapcar - (function - (lambda (langelem) - (cons (format "%s" (car langelem)) nil))) + (lambda (langelem) + (cons (format "%s" (car langelem)) nil)) vhdl-offsets-alist) nil (not current-prefix-arg) ;; initial contents tries to be the last element @@ -5615,26 +5613,24 @@ argument. The styles are chosen from the `vhdl-style-alist' variable." (error "ERROR: Invalid VHDL indentation style `%s'" style)) ;; set all the variables (mapc - (function - (lambda (varentry) - (let ((var (car varentry)) - (val (cdr varentry))) - ;; special case for vhdl-offsets-alist - (if (not (eq var 'vhdl-offsets-alist)) - (set (if local (make-local-variable var) var) val) - ;; reset vhdl-offsets-alist to the default value first - (set (if local (make-local-variable var) var) - (copy-alist vhdl-offsets-alist-default)) - ;; now set the langelems that are different - (mapcar - (function - (lambda (langentry) - (let ((langelem (car langentry)) - (offset (cdr langentry))) - (vhdl-set-offset langelem offset) - ))) - val)) - ))) + (lambda (varentry) + (let ((var (car varentry)) + (val (cdr varentry))) + ;; special case for vhdl-offsets-alist + (if (not (eq var 'vhdl-offsets-alist)) + (set (if local (make-local-variable var) var) val) + ;; reset vhdl-offsets-alist to the default value first + (set (if local (make-local-variable var) var) + (copy-alist vhdl-offsets-alist-default)) + ;; now set the langelems that are different + (mapcar + (lambda (langentry) + (let ((langelem (car langentry)) + (offset (cdr langentry))) + (vhdl-set-offset langelem offset) + )) + val)) + )) vars)) (vhdl-keep-region-active)) @@ -7578,12 +7574,11 @@ ENDPOS is encountered." (expurgated)) ;; remove the library unit symbols (mapc - (function - (lambda (elt) - (if (memq (car elt) '(entity configuration context package - package-body architecture)) - nil - (setq expurgated (append expurgated (list elt)))))) + (lambda (elt) + (if (memq (car elt) '(entity configuration context package + package-body architecture)) + nil + (setq expurgated (append expurgated (list elt))))) actual) (if (and (not arg) expected (listp expected)) (if (not (equal expected expurgated)) @@ -7950,7 +7945,7 @@ the token in MATCH." (push (cons start length) comment-list)) (beginning-of-line 2)) (setq comment-list - (sort comment-list (function (lambda (a b) (> (car a) (car b)))))) + (sort comment-list (lambda (a b) (> (car a) (car b))))) ;; reduce start positions (setq start-list (list (caar comment-list))) (setq comment-list (cdr comment-list)) @@ -15886,8 +15881,7 @@ NO-POSITION non-nil means do not re-position cursor." (setq path-list-1 (append (mapcar - (function - (lambda (var) (concat path-beg var path-end))) + (lambda (var) (concat path-beg var path-end)) (let ((all-list (vhdl-directory-files (match-string 2 dir) t (concat "\\<" (wildcard-to-regexp @@ -17440,8 +17434,8 @@ specified by a target." (setq tmp-list (cdr tmp-list))) (setq rule-alist ; sort by first rule target (sort rule-alist - (function (lambda (a b) - (string< (car (cadr a)) (car (cadr b))))))) + (lambda (a b) + (string< (car (cadr a)) (car (cadr b)))))) ;; open and clear Makefile (set-buffer (find-file-noselect makefile-path-name t t)) (erase-buffer) @@ -17752,16 +17746,15 @@ specified by a target." 'vhdl-word-completion-in-minibuffer 'vhdl-underscore-is-part-of-word 'vhdl-mode-hook) - (function - (lambda () - (insert - (if vhdl-special-indent-hook - (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" - "vhdl-special-indent-hook is set to '" - (format "%s" vhdl-special-indent-hook) - ".\nPerhaps this is your problem?\n" - "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n") - "\n")))) + (lambda () + (insert + (if vhdl-special-indent-hook + (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" + "vhdl-special-indent-hook is set to '" + (format "%s" vhdl-special-indent-hook) + ".\nPerhaps this is your problem?\n" + "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n") + "\n"))) nil "Hi Reto,")))) -- 2.39.5