summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/bovine
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-03-06 22:33:19 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-03-06 22:33:19 -0500
commit5f74397490ef3d629f717116d39c588d3c2de298 (patch)
tree33943c38fab4f67078d42b2554fbec8efd65d1d3 /lisp/cedet/semantic/bovine
parentb8b05fff1b3d6a515bdaa9dc069c0e29f4d0ef8b (diff)
* 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.
Diffstat (limited to 'lisp/cedet/semantic/bovine')
-rw-r--r--lisp/cedet/semantic/bovine/c.el92
-rw-r--r--lisp/cedet/semantic/bovine/debug.el4
-rw-r--r--lisp/cedet/semantic/bovine/el.el4
-rw-r--r--lisp/cedet/semantic/bovine/gcc.el8
-rw-r--r--lisp/cedet/semantic/bovine/make.el8
-rw-r--r--lisp/cedet/semantic/bovine/scm.el6
6 files changed, 61 insertions, 61 deletions
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<Foo,Bar>'."
(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)