summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/tag-ls.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-03-15 00:08:34 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2021-03-15 00:08:34 -0400
commit371fdd4f1be51b6a2babe21e3655e99401246c4c (patch)
treef4a2dd61b05aa6973e702d6bb9acd8405823bb05 /lisp/cedet/semantic/tag-ls.el
parent2d12df39267b4fca13a9739e6354985e807e1dd9 (diff)
downloademacs-371fdd4f1be51b6a2babe21e3655e99401246c4c.tar.gz
* lisp/cedet: Convert remaining files to lexical-binding
Remove a few more redundant `:group` args. Make use of lexical scoping to replace `(lambda...) with proper closures. * lisp/cedet/ede/custom.el (ede-project-sort-targets-list): Use `dotimes` and replace `(lambda..) with closures. * lisp/cedet/ede/proj-comp.el (proj-comp-insert-variable-once): * lisp/cedet/ede/pmake.el (ede-pmake-insert-variable-once): Remove unused var `addcr`. * lisp/cedet/semantic/complete.el: Use lexical-binding. (semantic-displayer-show-request): Remove unused var `typing-count`. Use `equal` instead of `stringp+string=`. * lisp/cedet/semantic/db-ebrowse.el: Use lexical-binding. (semanticdb-create-ebrowse-database): Remove unused vars `mma` and `regexp`. (semanticdb-ebrowse-strip-trees): Remove unused var `class` and `filename`. (semanticdb-ebrowse-add-globals-to-table): Remove unused var `fname`. * lisp/cedet/semantic/db-find.el: Use lexical-binding. (semanticdb-find-adebug-insert-scanned-tag-cons): Remove always-nil var `tip`. * lisp/cedet/semantic/db-global.el: Use lexical-binding. (semanticdb-enable-gnu-global-databases): Access local var `semantic--ih` by sticking its value in the code passed to `eval` rather than by dynamic scoping. * lisp/cedet/semantic/db-typecache.el: Use lexical-binding. (semanticdb-db-typecache-dump): Remove unused var `junk`. * lisp/cedet/semantic/debug.el: Use lexical-binding. * lisp/cedet/semantic/dep.el: Use lexical-binding. (semantic-add-system-include): Avoid `add-to-list` on a local variable. Access local var `value` by sticking its value in the code passed to `eval` rather than by dynamic scoping. (semantic-remove-system-include): Don't use `delete` on a list received from elsewhere. Access local var `value` by sticking its value in the code passed to `eval` rather than by dynamic scoping. (semantic-reset-system-include): Simplify a bit. * lisp/cedet/semantic/ede-grammar.el: Use lexical-binding. (project-compile-target): Remove unused vars `csrc` and `cb`. Use `cl-incf`. Remove apparently unneeded `with-no-warnings`. * lisp/cedet/semantic/edit.el: Use lexical-binding. (semantic-edits-change-over-tags): Remove unused var `inner-start`. (semantic-edits-incremental-parser-1): Silence warnings about intentionally unused var `last-cond`. * lisp/cedet/semantic/fw.el: Use lexical-binding. (recentf-exclude, semantic-init-hook, ede-auto-add-method) (flymake-start-syntax-check-on-find-file, auto-insert): Declare vars. * lisp/cedet/semantic/ia-sb.el: Use lexical-binding. (semantic-ia-sb-key-map): Move initialization into declaration. (semantic-ia-sb-more-buttons): Remove unused var `idx`. (semantic-ia-sb-line-path): Simplify `if` -> `or`. * lisp/cedet/semantic/idle.el (semantic-idle-breadcrumbs--tag-function): Make it a function returning a closure. * lisp/cedet/semantic/senator.el: Use lexical-binding. (senator-search-set-tag-class-filter): Replace `(lambda..) with a closure. * lisp/cedet/semantic/sort.el: Use lexical-binding. (semanticdb-search-system-databases): Declare var. (semantic-tag-external-member-children-default): Replace `(lambda..) with a closure. * lisp/cedet/semantic/tag-ls.el: Use lexical-binding. (semantic-tag-protection-default, semantic-tag-abstract-p-default): Simplify with `member`. * lisp/cedet/semantic/util.el: Use lexical-binding. (semantic-something-to-tag-table): Declare function `semanticdb-abstract-table--eieio-childp` called via `cl-typep`. * lisp/cedet/semantic/bovine/scm.el (semantic-default-scheme-setup): Remove duplicate setting of `imenu-create-index-function`. * lisp/cedet/semantic/decorate/mode.el (semantic-decoration-build-style-menu): Replace `(lambda..) with a closure. * lisp/cedet/srecode/cpp.el (srecode-semantic-apply-tag-to-dict): Remove always-t variable `member`. * lisp/cedet/srecode/mode.el (srecode-minor-mode-templates-menu): Replace `(lambda..) with a closure. Use `push`. * lisp/cedet/semantic/chart.el: Use lexical-binding. * lisp/cedet/semantic/db-debug.el: Use lexical-binding. * lisp/cedet/semantic/db-el.el: Use lexical-binding. * lisp/cedet/semantic/db-file.el: Use lexical-binding. * lisp/cedet/semantic/db-javascript.el: Use lexical-binding. * lisp/cedet/semantic/db-mode.el: Use lexical-binding. * lisp/cedet/semantic/db-ref.el: Use lexical-binding. * lisp/cedet/semantic/decorate.el: Use lexical-binding. * lisp/cedet/semantic/doc.el: Use lexical-binding. * lisp/cedet/semantic/find.el: Use lexical-binding. * lisp/cedet/semantic/format.el: Use lexical-binding. * lisp/cedet/semantic/html.el: Use lexical-binding. * lisp/cedet/semantic/ia.el: Use lexical-binding. * lisp/cedet/semantic/imenu.el: Use lexical-binding. * lisp/cedet/semantic/java.el: Use lexical-binding. * lisp/cedet/semantic/mru-bookmark.el: Use lexical-binding. * lisp/cedet/semantic/symref.el: Use lexical-binding. * lisp/cedet/semantic/tag-file.el: Use lexical-binding. * lisp/cedet/semantic/tag-write.el: Use lexical-binding. * lisp/cedet/semantic/texi.el: Use lexical-binding. * lisp/cedet/semantic/util-modes.el: Use lexical-binding.
Diffstat (limited to 'lisp/cedet/semantic/tag-ls.el')
-rw-r--r--lisp/cedet/semantic/tag-ls.el23
1 files changed, 10 insertions, 13 deletions
diff --git a/lisp/cedet/semantic/tag-ls.el b/lisp/cedet/semantic/tag-ls.el
index 6cef603af35..3aa1a62901c 100644
--- a/lisp/cedet/semantic/tag-ls.el
+++ b/lisp/cedet/semantic/tag-ls.el
@@ -1,4 +1,4 @@
-;;; semantic/tag-ls.el --- Language Specific override functions for tags
+;;; semantic/tag-ls.el --- Language Specific override functions for tags -*- lexical-binding: t; -*-
;; Copyright (C) 1999-2004, 2006-2021 Free Software Foundation, Inc.
@@ -97,7 +97,7 @@ Modes that override this function can call
`semantic--tag-attribute-similar-p-default' to do the default equality tests if
ATTR is not special for that mode.")
-(defun semantic--tag-attribute-similar-p-default (attr value1 value2 ignorable-attributes)
+(defun semantic--tag-attribute-similar-p-default (_attr value1 value2 ignorable-attributes)
"For ATTR, VALUE1, VALUE2 and IGNORABLE-ATTRIBUTES, test for similarity."
(cond
;; Tag sublists require special testing.
@@ -109,7 +109,7 @@ ATTR is not special for that mode.")
(when (not (eq (length taglist1) (length taglist2)))
(setq ans nil))
(while (and ans taglist1 taglist2)
- (setq ans (apply 'semantic-tag-similar-p
+ (setq ans (apply #'semantic-tag-similar-p
(car taglist1) (car taglist2)
ignorable-attributes)
taglist1 (cdr taglist1)
@@ -205,7 +205,7 @@ stream for a tag of class `package', and return that."
(or stream-or-buffer tag))))
(:override-with-args (tag stream))))
-(defun semantic-tag-full-package-default (tag stream)
+(defun semantic-tag-full-package-default (_tag stream)
"Default method for `semantic-tag-full-package' for TAG.
Return the name of the first tag of class `package' in STREAM."
(let ((pack (car-safe (semantic-find-tags-by-class 'package stream))))
@@ -285,7 +285,7 @@ is to return a symbol based on type modifiers."
(setq parent (semantic-tag-calculate-parent tag)))
(:override))
-(defun semantic-tag-protection-default (tag &optional parent)
+(defun semantic-tag-protection-default (tag &optional _parent)
"Return the protection of TAG as a child of PARENT default action.
See `semantic-tag-protection'."
(let ((mods (semantic-tag-modifiers tag))
@@ -295,9 +295,7 @@ See `semantic-tag-protection'."
(let ((s (car mods)))
(setq prot
;; A few silly defaults to get things started.
- (cond ((or (string= s "public")
- (string= s "extern")
- (string= s "export"))
+ (cond ((member s '("public" "extern" "export"))
'public)
((string= s "private")
'private)
@@ -372,15 +370,14 @@ in how methods are overridden. In UML, abstract methods are italicized.
The default behavior (if not overridden with `tag-abstract-p'
is to return true if `abstract' is in the type modifiers.")
-(defun semantic-tag-abstract-p-default (tag &optional parent)
+(defun semantic-tag-abstract-p-default (tag &optional _parent)
"Return non-nil if TAG is abstract as a child of PARENT default action.
See `semantic-tag-abstract-p'."
(let ((mods (semantic-tag-modifiers tag))
(abs nil))
(while (and (not abs) mods)
(if (stringp (car mods))
- (setq abs (or (string= (car mods) "abstract")
- (string= (car mods) "virtual"))))
+ (setq abs (member (car mods) '("abstract" "virtual"))))
(setq mods (cdr mods)))
abs))
@@ -392,7 +389,7 @@ In UML, leaf methods and classes have special meaning and behavior.
The default behavior (if not overridden with `tag-leaf-p'
is to return true if `leaf' is in the type modifiers.")
-(defun semantic-tag-leaf-p-default (tag &optional parent)
+(defun semantic-tag-leaf-p-default (tag &optional _parent)
"Return non-nil if TAG is leaf as a child of PARENT default action.
See `semantic-tag-leaf-p'."
(let ((mods (semantic-tag-modifiers tag))
@@ -412,7 +409,7 @@ In UML, static methods and attributes mean that they are allocated
in the parent class, and are not instance specific.
UML notation specifies that STATIC entries are underlined.")
-(defun semantic-tag-static-p-default (tag &optional parent)
+(defun semantic-tag-static-p-default (tag &optional _parent)
"Return non-nil if TAG is static as a child of PARENT default action.
See `semantic-tag-static-p'."
(let ((mods (semantic-tag-modifiers tag))