aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2016-05-12 15:50:24 -0400
committerStefan Monnier2016-05-12 15:50:24 -0400
commitec7a173e03729450bb9117e98d7e696c15994a84 (patch)
treedaaf696fc0f310ec13406a7129d6914b452d6056
parent28e8e49e08c19dd8f23aca4293d9cccc9477f2bf (diff)
downloademacs-ec7a173e03729450bb9117e98d7e696c15994a84.tar.gz
emacs-ec7a173e03729450bb9117e98d7e696c15994a84.zip
* lisp/cedet/semantic/{db-el,symref}.el: Mark unused vars
* lisp/cedet/semantic/db-el.el: Use _ to mark unused vars. (object-print): Use cl-call-next-method instead of call-next-method. * lisp/cedet/semantic/symref.el: Use _ to mark unused vars.
-rw-r--r--lisp/cedet/semantic/db-el.el41
-rw-r--r--lisp/cedet/semantic/symref.el7
2 files changed, 23 insertions, 25 deletions
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el
index e7858ce36b5..413996a5e8f 100644
--- a/lisp/cedet/semantic/db-el.el
+++ b/lisp/cedet/semantic/db-el.el
@@ -44,19 +44,19 @@
44 ) 44 )
45 "A table for returning search results from Emacs.") 45 "A table for returning search results from Emacs.")
46 46
47(cl-defmethod semanticdb-refresh-table ((obj semanticdb-table-emacs-lisp) &optional force) 47(cl-defmethod semanticdb-refresh-table ((_obj semanticdb-table-emacs-lisp) &optional _force)
48 "Do not refresh Emacs Lisp table. 48 "Do not refresh Emacs Lisp table.
49It does not need refreshing." 49It does not need refreshing."
50 nil) 50 nil)
51 51
52(cl-defmethod semanticdb-needs-refresh-p ((obj semanticdb-table-emacs-lisp)) 52(cl-defmethod semanticdb-needs-refresh-p ((_obj semanticdb-table-emacs-lisp))
53 "Return nil, we never need a refresh." 53 "Return nil, we never need a refresh."
54 nil) 54 nil)
55 55
56(cl-defmethod object-print ((obj semanticdb-table-emacs-lisp) &rest strings) 56(cl-defmethod object-print ((obj semanticdb-table-emacs-lisp) &rest strings)
57 "Pretty printer extension for `semanticdb-table-emacs-lisp'. 57 "Pretty printer extension for `semanticdb-table-emacs-lisp'.
58Adds the number of tags in this file to the object print name." 58Adds the number of tags in this file to the object print name."
59 (apply 'call-next-method obj (cons " (proxy)" strings))) 59 (apply #'cl-call-next-method obj (cons " (proxy)" strings)))
60 60
61(defclass semanticdb-project-database-emacs-lisp 61(defclass semanticdb-project-database-emacs-lisp
62 (semanticdb-project-database eieio-singleton) 62 (semanticdb-project-database eieio-singleton)
@@ -71,10 +71,10 @@ Adds the number of tags in this file to the object print name."
71 "Pretty printer extension for `semanticdb-table-emacs-lisp'. 71 "Pretty printer extension for `semanticdb-table-emacs-lisp'.
72Adds the number of tags in this file to the object print name." 72Adds the number of tags in this file to the object print name."
73 (let ((count 0)) 73 (let ((count 0))
74 (mapatoms (lambda (sym) (setq count (1+ count)))) 74 (mapatoms (lambda (_sym) (setq count (1+ count))))
75 (apply 'call-next-method obj (cons 75 (apply #'cl-call-next-method obj (cons
76 (format " (%d known syms)" count) 76 (format " (%d known syms)" count)
77 strings)))) 77 strings))))
78 78
79;; Create the database, and add it to searchable databases for Emacs Lisp mode. 79;; Create the database, and add it to searchable databases for Emacs Lisp mode.
80(defvar-mode-local emacs-lisp-mode semanticdb-project-system-databases 80(defvar-mode-local emacs-lisp-mode semanticdb-project-system-databases
@@ -103,25 +103,25 @@ Create one of our special tables that can act as an intermediary."
103 )) 103 ))
104 (cl-call-next-method)) 104 (cl-call-next-method))
105 105
106(cl-defmethod semanticdb-file-table ((obj semanticdb-project-database-emacs-lisp) filename) 106(cl-defmethod semanticdb-file-table ((obj semanticdb-project-database-emacs-lisp) _filename)
107 "From OBJ, return FILENAME's associated table object. 107 "From OBJ, return FILENAME's associated table object.
108For Emacs Lisp, creates a specialized table." 108For Emacs Lisp, creates a specialized table."
109 (car (semanticdb-get-database-tables obj)) 109 (car (semanticdb-get-database-tables obj))
110 ) 110 )
111 111
112(cl-defmethod semanticdb-get-tags ((table semanticdb-table-emacs-lisp )) 112(cl-defmethod semanticdb-get-tags ((_table semanticdb-table-emacs-lisp ))
113 "Return the list of tags belonging to TABLE." 113 "Return the list of tags belonging to TABLE."
114 ;; specialty table ? Probably derive tags at request time. 114 ;; specialty table ? Probably derive tags at request time.
115 nil) 115 nil)
116 116
117(cl-defmethod semanticdb-equivalent-mode ((table semanticdb-table-emacs-lisp) &optional buffer) 117(cl-defmethod semanticdb-equivalent-mode ((_table semanticdb-table-emacs-lisp) &optional buffer)
118 "Return non-nil if TABLE's mode is equivalent to BUFFER. 118 "Return non-nil if TABLE's mode is equivalent to BUFFER.
119Equivalent modes are specified by the `semantic-equivalent-major-modes' 119Equivalent modes are specified by the `semantic-equivalent-major-modes'
120local variable." 120local variable."
121 (with-current-buffer buffer 121 (with-current-buffer buffer
122 (eq (or mode-local-active-mode major-mode) 'emacs-lisp-mode))) 122 (eq (or mode-local-active-mode major-mode) 'emacs-lisp-mode)))
123 123
124(cl-defmethod semanticdb-full-filename ((obj semanticdb-table-emacs-lisp)) 124(cl-defmethod semanticdb-full-filename ((_obj semanticdb-table-emacs-lisp))
125 "Fetch the full filename that OBJ refers to. 125 "Fetch the full filename that OBJ refers to.
126For Emacs Lisp system DB, there isn't one." 126For Emacs Lisp system DB, there isn't one."
127 nil) 127 nil)
@@ -151,7 +151,7 @@ If Emacs cannot resolve this symbol to a particular file, then return nil."
151 'defvar) 151 'defvar)
152 )) 152 ))
153 (sym (intern (semantic-tag-name tag))) 153 (sym (intern (semantic-tag-name tag)))
154 (file (condition-case err 154 (file (condition-case nil
155 (symbol-file sym type) 155 (symbol-file sym type)
156 ;; Older [X]Emacs don't have a 2nd argument. 156 ;; Older [X]Emacs don't have a 2nd argument.
157 (error (symbol-file sym)))) 157 (error (symbol-file sym))))
@@ -169,7 +169,6 @@ If Emacs cannot resolve this symbol to a particular file, then return nil."
169 (setq file (concat file ".gz")))) 169 (setq file (concat file ".gz"))))
170 170
171 (let* ((tab (semanticdb-file-table-object file)) 171 (let* ((tab (semanticdb-file-table-object file))
172 (alltags (when tab (semanticdb-get-tags tab)))
173 (newtags (when tab (semanticdb-find-tags-by-name-method 172 (newtags (when tab (semanticdb-find-tags-by-name-method
174 tab (semantic-tag-name tag)))) 173 tab (semantic-tag-name tag))))
175 (match nil)) 174 (match nil))
@@ -248,7 +247,7 @@ TOKTYPE is a hint to the type of tag desired."
248 "Variable used to collect `mapatoms' output.") 247 "Variable used to collect `mapatoms' output.")
249 248
250(cl-defmethod semanticdb-find-tags-by-name-method 249(cl-defmethod semanticdb-find-tags-by-name-method
251 ((table semanticdb-table-emacs-lisp) name &optional tags) 250 ((_table semanticdb-table-emacs-lisp) name &optional tags)
252 "Find all tags named NAME in TABLE. 251 "Find all tags named NAME in TABLE.
253Uses `intern-soft' to match NAME to Emacs symbols. 252Uses `intern-soft' to match NAME to Emacs symbols.
254Return a list of tags." 253Return a list of tags."
@@ -269,26 +268,26 @@ Return a list of tags."
269 )))) 268 ))))
270 269
271(cl-defmethod semanticdb-find-tags-by-name-regexp-method 270(cl-defmethod semanticdb-find-tags-by-name-regexp-method
272 ((table semanticdb-table-emacs-lisp) regex &optional tags) 271 ((_table semanticdb-table-emacs-lisp) regex &optional tags)
273 "Find all tags with name matching REGEX in TABLE. 272 "Find all tags with name matching REGEX in TABLE.
274Optional argument TAGS is a list of tags to search. 273Optional argument TAGS is a list of tags to search.
275Uses `apropos-internal' to find matches. 274Uses `apropos-internal' to find matches.
276Return a list of tags." 275Return a list of tags."
277 (if tags (cl-call-next-method) 276 (if tags (cl-call-next-method)
278 (delq nil (mapcar 'semanticdb-elisp-sym->tag 277 (delq nil (mapcar #'semanticdb-elisp-sym->tag
279 (apropos-internal regex))))) 278 (apropos-internal regex)))))
280 279
281(cl-defmethod semanticdb-find-tags-for-completion-method 280(cl-defmethod semanticdb-find-tags-for-completion-method
282 ((table semanticdb-table-emacs-lisp) prefix &optional tags) 281 ((_table semanticdb-table-emacs-lisp) prefix &optional tags)
283 "In TABLE, find all occurrences of tags matching PREFIX. 282 "In TABLE, find all occurrences of tags matching PREFIX.
284Optional argument TAGS is a list of tags to search. 283Optional argument TAGS is a list of tags to search.
285Returns a table of all matching tags." 284Returns a table of all matching tags."
286 (if tags (cl-call-next-method) 285 (if tags (cl-call-next-method)
287 (delq nil (mapcar 'semanticdb-elisp-sym->tag 286 (delq nil (mapcar #'semanticdb-elisp-sym->tag
288 (all-completions prefix obarray))))) 287 (all-completions prefix obarray)))))
289 288
290(cl-defmethod semanticdb-find-tags-by-class-method 289(cl-defmethod semanticdb-find-tags-by-class-method
291 ((table semanticdb-table-emacs-lisp) class &optional tags) 290 ((_table semanticdb-table-emacs-lisp) _class &optional tags)
292 "In TABLE, find all occurrences of tags of CLASS. 291 "In TABLE, find all occurrences of tags of CLASS.
293Optional argument TAGS is a list of tags to search. 292Optional argument TAGS is a list of tags to search.
294Returns a table of all matching tags." 293Returns a table of all matching tags."
@@ -323,7 +322,7 @@ Like `semanticdb-find-tags-for-completion-method' for Emacs Lisp."
323;;; Advanced Searches 322;;; Advanced Searches
324;; 323;;
325(cl-defmethod semanticdb-find-tags-external-children-of-type-method 324(cl-defmethod semanticdb-find-tags-external-children-of-type-method
326 ((table semanticdb-table-emacs-lisp) type &optional tags) 325 ((_table semanticdb-table-emacs-lisp) type &optional tags)
327 "Find all nonterminals which are child elements of TYPE 326 "Find all nonterminals which are child elements of TYPE
328Optional argument TAGS is a list of tags to search. 327Optional argument TAGS is a list of tags to search.
329Return a list of tags." 328Return a list of tags."
@@ -333,7 +332,7 @@ Return a list of tags."
333 (let* ((class (intern-soft type)) 332 (let* ((class (intern-soft type))
334 (taglst (when class 333 (taglst (when class
335 (delq nil 334 (delq nil
336 (mapcar 'semanticdb-elisp-sym->tag 335 (mapcar #'semanticdb-elisp-sym->tag
337 ;; Fancy eieio function that knows all about 336 ;; Fancy eieio function that knows all about
338 ;; built in methods belonging to CLASS. 337 ;; built in methods belonging to CLASS.
339 (cl-generic-all-functions class))))) 338 (cl-generic-all-functions class)))))
diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el
index a03e99b9886..0c1fe7e449b 100644
--- a/lisp/cedet/semantic/symref.el
+++ b/lisp/cedet/semantic/symref.el
@@ -338,7 +338,7 @@ The symref TOOL should already contain the search criteria."
338 ) 338 )
339 )) 339 ))
340 340
341(cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-baseclass)) 341(cl-defmethod semantic-symref-perform-search ((_tool semantic-symref-tool-baseclass))
342 "Base search for symref tools should throw an error." 342 "Base search for symref tools should throw an error."
343 (error "Symref tool objects must implement `semantic-symref-perform-search'")) 343 (error "Symref tool objects must implement `semantic-symref-perform-search'"))
344 344
@@ -356,7 +356,7 @@ over until it returns nil."
356 (nreverse result))) 356 (nreverse result)))
357 ) 357 )
358 358
359(cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-baseclass)) 359(cl-defmethod semantic-symref-parse-tool-output-one-line ((_tool semantic-symref-tool-baseclass))
360 "Base tool output parser is not implemented." 360 "Base tool output parser is not implemented."
361 (error "Symref tool objects must implement `semantic-symref-parse-tool-output-one-line'")) 361 (error "Symref tool objects must implement `semantic-symref-parse-tool-output-one-line'"))
362 362
@@ -479,8 +479,7 @@ If there is no database, of if the searchtype is wrong, return nil."
479 ;; tagname, tagregexp, tagcompletions 479 ;; tagname, tagregexp, tagcompletions
480 (if (not (memq searchtype '(tagname tagregexp tagcompletions))) 480 (if (not (memq searchtype '(tagname tagregexp tagcompletions)))
481 nil 481 nil
482 (let* ((line (car hit)) 482 (let* ((file (cdr hit))
483 (file (cdr hit))
484 ;; FAIL here vv - don't load is not obeyed if no table found. 483 ;; FAIL here vv - don't load is not obeyed if no table found.
485 (db (semanticdb-file-table-object file t)) 484 (db (semanticdb-file-table-object file t))
486 (found 485 (found