From 8d5dfafab7dc40d4b74dc0b56d1b314fd8cac390 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 22 Feb 2021 11:54:17 -0500 Subject: Prefer `declare` over a `put` of `list-indent-function`. While at it, I enabled lexical-binding in the affected files. * lisp/cedet/semantic/sb.el: Enable lexical-binding. (semantic-sb-with-tag-buffer): Use `declare`. * lisp/cedet/semantic/bovine/el.el: Enable lexical-binding. (semantic-elisp-setup-form-parser): Use `declare`. * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/ert-x.el: Remove redundant `put`. * lisp/emulation/cua-rect.el: Enable lexical-binding. (cua--rectangle-operation, cua--rectangle-aux-replace): Use `declare`. * lisp/mh-e/mh-acros.el: Enable lexical-binding. (mh-do-in-gnu-emacs, mh-do-in-xemacs, mh-funcall-if-exists, defun-mh) (defmacro-mh, with-mh-folder-updating, mh-in-show-buffer) (mh-do-at-event-location, mh-iterate-on-messages-in-region) (mh-iterate-on-range): Use `declare`. * lisp/mh-e/mh-compat.el: Enable lexical-binding. (mh-flet): Use `declare`. * lisp/mh-e/mh-e.el: Enable lexical-binding. (defgroup-mh, defcustom-mh, defface-mh): Use `declare`. * lisp/net/sieve.el: Enable lexical-binding. Remove redundant :group args. (sieve-activate, sieve-remove, sieve-edit-script): Remove unused arg from the interactive spec. (sieve-deactivate-all): Remove unused var `name`. (sieve-change-region): Use `declare`. * lisp/obsolete/fast-lock.el: Enable lexical-binding. Remove redundant :group args. Remove XEmacs compat code. (save-buffer-state): Remove macro. (fast-lock-add-properties): Use `with-silent-modifications` instead. * lisp/obsolete/lazy-lock.el: Enable lexical-binding. Remove redundant :group args. (do-while): Use `declare`. (save-buffer-state): Remove macro. (lazy-lock-fontify-rest-after-change, lazy-lock-defer-line-after-change) (lazy-lock-defer-rest-after-change, lazy-lock-after-fontify-buffer) (lazy-lock-after-unfontify-buffer, lazy-lock-fontify-region): Use `with-silent-modifications` instead. * lisp/obsolete/pgg.el: Enable lexical-binding. Remove XEmacs compat code. (pgg-save-coding-system, pgg-as-lbt, pgg-process-when-success): Use `declare`. (pgg-add-passphrase-to-cache): Remove unused var `new-timer`. (pgg-decrypt-region): Remove unused var `buf`. * lisp/org/org-agenda.el (org-let, org-let2): Move from org-macs and use `declare`. * lisp/org/org-macs.el (org-let, org-let2): Move these functions that are inherently harmful to your karma to the only package that uses them. (org-scroll): Use `pcase` to avoid `eval` and use more readable syntax for those integers standing for events. * lisp/progmodes/antlr-mode.el: Enable lexical-binding. (save-buffer-state-x): Use `declare` and `with-silent-modifications`. * lisp/international/mule-util.el (with-coding-priority): * lisp/cedet/ede/proj-comp.el (proj-comp-insert-variable-once): * lisp/org/org-element.el (org-element-map): * test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load): * test/lisp/emacs-lisp/generator-tests.el (cps-testcase): Use `declare`. --- lisp/cedet/semantic/bovine/el.el | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'lisp/cedet/semantic/bovine/el.el') diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el index dc617349021..4d94d343234 100644 --- a/lisp/cedet/semantic/bovine/el.el +++ b/lisp/cedet/semantic/bovine/el.el @@ -1,4 +1,4 @@ -;;; semantic/bovine/el.el --- Semantic details for Emacs Lisp +;;; semantic/bovine/el.el --- Semantic details for Emacs Lisp -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc. @@ -169,10 +169,10 @@ where: - FORM is an Elisp form read from the current buffer. - START and END are the beginning and end location of the corresponding data in the current buffer." + (declare (indent 1)) (let ((sym (make-symbol "sym"))) `(dolist (,sym ',symbols) (put ,sym 'semantic-elisp-form-parser #',parser)))) -(put 'semantic-elisp-setup-form-parser 'lisp-indent-function 1) (defmacro semantic-elisp-reuse-form-parser (symbol &rest symbols) "Reuse the form parser of SYMBOL for forms identified by SYMBOLS. @@ -210,7 +210,7 @@ Return a bovination list to use." ;;; Form parsers ;; (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (semantic-tag-new-function (symbol-name (nth 2 form)) nil @@ -234,7 +234,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (semantic-tag-new-function (symbol-name (nth 1 form)) nil @@ -256,7 +256,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((doc (semantic-elisp-form-to-doc-string (nth 3 form)))) (semantic-tag-new-variable (symbol-name (nth 1 form)) @@ -274,7 +274,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((doc (semantic-elisp-form-to-doc-string (nth 3 form)))) (semantic-tag-new-variable (symbol-name (nth 1 form)) @@ -290,7 +290,7 @@ Return a bovination list to use." (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((doc (semantic-elisp-form-to-doc-string (nth 3 form)))) (semantic-tag-new-variable (symbol-name (nth 1 form)) @@ -307,7 +307,7 @@ Return a bovination list to use." (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((doc (semantic-elisp-form-to-doc-string (nth 3 form)))) (semantic-tag (symbol-name (nth 1 form)) @@ -321,7 +321,7 @@ Return a bovination list to use." (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (semantic-tag-new-function (symbol-name (cadr (cadr form))) nil nil @@ -333,7 +333,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let* ((a2 (nth 2 form)) (a3 (nth 3 form)) (args (if (listp a2) a2 a3)) @@ -353,7 +353,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (semantic-tag-new-function (symbol-name (nth 1 form)) nil @@ -363,7 +363,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((docpart (nthcdr 4 form))) (semantic-tag-new-type (symbol-name (nth 1 form)) @@ -381,7 +381,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((slots (nthcdr 2 form))) ;; Skip doc string if present. (and (stringp (car slots)) @@ -399,7 +399,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (semantic-tag-new-function (symbol-name (nth 1 form)) nil nil @@ -410,7 +410,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((args (nth 3 form))) (semantic-tag-new-function (symbol-name (nth 1 form)) @@ -424,7 +424,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (semantic-tag-new-variable (symbol-name (nth 2 form)) nil @@ -437,7 +437,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((name (nth 1 form))) (semantic-tag-new-include (symbol-name (if (eq (car-safe name) 'quote) @@ -449,7 +449,7 @@ Return a bovination list to use." ) (semantic-elisp-setup-form-parser - (lambda (form start end) + (lambda (form _start _end) (let ((name (nth 1 form))) (semantic-tag-new-package (symbol-name (if (eq (car-safe name) 'quote) @@ -500,7 +500,7 @@ into Emacs Lisp's memory." "")))) (define-mode-local-override semantic-documentation-for-tag - emacs-lisp-mode (tag &optional nosnarf) + emacs-lisp-mode (tag &optional _nosnarf) "Return the documentation string for TAG. Optional argument NOSNARF is ignored." (let ((d (semantic-tag-docstring tag))) @@ -577,7 +577,7 @@ Override function for `semantic-tag-protection'." ((string= prot "protected") 'protected)))) (define-mode-local-override semantic-tag-static-p - emacs-lisp-mode (tag &optional parent) + emacs-lisp-mode (tag &optional _parent) "Return non-nil if TAG is static in PARENT class. Overrides `semantic-nonterminal-static'." ;; This can only be true (theoretically) in a class where it is assigned. @@ -588,7 +588,7 @@ Overrides `semantic-nonterminal-static'." ;; Emacs lisp is very different from C,C++ which most context parsing ;; functions are written. Support them here. (define-mode-local-override semantic-up-context emacs-lisp-mode - (&optional point bounds-type) + (&optional _point _bounds-type) "Move up one context in an Emacs Lisp function. A Context in many languages is a block with its own local variables. In Emacs, we will move up lists and stop when one starts with one of @@ -652,7 +652,7 @@ define-mode-overload\\)\ (define-mode-local-override semantic-get-local-variables emacs-lisp-mode - (&optional point) + (&optional _point) "Return a list of local variables for POINT. Scan backwards from point at each successive function. For all occurrences of `let' or `let*', grab those variable names." -- cgit v1.2.3 From 5f74397490ef3d629f717116d39c588d3c2de298 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 6 Mar 2021 22:33:19 -0500 Subject: * lisp/cedet/semantic/bovine/*.el: Use lexical-binding * lisp/cedet/semantic/bovine/c.el: Use lexical-binding. (semantic-lex-cpp-define): Remove unused var `name`. (semantic-c-do-lex-if): Remove unused var `pt`. (semantic-analyze-tag-references): Remove unused var `refs`. (semantic-c-dereference-namespace): Remove unused vars `tmp` and `usingname`. (semantic-c-dereference-namespace-alias): Remove unused var `newtype`. (semantic-c-check-type-namespace-using): Remove unused vars `tmp` and `shortname`. (semanticdb-find-table-for-include): Remove unused var `prefix`. (semantic-default-c-setup, semantic-c-describe-environment): Use `derived-mode-p`. * lisp/cedet/semantic/bovine/debug.el: Use lexical-binding. * lisp/cedet/semantic/bovine/make.el: Use lexical-binding. * lisp/cedet/semantic/bovine/scm.el: Use lexical-binding. * lisp/cedet/semantic/lex.el (define-lex-analyzer): Define the var (and the function) in a single step. --- lisp/cedet/semantic/bovine/c.el | 92 ++++++++++++++++++------------------- lisp/cedet/semantic/bovine/debug.el | 4 +- lisp/cedet/semantic/bovine/el.el | 4 +- lisp/cedet/semantic/bovine/gcc.el | 8 ++-- lisp/cedet/semantic/bovine/make.el | 8 ++-- lisp/cedet/semantic/bovine/scm.el | 6 +-- lisp/cedet/semantic/lex.el | 27 +++++------ 7 files changed, 72 insertions(+), 77 deletions(-) (limited to 'lisp/cedet/semantic/bovine/el.el') diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index fb551397381..7be55ea9e10 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -1,4 +1,4 @@ -;;; semantic/bovine/c.el --- Semantic details for C +;;; semantic/bovine/c.el --- Semantic details for C -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. @@ -114,7 +114,8 @@ part of the preprocessor map.") "Reset the C preprocessor symbol map based on all input variables." (when (and semantic-mode (featurep 'semantic/bovine/c)) - (remove-hook 'mode-local-init-hook 'semantic-c-reset-preprocessor-symbol-map) + (remove-hook 'mode-local-init-hook + #'semantic-c-reset-preprocessor-symbol-map) ;; Initialize semantic-lex-spp-macro-symbol-obarray with symbols. (setq-mode-local c-mode semantic-lex-spp-macro-symbol-obarray @@ -154,7 +155,7 @@ part of the preprocessor map.") ;; Make sure the preprocessor symbols are set up when mode-local kicks ;; in. -(add-hook 'mode-local-init-hook 'semantic-c-reset-preprocessor-symbol-map) +(add-hook 'mode-local-init-hook #'semantic-c-reset-preprocessor-symbol-map) (defcustom semantic-lex-c-preprocessor-symbol-map nil "Table of C Preprocessor keywords used by the Semantic C lexer. @@ -237,8 +238,8 @@ Return the defined symbol as a special spp lex token." (skip-chars-forward " \t") (if (eolp) nil - (let* ((name (buffer-substring-no-properties - (match-beginning 1) (match-end 1))) + (let* (;; (name (buffer-substring-no-properties + ;; (match-beginning 1) (match-end 1))) (beginning-of-define (match-end 1)) (with-args (save-excursion (goto-char (match-end 0)) @@ -488,7 +489,7 @@ code to parse." (error nil)))) (let ((eval-form (condition-case err - (eval parsedtokelist) + (eval parsedtokelist t) (error (semantic-push-parser-warning (format "Hideif forms produced an error. Assuming false.\n%S" err) @@ -499,11 +500,11 @@ code to parse." (equal eval-form 0)));; ifdef line resulted in false ;; The if indicates to skip this preprocessor section - (let ((pt nil)) + (let () ;; (pt nil) (semantic-push-parser-warning (format "Skip %s" (buffer-substring-no-properties (point-at-bol) (point-at-eol))) (point-at-bol) (point-at-eol)) (beginning-of-line) - (setq pt (point)) + ;; (setq pt (point)) ;; This skips only a section of a conditional. Once that section ;; is opened, encountering any new #else or related conditional ;; should be skipped. @@ -926,7 +927,7 @@ the regular parser." (semantic-lex-init) (semantic-clear-toplevel-cache) (remove-hook 'semantic-lex-reset-functions - 'semantic-lex-spp-reset-hook t) + #'semantic-lex-spp-reset-hook t) ) ;; Get the macro symbol table right. (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms) @@ -970,7 +971,7 @@ the regular parser." ;; Notify about the debug (setq semantic-c-debug-mode-init-last-mode mm) - (add-hook 'post-command-hook 'semantic-c-debug-mode-init-pch))) + (add-hook 'post-command-hook #'semantic-c-debug-mode-init-pch))) (defun semantic-c-debug-mode-init-pch () "Notify user about needing to debug their major mode hooks." @@ -987,7 +988,7 @@ M-x semantic-c-debug-mode-init now. ") - (remove-hook 'post-command-hook 'semantic-c-debug-mode-init-pch))) + (remove-hook 'post-command-hook #'semantic-c-debug-mode-init-pch))) (defun semantic-expand-c-tag (tag) "Expand TAG into a list of equivalent tags, or nil." @@ -1228,7 +1229,7 @@ Use `semantic-analyze-current-tag' to debug this fcn." (when (not (semantic-tag-p tag)) (signal 'wrong-type-argument (list 'semantic-tag-p tag))) (let ((allhits nil) (scope nil) - (refs nil)) + ) ;; (refs nil) (save-excursion (semantic-go-to-tag tag db) (setq scope (semantic-calculate-scope)) @@ -1250,11 +1251,12 @@ Use `semantic-analyze-current-tag' to debug this fcn." (reverse newparents))) (setq allhits (semantic--analyze-refs-full-lookup tag scope t))) - (setq refs (semantic-analyze-references (semantic-tag-name tag) - :tag tag - :tagdb db - :scope scope - :rawsearchdata allhits))))) + ;; (setq refs + (semantic-analyze-references (semantic-tag-name tag) + :tag tag + :tagdb db + :scope scope + :rawsearchdata allhits)))) ;;) (defun semantic-c-reconstitute-token (tokenpart declmods typedecl) "Reconstitute a token TOKENPART with DECLMODS and TYPEDECL. @@ -1540,9 +1542,9 @@ This might be a string, or a list of tokens." ((semantic-tag-p templatespec) (semantic-format-tag-abbreviate templatespec)) ((listp templatespec) - (mapconcat 'semantic-format-tag-abbreviate templatespec ", ")))) + (mapconcat #'semantic-format-tag-abbreviate templatespec ", ")))) -(defun semantic-c-template-string (token &optional parent color) +(defun semantic-c-template-string (token &optional parent _color) "Return a string representing the TEMPLATE attribute of TOKEN. This string is prefixed with a space, or is the empty string. Argument PARENT specifies a parent type. @@ -1550,8 +1552,8 @@ Argument COLOR specifies that the string should be colorized." (let ((t2 (semantic-c-tag-template-specifier token)) (t1 (semantic-c-tag-template token)) ;; @todo - Need to account for a parent that is a template - (pt1 (if parent (semantic-c-tag-template parent))) - (pt2 (if parent (semantic-c-tag-template-specifier parent))) + (_pt1 (if parent (semantic-c-tag-template parent))) + (_pt2 (if parent (semantic-c-tag-template-specifier parent))) ) (cond (t2 ;; we have a template with specifier (concat " <" @@ -1610,7 +1612,7 @@ handled. A class is abstract only if its destructor is virtual." (member "virtual" (semantic-tag-modifiers tag)))) (t (semantic-tag-abstract-p-default tag parent)))) -(defun semantic-c-dereference-typedef (type scope &optional type-declaration) +(defun semantic-c-dereference-typedef (type _scope &optional type-declaration) "If TYPE is a typedef, get TYPE's type by name or tag, and return. SCOPE is not used, and TYPE-DECLARATION is used only if TYPE is not a typedef." (if (and (eq (semantic-tag-class type) 'type) @@ -1655,7 +1657,7 @@ return `ref'." (concat (semantic-tag-name type) "<" (semantic-c--template-name-1 (cdr spec-list)) ">")) -(defun semantic-c-dereference-template (type scope &optional type-declaration) +(defun semantic-c-dereference-template (type _scope &optional type-declaration) "Dereference any template specifiers in TYPE within SCOPE. If TYPE is a template, return a TYPE copy with the templates types instantiated as specified in TYPE-DECLARATION." @@ -1677,7 +1679,7 @@ instantiated as specified in TYPE-DECLARATION." (list type type-declaration)) ;;; Patch here by "Raf" for instantiating templates. -(defun semantic-c-dereference-member-of (type scope &optional type-declaration) +(defun semantic-c-dereference-member-of (type _scope &optional type-declaration) "Dereference through the `->' operator of TYPE. Uses the return type of the `->' operator if it is contained in TYPE. SCOPE is the current local scope to perform searches in. @@ -1700,7 +1702,7 @@ Such an alias can be created through `using' statements in a namespace declaration. This function checks the namespaces in SCOPE for such statements." (let ((scopetypes (oref scope scopetypes)) - typename currentns tmp usingname result namespaces) + typename currentns result namespaces) ;; usingname tmp (when (and (semantic-tag-p type-declaration) (or (null type) (semantic-tag-prototype-p type))) (setq typename (semantic-analyze-split-name (semantic-tag-name type-declaration))) @@ -1739,11 +1741,11 @@ with a fully qualified name in the original namespace. Returns nil if NAMESPACE is not an alias." (when (eq (semantic-tag-get-attribute namespace :kind) 'alias) (let ((typename (semantic-analyze-split-name (semantic-tag-name type))) - ns nstype originaltype newtype) + ns nstype originaltype) ;; newtype ;; Make typename unqualified - (if (listp typename) - (setq typename (last typename)) - (setq typename (list typename))) + (setq typename (if (listp typename) + (last typename) + (list typename))) (when (and ;; Get original namespace and make sure TYPE exists there. @@ -1755,13 +1757,13 @@ nil if NAMESPACE is not an alias." (semantic-tag-get-attribute nstype :members)))) ;; Construct new type with name in original namespace. (setq ns (semantic-analyze-split-name ns)) - (setq newtype - (semantic-tag-clone - (car originaltype) - (semantic-analyze-unsplit-name - (if (listp ns) - (append ns typename) - (append (list ns) typename))))))))) + ;; (setq newtype + (semantic-tag-clone + (car originaltype) + (semantic-analyze-unsplit-name + (if (listp ns) + (append ns typename) + (append (list ns) typename)))))))) ;; ) ;; This searches a type in a namespace, following through all using ;; statements. @@ -1769,7 +1771,7 @@ nil if NAMESPACE is not an alias." "Check if TYPE is accessible in NAMESPACE through a using statement. Returns the original type from the namespace where it is defined, or nil if it cannot be found." - (let (usings result usingname usingtype unqualifiedname members shortname tmp) + (let (usings result usingname usingtype unqualifiedname members) ;; shortname tmp ;; Get all using statements from NAMESPACE. (when (and (setq usings (semantic-tag-get-attribute namespace :members)) (setq usings (semantic-find-tags-by-class 'using usings))) @@ -1842,7 +1844,7 @@ These are constants which are of type TYPE." (define-mode-local-override semantic-analyze-unsplit-name c-mode (namelist) "Assemble the list of names NAMELIST into a namespace name." - (mapconcat 'identity namelist "::")) + (mapconcat #'identity namelist "::")) (define-mode-local-override semantic-ctxt-scoped-types c++-mode (&optional point) "Return a list of tags of CLASS type based on POINT. @@ -1885,7 +1887,7 @@ DO NOT return the list of tags encompassing point." (semantic-get-local-variables)))) (setq tagreturn (append tagreturn - (mapcar 'semantic-tag-type tmp)))))) + (mapcar #'semantic-tag-type tmp)))))) ;; Return the stuff tagreturn)) @@ -1943,7 +1945,7 @@ namespace, since this means all tags inside this include will have to be wrapped in that namespace." (let ((inctable (semanticdb-find-table-for-include-default includetag table)) (inside-ns (semantic-tag-get-attribute includetag :inside-ns)) - tags newtags namespaces prefix parenttable newtable) + tags newtags namespaces parenttable newtable) ;; prefix (if (or (null inside-ns) (not inctable) (not (slot-boundp inctable 'tags))) @@ -2111,13 +2113,11 @@ actually in their parent which is not accessible.") "Set up a buffer for semantic parsing of the C language." (semantic-c-by--install-parser) (setq semantic-lex-syntax-modifications '((?> ".") - (?< ".") - ) - ) + (?< "."))) (setq semantic-lex-analyzer #'semantic-c-lexer) - (add-hook 'semantic-lex-reset-functions 'semantic-lex-spp-reset-hook nil t) - (when (eq major-mode 'c++-mode) + (add-hook 'semantic-lex-reset-functions #'semantic-lex-spp-reset-hook nil t) + (when (derived-mode-p 'c++-mode) (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__cplusplus" . ""))) ) @@ -2142,7 +2142,7 @@ actually in their parent which is not accessible.") (defun semantic-c-describe-environment () "Describe the Semantic features of the current C environment." (interactive) - (if (not (member 'c-mode (mode-local-equivalent-mode-p major-mode))) + (if (not (derived-mode-p 'c-mode)) (error "Not useful to query C mode in %s mode" major-mode)) (let ((gcc (when (boundp 'semantic-gcc-setup-data) semantic-gcc-setup-data)) diff --git a/lisp/cedet/semantic/bovine/debug.el b/lisp/cedet/semantic/bovine/debug.el index 8ea9ac24423..47850a5d1f4 100644 --- a/lisp/cedet/semantic/bovine/debug.el +++ b/lisp/cedet/semantic/bovine/debug.el @@ -1,4 +1,4 @@ -;;; semantic/bovine/debug.el --- Debugger support for bovinator +;;; semantic/bovine/debug.el --- Debugger support for bovinator -*- lexical-binding: t; -*- ;; Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc. @@ -123,7 +123,7 @@ Argument CONDITION is the thrown error condition." frame) frame)) -(cl-defmethod semantic-debug-frame-highlight ((frame semantic-bovine-debug-error-frame)) +(cl-defmethod semantic-debug-frame-highlight ((_frame semantic-bovine-debug-error-frame)) "Highlight a frame from an action." ;; How do I get the location of the action in the source buffer? ) diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el index 4d94d343234..1170e716878 100644 --- a/lisp/cedet/semantic/bovine/el.el +++ b/lisp/cedet/semantic/bovine/el.el @@ -940,7 +940,7 @@ ELisp variables can be pretty long, so track this one too.") ;; loaded into Emacs. ) -(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup) +(add-hook 'emacs-lisp-mode-hook #'semantic-default-elisp-setup) ;;; LISP MODE ;; @@ -950,7 +950,7 @@ ELisp variables can be pretty long, so track this one too.") ;; See this syntax: ;; (defun foo () /#A) ;; -(add-hook 'lisp-mode-hook 'semantic-default-elisp-setup) +(add-hook 'lisp-mode-hook #'semantic-default-elisp-setup) (eval-after-load "semantic/db" '(require 'semantic/db-el) diff --git a/lisp/cedet/semantic/bovine/gcc.el b/lisp/cedet/semantic/bovine/gcc.el index c2121e5d587..02bd0defef5 100644 --- a/lisp/cedet/semantic/bovine/gcc.el +++ b/lisp/cedet/semantic/bovine/gcc.el @@ -47,11 +47,11 @@ to give to the program." (erase-buffer) (setenv "LC_ALL" "C") (condition-case nil - (setq err (apply 'call-process gcc-cmd options)) + (setq err (apply #'call-process gcc-cmd options)) (error ;; Some bogus directory for the first time perhaps? (let ((default-directory (expand-file-name "~/"))) (condition-case nil - (setq err (apply 'call-process gcc-cmd options)) + (setq err (apply #'call-process gcc-cmd options)) (error ;; gcc doesn't exist??? nil))))) (setenv "LC_ALL" old-lc-messages) @@ -151,12 +151,12 @@ It should also include other symbols GCC was compiled with.") (let* ((fields (or semantic-gcc-setup-data (semantic-gcc-fields (semantic-gcc-query "gcc" "-v")))) (cpp-options `("-E" "-dM" "-x" "c++" ,null-device)) - (query (let ((q (apply 'semantic-gcc-query "cpp" cpp-options))) + (query (let ((q (apply #'semantic-gcc-query "cpp" cpp-options))) (if (stringp q) q ;; `cpp' command in `semantic-gcc-setup' doesn't work on ;; Mac, try `gcc'. - (apply 'semantic-gcc-query "gcc" cpp-options)))) + (apply #'semantic-gcc-query "gcc" cpp-options)))) (defines (if (stringp query) (semantic-cpp-defs query) (message (concat "Could not query gcc for defines. " diff --git a/lisp/cedet/semantic/bovine/make.el b/lisp/cedet/semantic/bovine/make.el index 80895565274..2c9b78f9dd1 100644 --- a/lisp/cedet/semantic/bovine/make.el +++ b/lisp/cedet/semantic/bovine/make.el @@ -1,4 +1,4 @@ -;;; semantic/bovine/make.el --- Makefile parsing rules. +;;; semantic/bovine/make.el --- Makefile parsing rules. -*- lexical-binding: t; -*- ;; Copyright (C) 2000-2004, 2008-2021 Free Software Foundation, Inc. @@ -103,13 +103,13 @@ Ignore them." xpand)) (define-mode-local-override semantic-get-local-variables - makefile-mode (&optional point) + makefile-mode (&optional _point) "Override `semantic-get-local-variables' so it does not throw an error. We never have local variables in Makefiles." nil) (define-mode-local-override semantic-ctxt-current-class-list - makefile-mode (&optional point) + makefile-mode (&optional _point) "List of classes that are valid to place at point." (let ((tag (semantic-current-tag))) (when tag @@ -176,7 +176,7 @@ This is the same as a regular prototype." (semantic-format-tag-prototype tag parent color)) (define-mode-local-override semantic-analyze-possible-completions - makefile-mode (context &rest flags) + makefile-mode (context &rest _flags) "Return a list of possible completions in a Makefile. Uses default implementation, and also gets a list of filenames." (require 'semantic/analyze/complete) diff --git a/lisp/cedet/semantic/bovine/scm.el b/lisp/cedet/semantic/bovine/scm.el index aaa86a1e36c..939348ef4a5 100644 --- a/lisp/cedet/semantic/bovine/scm.el +++ b/lisp/cedet/semantic/bovine/scm.el @@ -1,4 +1,4 @@ -;;; semantic/bovine/scm.el --- Semantic details for Scheme (guile) +;;; semantic/bovine/scm.el --- Semantic details for Scheme (guile) -*- lexical-binding: t; -*- ;;; Copyright (C) 2001-2004, 2008-2021 Free Software Foundation, Inc. @@ -49,7 +49,7 @@ actually on the local machine.") ")") (semantic-format-tag-prototype-default tag parent color)))) -(define-mode-local-override semantic-documentation-for-tag scheme-mode (tag &optional nosnarf) +(define-mode-local-override semantic-documentation-for-tag scheme-mode (tag &optional _nosnarf) "Return the documentation string for TAG. Optional argument NOSNARF is ignored." (let ((d (semantic-tag-docstring tag))) @@ -57,7 +57,7 @@ Optional argument NOSNARF is ignored." (substring d 1) d))) -(define-mode-local-override semantic-insert-foreign-tag scheme-mode (tag tagfile) +(define-mode-local-override semantic-insert-foreign-tag scheme-mode (tag _tagfile) "Insert TAG from TAGFILE at point. Attempts a simple prototype for calling or using TAG." (cond ((eq (semantic-tag-class tag) 'function) diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index b3399aa2e62..29d8e29ae67 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el @@ -1098,26 +1098,21 @@ at the beginning of `semantic-lex-token-stream'. This can be done by using `semantic-lex-push-token'." (declare (debug (&define name stringp form def-body))) `(eval-and-compile - (defvar ,name nil ,doc) - (defun ,name nil) - ;; Do this part separately so that re-evaluation rebuilds this code. - (setq ,name '(,condition ,@forms)) + ;; This is the real info used by `define-lex' (via semantic-lex-one-token). + (defconst ,name '(,condition ,@forms) ,doc) ;; Build a single lexical analyzer function, so the doc for ;; function help is automatically provided, and perhaps the ;; function could be useful for testing and debugging one ;; analyzer. - (fset ',name (lambda () ,doc - (let ((semantic-lex-token-stream nil) - (semantic-lex-end-point (point)) - (semantic-lex-analysis-bounds - (cons (point) (point-max))) - (semantic-lex-current-depth 0) - (semantic-lex-maximum-depth - semantic-lex-depth) - ) - (when ,condition ,@forms) - semantic-lex-token-stream))) - )) + (defun ,name () + ,doc + (let ((semantic-lex-token-stream nil) + (semantic-lex-end-point (point)) + (semantic-lex-analysis-bounds (cons (point) (point-max))) + (semantic-lex-current-depth 0) + (semantic-lex-maximum-depth semantic-lex-depth)) + (when ,condition ,@forms) + semantic-lex-token-stream)))) (defmacro define-lex-regex-analyzer (name doc regexp &rest forms) "Create a lexical analyzer with NAME and DOC that will match REGEXP. -- cgit v1.2.3 From fb9f5501d838f8b912ea33f9c34fdf6020c41f35 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 16 Apr 2021 14:35:25 +0200 Subject: ; Fix typos: emacs lisp -> Emacs Lisp --- lisp/cedet/semantic/bovine/el.el | 2 +- lisp/cedet/semantic/db-ebrowse.el | 2 +- lisp/emacs-lisp/cconv.el | 2 +- lisp/emacs-lisp/cl-indent.el | 2 +- lisp/emulation/edt-mapper.el | 2 +- lisp/ls-lisp.el | 2 +- lisp/mh-e/mh-show.el | 2 +- lisp/obsolete/tpu-mapper.el | 2 +- lisp/progmodes/cc-guess.el | 4 ++-- lisp/textmodes/artist.el | 2 +- lisp/textmodes/table.el | 2 +- lisp/textmodes/texinfmt.el | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) (limited to 'lisp/cedet/semantic/bovine/el.el') diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el index 1170e716878..ebb20448ed5 100644 --- a/lisp/cedet/semantic/bovine/el.el +++ b/lisp/cedet/semantic/bovine/el.el @@ -585,7 +585,7 @@ Overrides `semantic-nonterminal-static'." ;;; Context parsing ;; -;; Emacs lisp is very different from C,C++ which most context parsing +;; Emacs Lisp is very different from C,C++ which most context parsing ;; functions are written. Support them here. (define-mode-local-override semantic-up-context emacs-lisp-mode (&optional _point _bounds-type) diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el index efdf3dfa47a..682a4ccac48 100644 --- a/lisp/cedet/semantic/db-ebrowse.el +++ b/lisp/cedet/semantic/db-ebrowse.el @@ -222,7 +222,7 @@ warn instead." ;JAVE this just instantiates a default empty ebrowse struct? ; how would new instances wind up here? -; the ebrowse class isn't singleton, unlike the emacs lisp one +; the ebrowse class isn't singleton, unlike the Emacs Lisp one (defvar-mode-local c++-mode semanticdb-project-system-databases () "Search Ebrowse for symbols.") diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index b37cfebab31..f6637109028 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -1,4 +1,4 @@ -;;; cconv.el --- Closure conversion for statically scoped Emacs lisp. -*- lexical-binding: t -*- +;;; cconv.el --- Closure conversion for statically scoped Emacs Lisp. -*- lexical-binding: t -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 7d0bfc88b15..c88e15d5a8b 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -27,7 +27,7 @@ ;; This package supplies a single entry point, common-lisp-indent-function, ;; which performs indentation in the preferred style for Common Lisp code. -;; It is also a suitable function for indenting Emacs lisp code. +;; It is also a suitable function for indenting Emacs Lisp code. ;; ;; To enable it: ;; diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 0b152784252..a723dbdbb90 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -26,7 +26,7 @@ ;; [Part of the GNU Emacs EDT Emulation.] -;; This emacs lisp program can be used to create an emacs lisp file +;; This Emacs Lisp program can be used to create an Emacs Lisp file ;; that defines the mapping of the user's keyboard to the LK-201 ;; keyboard function keys and keypad keys (around which EDT has been ;; designed). Please read the "Usage" AND "Known Problems" sections diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 3721e86475c..24d49ea6d80 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -28,7 +28,7 @@ ;; OVERVIEW ========================================================== ;; This file advises the function `insert-directory' to implement it -;; directly from Emacs lisp, without running ls in a subprocess. +;; directly from Emacs Lisp, without running ls in a subprocess. ;; This is useful if you don't have ls installed (ie, on MS Windows). ;; This function can use regexps instead of shell wildcards. If you diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 6134e8350c8..aa97f5cb383 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -185,7 +185,7 @@ Sets the current buffer to the show buffer." (set-buffer folder) ;; When Gnus uses external displayers it has to keep handles longer. So ;; we will delete these handles when mh-quit is called on the folder. It - ;; would be nicer if there are weak pointers in emacs lisp, then we could + ;; would be nicer if there are weak pointers in Emacs Lisp, then we could ;; get the garbage collector to do this for us. (unless (mh-buffer-data) (setf (mh-buffer-data) (mh-make-buffer-data))) diff --git a/lisp/obsolete/tpu-mapper.el b/lisp/obsolete/tpu-mapper.el index d23068ac469..5ae0a6558d5 100644 --- a/lisp/obsolete/tpu-mapper.el +++ b/lisp/obsolete/tpu-mapper.el @@ -69,7 +69,7 @@ ;;;###autoload (defun tpu-mapper () - "Create an Emacs lisp file defining the TPU-edt keypad for X-windows. + "Create an Emacs Lisp file defining the TPU-edt keypad for X-windows. This command displays an instruction screen showing the TPU-edt keypad and asks you to press the TPU-edt editing keys. It uses the keys you diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el index 0824af66b43..9c88c14a6c1 100644 --- a/lisp/progmodes/cc-guess.el +++ b/lisp/progmodes/cc-guess.el @@ -58,7 +58,7 @@ ;; ;; If you want to reuse the guessed style in future emacs sessions, ;; you may want to put it to your .emacs. `c-guess-view' is for -;; you. It emits emacs lisp code which defines the last guessed +;; you. It emits Emacs Lisp code which defines the last guessed ;; style, in a temporary buffer. You can put the emitted code into ;; your .emacs. This command was suggested by Alan Mackenzie. @@ -527,7 +527,7 @@ is called with one argument, the guessed style." (cdr needs-markers))))) (defun c-guess-view (&optional with-name) - "Emit emacs lisp code which defines the last guessed style. + "Emit Emacs Lisp code which defines the last guessed style. So you can put the code into .emacs if you prefer the guessed code. \"STYLE NAME HERE\" is used as the name for the style in the diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index fbb9d2174fd..d9a83c566b4 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -33,7 +33,7 @@ ;; What is artist? ;; --------------- ;; -;; Artist is an Emacs lisp package that allows you to draw lines, +;; Artist is an Emacs Lisp package that allows you to draw lines, ;; rectangles and ellipses by using your mouse and/or keyboard. The ;; shapes are made up with the ascii characters |, -, / and \. ;; diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 13b4a6d05b0..2dd52b87b79 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -383,7 +383,7 @@ ;; There is no artificial-intelligence magic in this package. The ;; definition of a table and the cells inside the table is reasonably ;; limited in order to achieve acceptable performance in the -;; interactive operation under Emacs lisp implementation. A valid +;; interactive operation under Emacs Lisp implementation. A valid ;; table is a rectangular text area completely filled with valid ;; cells. A valid cell is a rectangle text area, which four borders ;; consist of valid border characters. Cells can not be nested one to diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 5ce39da7968..977f3bab6ce 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -23,7 +23,7 @@ ;;; Commentary: -;;; Emacs lisp functions to convert Texinfo files to Info files. +;;; Emacs Lisp functions to convert Texinfo files to Info files. ;;; Code: -- cgit v1.2.3