diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-12 11:32:42 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-12 11:32:42 -0500 |
commit | d1a7d16f8e1a42d6e6edc0621e29b38f92e9fc2e (patch) | |
tree | 99ff2074307930d16368e8efee9c65e5f02f36d1 /lisp | |
parent | e609bf59ebb23c10f0e9f56df38f64be37de06dd (diff) | |
download | emacs-d1a7d16f8e1a42d6e6edc0621e29b38f92e9fc2e.tar.gz |
* lisp/cedet/{*.el,ede/*.el}: Use lexical-binding
Remove a few redundant `:group` arguments as well.
* lisp/cedet/ede.el: Use lexical-binding.
Don't load `ede/files` at compile-time.
(ede-speedbar): Declare function.
(ede-load-project-file): Allow `rootreturn` to be a reference rather
than a symbol.
(ede-initialize-state-current-buffer): Pass `ROOT` as a reference
rather than a symbol to `ede-directory-get-open-project` and
`ede-load-project-file` so we don't need to make it dynamically scoped.
(ede-flush-deleted-projects): Avoid `add-to-list` on a local var.
* lisp/cedet/ede/files.el: Use lexical-binding.
(ede-directory-get-open-project): Allow `rootreturn` to be a reference
rather than a symbol.
(ede-project-root-directory): Remove unused var `root`.
(ede-expand-filename-impl): Remove unused vars `path` and `proj`.
* lisp/cedet/cedet-idutils.el: Use lexical-binding.
(cedet-idutils-search): Remove always-nil variable `scopeflags`.
* lisp/cedet/data-debug.el: Use lexical-binding.
(data-debug-insert-overlay-button, data-debug-insert-overlay-list-button)
(data-debug-insert-buffer-button, data-debug-insert-buffer-list-button)
(data-debug-insert-process-button): Remove always-nil variable `tip`.
(data-debug-insert-ring-button): Remove unused var `ringthing`.
(data-debug-insert-widget-properties): Remove unused var `type`.
* lisp/cedet/semantic.el: Use lexical-binding.
(semantic-mode): Strength-reduce `eval` to `symbol-value`.
* lisp/cedet/ede/custom.el: Use lexical-binding.
(ede-project-sort-targets): Remove unused vars `count`, `current`, and
`order`.
* lisp/cedet/ede/pconf.el: Use lexical-binding.
(ede-proj-configure-synchronize): Remove unused var `add-missing`.
* lisp/cedet/ede/pmake.el (ede-proj-makefile-garbage-patterns):
Simplify via η-reduction.
(ede-proj-makefile-dependencies): Use `seq-some` rather than `eval+or`.
* lisp/cedet/ede/proj-elisp.el: Use lexical-binding.
(project-compile-target): Remove unused var `elc`.
(ede-update-version-in-source): Remove unused var `match`.
(project-compile-target): Declare function `cedet-update-autoloads`
from file we don't have.
* lisp/cedet/cedet-cscope.el: Use lexical-binding.
* lisp/cedet/cedet-files.el: Use lexical-binding.
* lisp/cedet/cedet-global.el: Use lexical-binding.
* lisp/cedet/cedet.el: Use lexical-binding.
* lisp/cedet/ede/auto.el: Use lexical-binding.
* lisp/cedet/ede/autoconf-edit.el: Use lexical-binding.
* lisp/cedet/ede/config.el: Use lexical-binding.
* lisp/cedet/ede/cpp-root.el: Use lexical-binding.
* lisp/cedet/ede/detect.el: Use lexical-binding.
* lisp/cedet/ede/generic.el: Use lexical-binding.
* lisp/cedet/ede/linux.el: Use lexical-binding.
* lisp/cedet/ede/locate.el: Use lexical-binding.
* lisp/cedet/ede/makefile-edit.el: Use lexical-binding.
* lisp/cedet/ede/proj-info.el: Use lexical-binding.
* lisp/cedet/ede/proj-obj.el: Use lexical-binding.
* lisp/cedet/ede/proj-prog.el: Use lexical-binding.
* lisp/cedet/ede/proj-shared.el: Use lexical-binding.
* lisp/cedet/ede/proj.el: Use lexical-binding.
* lisp/cedet/ede/shell.el: Use lexical-binding.
* lisp/cedet/ede/simple.el: Use lexical-binding.
* lisp/cedet/ede/source.el: Use lexical-binding.
* lisp/cedet/ede/speedbar.el: Use lexical-binding.
* lisp/cedet/ede/util.el: Use lexical-binding.
Diffstat (limited to 'lisp')
36 files changed, 333 insertions, 326 deletions
diff --git a/lisp/cedet/cedet-cscope.el b/lisp/cedet/cedet-cscope.el index 4d4a9f78d5d..95f04541c84 100644 --- a/lisp/cedet/cedet-cscope.el +++ b/lisp/cedet/cedet-cscope.el @@ -1,4 +1,4 @@ -;;; cedet-cscope.el --- CScope support for CEDET +;;; cedet-cscope.el --- CScope support for CEDET -*- lexical-binding: t; -*- ;;; Copyright (C) 2009-2021 Free Software Foundation, Inc. @@ -34,7 +34,7 @@ :type 'string :group 'cedet) -(defun cedet-cscope-search (searchtext texttype type scope) +(defun cedet-cscope-search (searchtext texttype type _scope) "Perform a search with CScope, return the created buffer. SEARCHTEXT is text to find. TEXTTYPE is the type of text, such as `regexp', `string', `tagname', @@ -85,7 +85,7 @@ options -cR." (with-current-buffer b (setq default-directory cd) (erase-buffer)) - (apply 'call-process cedet-cscope-command + (apply #'call-process cedet-cscope-command nil b nil flags) b)) diff --git a/lisp/cedet/cedet-files.el b/lisp/cedet/cedet-files.el index 31608159cc1..c9d557f5974 100644 --- a/lisp/cedet/cedet-files.el +++ b/lisp/cedet/cedet-files.el @@ -1,4 +1,4 @@ -;;; cedet-files.el --- Common routines dealing with file names. +;;; cedet-files.el --- Common routines dealing with file names. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el index 77b44744399..227ebd54b86 100644 --- a/lisp/cedet/cedet-global.el +++ b/lisp/cedet/cedet-global.el @@ -1,4 +1,4 @@ -;;; cedet-global.el --- GNU Global support for CEDET. +;;; cedet-global.el --- GNU Global support for CEDET. -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -75,7 +75,7 @@ SCOPE is the scope of the search, such as `project' or `subdirs'." (with-current-buffer b (setq default-directory cd) (erase-buffer)) - (apply 'call-process cedet-global-command + (apply #'call-process cedet-global-command nil b nil flags) b)) @@ -88,7 +88,7 @@ SCOPE is the scope of the search, such as `project' or `subdirs'." (with-current-buffer b (setq default-directory cd) (erase-buffer)) - (apply 'call-process cedet-global-gtags-command + (apply #'call-process cedet-global-gtags-command nil b nil flags) diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el index 3e3d6a5e949..a2b8cb35240 100644 --- a/lisp/cedet/cedet-idutils.el +++ b/lisp/cedet/cedet-idutils.el @@ -1,4 +1,4 @@ -;;; cedet-idutils.el --- ID Utils support for CEDET. +;;; cedet-idutils.el --- ID Utils support for CEDET. -*- lexical-binding: t; -*- ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. @@ -47,7 +47,7 @@ :type 'string :group 'cedet) -(defun cedet-idutils-search (searchtext texttype type scope) +(defun cedet-idutils-search (searchtext texttype type _scope) "Perform a search with ID Utils, return the created buffer. SEARCHTEXT is text to find. TEXTTYPE is the type of text, such as `regexp', `string', `tagname', @@ -64,7 +64,7 @@ Note: Scope is not yet supported." (let* ((resultflg (if (eq texttype 'tagcompletions) (list "--key=token") (list "--result=grep"))) - (scopeflgs nil) ; (cond ((eq scope 'project) "" ) ((eq scope 'target) "l"))) + ;; (scopeflgs (cond ((eq scope 'project) "" ) ((eq scope 'target) "l"))) (stflag (cond ((or (eq texttype 'tagname) (eq texttype 'tagregexp)) (list "-r" "-w")) @@ -77,7 +77,7 @@ Note: Scope is not yet supported." ;; t means 'symbol (t (list "-l" "-w")))) ) - (cedet-idutils-lid-call (append resultflg scopeflgs stflag + (cedet-idutils-lid-call (append resultflg nil stflag ;; scopeflgs (list searchtext)))))) (defun cedet-idutils-fnid-call (flags) @@ -89,7 +89,7 @@ Return the created buffer with program output." (with-current-buffer b (setq default-directory cd) (erase-buffer)) - (apply 'call-process cedet-idutils-file-command + (apply #'call-process cedet-idutils-file-command nil b nil flags) b)) @@ -103,7 +103,7 @@ Return the created buffer with program output." (with-current-buffer b (setq default-directory cd) (erase-buffer)) - (apply 'call-process cedet-idutils-token-command + (apply #'call-process cedet-idutils-token-command nil b nil flags) b)) @@ -117,7 +117,7 @@ Return the created buffer with program output." (with-current-buffer b (setq default-directory cd) (erase-buffer)) - (apply 'call-process cedet-idutils-make-command + (apply #'call-process cedet-idutils-make-command nil b nil flags) b)) @@ -133,7 +133,7 @@ Return a filename relative to the default directory." (if (looking-at "[^ \n]*fnid: ") (error "ID Utils not available") (split-string (buffer-string) "\n" t))))) - (setq ans (mapcar 'expand-file-name ans)) + (setq ans (mapcar #'expand-file-name ans)) (when (called-interactively-p 'interactive) (if ans (if (= (length ans) 1) diff --git a/lisp/cedet/cedet.el b/lisp/cedet/cedet.el index 5d98a1939d7..b6043f1403e 100644 --- a/lisp/cedet/cedet.el +++ b/lisp/cedet/cedet.el @@ -1,4 +1,4 @@ -;;; cedet.el --- Setup CEDET environment +;;; cedet.el --- Setup CEDET environment -*- lexical-binding: t; -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. @@ -48,25 +48,25 @@ (defvar cedet-menu-map ;(make-sparse-keymap "CEDET menu") (let ((map (make-sparse-keymap "CEDET menu"))) - (define-key map [semantic-force-refresh] 'undefined) - (define-key map [semantic-edit-menu] 'undefined) - (define-key map [navigate-menu] 'undefined) - (define-key map [semantic-options-separator] 'undefined) - (define-key map [global-semantic-highlight-func-mode] 'undefined) - (define-key map [global-semantic-stickyfunc-mode] 'undefined) - (define-key map [global-semantic-decoration-mode] 'undefined) - (define-key map [global-semantic-idle-completions-mode] 'undefined) - (define-key map [global-semantic-idle-summary-mode] 'undefined) - (define-key map [global-semantic-idle-scheduler-mode] 'undefined) - (define-key map [global-semanticdb-minor-mode] 'undefined) - (define-key map [cedet-menu-separator] 'undefined) - (define-key map [ede-find-file] 'undefined) - (define-key map [ede-speedbar] 'undefined) - (define-key map [ede] 'undefined) - (define-key map [ede-new] 'undefined) - (define-key map [ede-target-options] 'undefined) - (define-key map [ede-project-options] 'undefined) - (define-key map [ede-build-forms-menu] 'undefined) + (define-key map [semantic-force-refresh] #'undefined) + (define-key map [semantic-edit-menu] #'undefined) + (define-key map [navigate-menu] #'undefined) + (define-key map [semantic-options-separator] #'undefined) + (define-key map [global-semantic-highlight-func-mode] #'undefined) + (define-key map [global-semantic-stickyfunc-mode] #'undefined) + (define-key map [global-semantic-decoration-mode] #'undefined) + (define-key map [global-semantic-idle-completions-mode] #'undefined) + (define-key map [global-semantic-idle-summary-mode] #'undefined) + (define-key map [global-semantic-idle-scheduler-mode] #'undefined) + (define-key map [global-semanticdb-minor-mode] #'undefined) + (define-key map [cedet-menu-separator] #'undefined) + (define-key map [ede-find-file] #'undefined) + (define-key map [ede-speedbar] #'undefined) + (define-key map [ede] #'undefined) + (define-key map [ede-new] #'undefined) + (define-key map [ede-target-options] #'undefined) + (define-key map [ede-project-options] #'undefined) + (define-key map [ede-build-forms-menu] #'undefined) map) "Menu keymap for the CEDET package. This is used by `semantic-mode' and `global-ede-mode'.") diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index f0fa91b3b17..428848be04d 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -1,4 +1,4 @@ -;;; data-debug.el --- Data structure debugger +;;; data-debug.el --- Data structure debugger -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -48,9 +48,9 @@ ;;; Compatibility ;; -(define-obsolete-function-alias 'data-debug-overlay-properties 'overlay-properties "28.1") -(define-obsolete-function-alias 'data-debug-overlay-p 'overlayp "28.1") -(define-obsolete-function-alias 'dd-propertize 'propertize "28.1") +(define-obsolete-function-alias 'data-debug-overlay-properties #'overlay-properties "28.1") +(define-obsolete-function-alias 'data-debug-overlay-p #'overlayp "28.1") +(define-obsolete-function-alias 'dd-propertize #'propertize "28.1") ;;; GENERIC STUFF ;; @@ -100,14 +100,14 @@ PREBUTTONTEXT is some text between prefix and the overlay button." (let ((start (point)) (end nil) (str (format "%s" overlay)) - (tip nil)) + ) ;; (tip nil) (insert prefix prebuttontext str) (setq end (point)) (put-text-property (- end (length str)) end 'face 'font-lock-comment-face) (put-text-property start end 'ddebug overlay) (put-text-property start end 'ddebug-indent(length prefix)) (put-text-property start end 'ddebug-prefix prefix) - (put-text-property start end 'help-echo tip) + ;; (put-text-property start end 'help-echo tip) (put-text-property start end 'ddebug-function 'data-debug-insert-overlay-from-point) (insert "\n") @@ -149,14 +149,14 @@ PREBUTTONTEXT is some text between prefix and the overlay list button." (let ((start (point)) (end nil) (str (format "#<overlay list: %d entries>" (length overlaylist))) - (tip nil)) + ) ;; (tip nil) (insert prefix prebuttontext str) (setq end (point)) (put-text-property (- end (length str)) end 'face 'font-lock-comment-face) (put-text-property start end 'ddebug overlaylist) (put-text-property start end 'ddebug-indent(length prefix)) (put-text-property start end 'ddebug-prefix prefix) - (put-text-property start end 'help-echo tip) + ;; (put-text-property start end 'help-echo tip) (put-text-property start end 'ddebug-function 'data-debug-insert-overlay-list-from-point) (insert "\n") @@ -204,14 +204,14 @@ PREBUTTONTEXT is some text between prefix and the buffer button." (let ((start (point)) (end nil) (str (format "%S" buffer)) - (tip nil)) + ) ;; (tip nil) (insert prefix prebuttontext str) (setq end (point)) (put-text-property (- end (length str)) end 'face 'font-lock-comment-face) (put-text-property start end 'ddebug buffer) (put-text-property start end 'ddebug-indent(length prefix)) (put-text-property start end 'ddebug-prefix prefix) - (put-text-property start end 'help-echo tip) + ;; (put-text-property start end 'help-echo tip) (put-text-property start end 'ddebug-function 'data-debug-insert-buffer-from-point) (insert "\n") @@ -253,14 +253,14 @@ PREBUTTONTEXT is some text between prefix and the buffer list button." (let ((start (point)) (end nil) (str (format "#<buffer list: %d entries>" (length bufferlist))) - (tip nil)) + ) ;; (tip nil) (insert prefix prebuttontext str) (setq end (point)) (put-text-property (- end (length str)) end 'face 'font-lock-comment-face) (put-text-property start end 'ddebug bufferlist) (put-text-property start end 'ddebug-indent(length prefix)) (put-text-property start end 'ddebug-prefix prefix) - (put-text-property start end 'help-echo tip) + ;; (put-text-property start end 'help-echo tip) (put-text-property start end 'ddebug-function 'data-debug-insert-buffer-list-from-point) (insert "\n") @@ -309,14 +309,14 @@ PREBUTTONTEXT is some text between prefix and the process button." (let ((start (point)) (end nil) (str (format "%S : %s" process (process-status process))) - (tip nil)) + ) ;; (tip nil) (insert prefix prebuttontext str) (setq end (point)) (put-text-property (- end (length str)) end 'face 'font-lock-comment-face) (put-text-property start end 'ddebug process) (put-text-property start end 'ddebug-indent(length prefix)) (put-text-property start end 'ddebug-prefix prefix) - (put-text-property start end 'help-echo tip) + ;; (put-text-property start end 'help-echo tip) (put-text-property start end 'ddebug-function 'data-debug-insert-process-from-point) (insert "\n") @@ -363,8 +363,8 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." (str (format "#<RING: %d, %d max>" (ring-length ring) (ring-size ring))) - (ringthing - (if (= (ring-length ring) 0) nil (ring-ref ring 0))) + ;; (ringthing + ;; (if (= (ring-length ring) 0) nil (ring-ref ring 0))) (tip (format "Ring max-size %d, length %d." (ring-size ring) (ring-length ring))) @@ -437,7 +437,7 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." ;; Widgets have a long list of properties (defun data-debug-insert-widget-properties (widget prefix) "Insert the contents of WIDGET inserting PREFIX before each element." - (let ((type (car widget)) + (let (;; (type (car widget)) (rest (cdr widget))) (while rest (data-debug-insert-thing (car (cdr rest)) @@ -683,7 +683,7 @@ PREBUTTONTEXT is some text between prefix and the thing." ) ;;; nil thing -(defun data-debug-insert-nil (thing prefix prebuttontext) +(defun data-debug-insert-nil (_thing prefix prebuttontext) "Insert one simple THING with a face. PREFIX is the text that precedes the button. PREBUTTONTEXT is some text between prefix and the thing. @@ -856,19 +856,18 @@ If PARENT is non-nil, it is somehow related as a parent to thing." (defvar data-debug-mode-map (let ((km (make-sparse-keymap))) (suppress-keymap km) - (define-key km [mouse-2] 'data-debug-expand-or-contract-mouse) - (define-key km " " 'data-debug-expand-or-contract) - (define-key km "\C-m" 'data-debug-expand-or-contract) - (define-key km "n" 'data-debug-next) - (define-key km "p" 'data-debug-prev) - (define-key km "N" 'data-debug-next-expando) - (define-key km "P" 'data-debug-prev-expando) + (define-key km [mouse-2] #'data-debug-expand-or-contract-mouse) + (define-key km " " #'data-debug-expand-or-contract) + (define-key km "\C-m" #'data-debug-expand-or-contract) + (define-key km "n" #'data-debug-next) + (define-key km "p" #'data-debug-prev) + (define-key km "N" #'data-debug-next-expando) + (define-key km "P" #'data-debug-prev-expando) km) "Keymap used in data-debug.") (defcustom data-debug-mode-hook nil "Hook run when data-debug starts." - :group 'data-debug :type 'hook) (define-derived-mode data-debug-mode fundamental-mode "DATA-DEBUG" @@ -1032,7 +1031,7 @@ Do nothing if already contracted." nil read-expression-map t 'read-expression-history)) )) - (let ((v (eval expr))) + (let ((v (eval expr t))) (if (not v) (message "Expression %s is nil." expr) (data-debug-show-stuff v "expression")))) @@ -1049,12 +1048,12 @@ If the result is a list or vector, then use the data debugger to display it." (let (result) (if (null eval-expression-debug-on-error) - (setq result (values--store-value (eval expr))) + (setq result (values--store-value (eval expr t))) (let ((old-value (make-symbol "t")) new-value) ;; Bind debug-on-error to something unique so that we can ;; detect when evalled code changes it. (let ((debug-on-error old-value)) - (setq result (values--store-value (eval expr))) + (setq result (values--store-value (eval expr t))) (setq new-value debug-on-error)) ;; If evalled code has changed the value of debug-on-error, ;; propagate that change to the global binding. diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el index 369a9f7e713..2ec9f5d9d67 100644 --- a/lisp/cedet/ede.el +++ b/lisp/cedet/ede.el @@ -1,4 +1,4 @@ -;;; ede.el --- Emacs Development Environment gloss +;;; ede.el --- Emacs Development Environment gloss -*- lexical-binding: t; -*- ;; Copyright (C) 1998-2005, 2007-2021 Free Software Foundation, Inc. @@ -87,7 +87,6 @@ target wants the file, the user is asked. If only one target wants the file, then it is automatically added to that target. If the value is `ask', then the user is always asked, unless there is no target willing to take the file. `never' means never perform the check." - :group 'ede :type '(choice (const always) (const multi-ask) (const ask) @@ -95,7 +94,6 @@ target willing to take the file. `never' means never perform the check." (defcustom ede-debug-program-function 'gdb "Default Emacs command used to debug a target." - :group 'ede :type 'function) ; make this be a list of options some day (defcustom ede-project-directories nil @@ -112,7 +110,6 @@ If you invoke the commands \\[ede] or \\[ede-new] on a directory that is not listed, Emacs will offer to add it to the list. Any other value disables searching for EDE project files." - :group 'ede :type '(choice (const :tag "Any directory" t) (repeat :tag "List of directories" (directory)) @@ -186,21 +183,23 @@ Argument LIST-O-O is the list of objects to choose from." ;;; Menu and Keymap +(declare-function ede-speedbar "ede/speedbar" ()) + (defvar ede-minor-mode-map (let ((map (make-sparse-keymap)) (pmap (make-sparse-keymap))) - (define-key pmap "e" 'ede-edit-file-target) - (define-key pmap "a" 'ede-add-file) - (define-key pmap "d" 'ede-remove-file) - (define-key pmap "t" 'ede-new-target) - (define-key pmap "g" 'ede-rescan-toplevel) - (define-key pmap "s" 'ede-speedbar) - (define-key pmap "f" 'ede-find-file) - (define-key pmap "C" 'ede-compile-project) - (define-key pmap "c" 'ede-compile-target) - (define-key pmap "\C-c" 'ede-compile-selected) - (define-key pmap "D" 'ede-debug-target) - (define-key pmap "R" 'ede-run-target) + (define-key pmap "e" #'ede-edit-file-target) + (define-key pmap "a" #'ede-add-file) + (define-key pmap "d" #'ede-remove-file) + (define-key pmap "t" #'ede-new-target) + (define-key pmap "g" #'ede-rescan-toplevel) + (define-key pmap "s" #'ede-speedbar) + (define-key pmap "f" #'ede-find-file) + (define-key pmap "C" #'ede-compile-project) + (define-key pmap "c" #'ede-compile-target) + (define-key pmap "\C-c" #'ede-compile-selected) + (define-key pmap "D" #'ede-debug-target) + (define-key pmap "R" #'ede-run-target) ;; bind our submap into map (define-key map "\C-c." pmap) map) @@ -476,7 +475,7 @@ To be used in hook functions." If this file is contained, or could be contained in an EDE controlled project, then this mode is activated automatically provided `global-ede-mode' is enabled." - :group 'ede + :global nil (cond ((or (eq major-mode 'dired-mode) (eq major-mode 'vc-dir-mode)) (ede-dired-minor-mode (if ede-minor-mode 1 -1))) @@ -486,6 +485,9 @@ provided `global-ede-mode' is enabled." ;; If we fail to have a project here, turn it back off. (ede-minor-mode -1))))) +(declare-function ede-directory-project-cons "ede/files" (dir &optional force)) +(declare-function ede-toplevel-project-or-nil "ede/files" (dir)) + (defun ede-initialize-state-current-buffer () "Initialize the current buffer's state for EDE. Sets buffer local variables for EDE." @@ -496,7 +498,7 @@ Sets buffer local variables for EDE." ;; Init the buffer. (let* ((ROOT nil) (proj (ede-directory-get-open-project default-directory - 'ROOT))) + (gv-ref ROOT)))) (when (not proj) ;; If there is no open project, look up the project @@ -517,7 +519,8 @@ Sets buffer local variables for EDE." (ede-directory-safe-p top))) ;; The project is safe, so load it in. - (setq proj (ede-load-project-file default-directory projdetect 'ROOT)))))) + (setq proj (ede-load-project-file default-directory projdetect + (gv-ref ROOT))))))) ;; If PROJ is now loaded in, we can initialize our buffer to it. (when proj @@ -561,30 +564,29 @@ Sets buffer local variables for EDE." This global minor mode enables `ede-minor-mode' in all buffers in an EDE controlled project." :global t - :group 'ede (if global-ede-mode ;; Turn on global-ede-mode (progn (if semantic-mode (define-key cedet-menu-map [cedet-menu-separator] '("--"))) - (add-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p) - (add-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil) - (add-hook 'ecb-source-path-functions 'ede-ecb-project-paths) + (add-hook 'semanticdb-project-predicate-functions #'ede-directory-project-p) + (add-hook 'semanticdb-project-root-functions #'ede-toplevel-project-or-nil) + (add-hook 'ecb-source-path-functions #'ede-ecb-project-paths) ;; Append our hook to the end. This allows mode-local to finish ;; it's stuff before we start doing misc file loads, etc. - (add-hook 'find-file-hook 'ede-turn-on-hook t) - (add-hook 'dired-mode-hook 'ede-turn-on-hook) - (add-hook 'kill-emacs-hook 'ede-save-cache) + (add-hook 'find-file-hook #'ede-turn-on-hook t) + (add-hook 'dired-mode-hook #'ede-turn-on-hook) + (add-hook 'kill-emacs-hook #'ede-save-cache) (ede-load-cache) (ede-reset-all-buffers)) ;; Turn off global-ede-mode (define-key cedet-menu-map [cedet-menu-separator] nil) - (remove-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p) - (remove-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil) - (remove-hook 'ecb-source-path-functions 'ede-ecb-project-paths) - (remove-hook 'find-file-hook 'ede-turn-on-hook) - (remove-hook 'dired-mode-hook 'ede-turn-on-hook) - (remove-hook 'kill-emacs-hook 'ede-save-cache) + (remove-hook 'semanticdb-project-predicate-functions #'ede-directory-project-p) + (remove-hook 'semanticdb-project-root-functions #'ede-toplevel-project-or-nil) + (remove-hook 'ecb-source-path-functions #'ede-ecb-project-paths) + (remove-hook 'find-file-hook #'ede-turn-on-hook) + (remove-hook 'dired-mode-hook #'ede-turn-on-hook) + (remove-hook 'kill-emacs-hook #'ede-save-cache) (ede-save-cache) (ede-reset-all-buffers))) @@ -1080,7 +1082,7 @@ Flush the dead projects from the project cache." (let ((dead nil)) (dolist (P ede-projects) (when (not (file-exists-p (oref P file))) - (add-to-list 'dead P))) + (cl-pushnew P dead :test #'equal))) (dolist (D dead) (ede-delete-project-from-global-list D)) )) @@ -1108,7 +1110,7 @@ Flush the dead projects from the project cache." "Project file independent way to read a project in from DIR. Optional DETECTIN is an autoload cons from `ede-detect-directory-for-project' which can be passed in to save time. -Optional ROOTRETURN will return the root project for DIR." +Optional ROOTRETURN reference will return the root project for DIR." ;; Don't do anything if we are in the process of ;; constructing an EDE object. ;; @@ -1147,7 +1149,8 @@ Optional ROOTRETURN will return the root project for DIR." (setq o (ede-auto-load-project autoloader toppath)))) ;; Return the found root project. - (when rootreturn (set rootreturn o)) + (when rootreturn (if (symbolp rootreturn) (set rootreturn o) + (setf (gv-deref rootreturn) o))) ;; The project has been found (in the global list) or loaded from ;; disk (via autoloader.) We can now search for the project asked @@ -1504,6 +1507,8 @@ It does not apply the value to buffers." ;;; Integration with project.el (defun project-try-ede (dir) + ;; FIXME: This passes the `ROOT' dynbound variable, but I don't know + ;; where it comes from! (let ((project-dir (locate-dominating-file dir @@ -1523,7 +1528,7 @@ It does not apply the value to buffers." (provide 'ede) ;; Include this last because it depends on ede. -(require 'ede/files) +(if t (require 'ede/files)) ;; Don't bother loading it at compile-time. ;; If this does not occur after the provide, we can get a recursive ;; load. Yuck! diff --git a/lisp/cedet/ede/auto.el b/lisp/cedet/ede/auto.el index e1417d7806c..ee9d0116af3 100644 --- a/lisp/cedet/ede/auto.el +++ b/lisp/cedet/ede/auto.el @@ -1,4 +1,4 @@ -;;; ede/auto.el --- Autoload features for EDE +;;; ede/auto.el --- Autoload features for EDE -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2021 Free Software Foundation, Inc. @@ -325,13 +325,13 @@ NOTE: Do not call this - it should only be called from `ede-load-project-file'." ;; See if we can do without them. ;; @FIXME - delete from loaddefs to remove this. -(cl-defmethod ede-project-root ((this ede-project-autoload)) +(cl-defmethod ede-project-root ((_this ede-project-autoload)) "If a project knows its root, return it here. Allows for one-project-object-for-a-tree type systems." nil) ;; @FIXME - delete from loaddefs to remove this. -(cl-defmethod ede-project-root-directory ((this ede-project-autoload) &optional file) +(cl-defmethod ede-project-root-directory ((_this ede-project-autoload) &optional _file) "" nil) (provide 'ede/auto) diff --git a/lisp/cedet/ede/autoconf-edit.el b/lisp/cedet/ede/autoconf-edit.el index ca8535fdf23..d6f0a86f9ad 100644 --- a/lisp/cedet/ede/autoconf-edit.el +++ b/lisp/cedet/ede/autoconf-edit.el @@ -1,4 +1,4 @@ -;;; ede/autoconf-edit.el --- Keymap for autoconf +;;; ede/autoconf-edit.el --- Keymap for autoconf -*- lexical-binding: t; -*- ;; Copyright (C) 1998-2000, 2009-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/ede/config.el b/lisp/cedet/ede/config.el index 19686216cd5..bc1810aa84f 100644 --- a/lisp/cedet/ede/config.el +++ b/lisp/cedet/ede/config.el @@ -1,4 +1,4 @@ -;;; ede/config.el --- Configuration Handler baseclass +;;; ede/config.el --- Configuration Handler baseclass -*- lexical-binding: t; -*- ;; Copyright (C) 2014-2021 Free Software Foundation, Inc. @@ -171,7 +171,7 @@ the directory isn't on the `safe' list, ask to add it to the safe list." (oset config project proj))) config)) -(cl-defmethod ede-config-setup-configuration ((proj ede-project-with-config) config) +(cl-defmethod ede-config-setup-configuration ((_proj ede-project-with-config) _config) "Default configuration setup method." nil) @@ -187,7 +187,7 @@ the directory isn't on the `safe' list, ask to add it to the safe list." (let ((config (ede-config-get-configuration proj t))) (eieio-customize-object config))) -(cl-defmethod ede-customize ((target ede-target-with-config)) +(cl-defmethod ede-customize ((_target ede-target-with-config)) "Customize the EDE TARGET by actually configuring the config object." ;; Nothing unique for the targets, use the project. (ede-customize-project)) @@ -302,14 +302,14 @@ This class brings in method overloads for building.") "Class to mix into a project with configuration for builds. This class brings in method overloads for building.") -(cl-defmethod project-compile-project ((proj ede-project-with-config-build) &optional command) +(cl-defmethod project-compile-project ((proj ede-project-with-config-build) &optional _command) "Compile the entire current project PROJ. Argument COMMAND is the command to use when compiling." (let* ((config (ede-config-get-configuration proj t)) (comp (oref config build-command))) (compile comp))) -(cl-defmethod project-compile-target ((obj ede-target-with-config-build) &optional command) +(cl-defmethod project-compile-target ((_obj ede-target-with-config-build) &optional command) "Compile the current target OBJ. Argument COMMAND is the command to use for compiling the target." (project-compile-project (ede-current-project) command)) diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el index 41f0c682892..652d6476f02 100644 --- a/lisp/cedet/ede/cpp-root.el +++ b/lisp/cedet/ede/cpp-root.el @@ -1,4 +1,4 @@ -;;; ede/cpp-root.el --- A simple way to wrap a C++ project with a single root +;;; ede/cpp-root.el --- A simple way to wrap a C++ project with a single root -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -275,7 +275,7 @@ Each directory needs a project file to control it.") ;; objects is deleted. (cl-defmethod initialize-instance ((this ede-cpp-root-project) - &rest fields) + &rest _fields) "Make sure the :file is fully expanded." ;; Add ourselves to the master list (cl-call-next-method) @@ -310,7 +310,7 @@ Each directory needs a project file to control it.") ;; project, simplifying authoring new single-point projects. (cl-defmethod ede-find-subproject-for-directory ((proj ede-cpp-root-project) - dir) + _dir) "Return PROJ, for handling all subdirs below DIR." proj) @@ -319,7 +319,7 @@ Each directory needs a project file to control it.") ;; Creating new targets on a per directory basis is a good way to keep ;; files organized. See ede-emacs for an example with multiple file ;; types. -(cl-defmethod ede-find-target ((proj ede-cpp-root-project) buffer) +(cl-defmethod ede-find-target ((proj ede-cpp-root-project) _buffer) "Find an EDE target in PROJ for BUFFER. If one doesn't exist, create a new one for this directory." (let* ((targets (oref proj targets)) @@ -451,7 +451,7 @@ This is for project include paths and spp source files." "Get the pre-processor map for project THIS." (ede-preprocessor-map (ede-target-parent this))) -(cl-defmethod project-compile-project ((proj ede-cpp-root-project) &optional command) +(cl-defmethod project-compile-project ((proj ede-cpp-root-project) &optional _command) "Compile the entire current project PROJ. Argument COMMAND is the command to use when compiling." ;; we need to be in the proj root dir for this to work @@ -474,7 +474,7 @@ Argument COMMAND is the command to use for compiling the target." (project-compile-project (oref obj project) command))) -(cl-defmethod project-rescan ((this ede-cpp-root-project)) +(cl-defmethod project-rescan ((_this ede-cpp-root-project)) "Don't rescan this project from the sources." (message "cpp-root has nothing to rescan.")) diff --git a/lisp/cedet/ede/custom.el b/lisp/cedet/ede/custom.el index a128f9e1241..adb1a49cdf7 100644 --- a/lisp/cedet/ede/custom.el +++ b/lisp/cedet/ede/custom.el @@ -1,4 +1,4 @@ -;;; ede/custom.el --- customization of EDE projects. +;;; ede/custom.el --- customization of EDE projects. -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2021 Free Software Foundation, Inc. @@ -97,13 +97,13 @@ OBJ is the target object to customize." "Create a custom-like buffer for sorting targets of current project." (interactive) (let ((proj (ede-current-project)) - (count 1) - current order) + ;; (count 1) + ) ;; current order (switch-to-buffer (get-buffer-create "*EDE sort targets*")) (erase-buffer) (setq ede-object-project proj) (widget-create 'push-button - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (let ((targets (oref ede-object-project targets)) cur newtargets) (while (setq cur (pop ede-project-sort-targets-order)) @@ -115,7 +115,7 @@ OBJ is the target object to customize." " Accept ") (widget-insert " ") (widget-create 'push-button - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (kill-buffer)) " Cancel ") (widget-insert "\n\n") @@ -170,7 +170,9 @@ OBJ is the target object to customize." (widget-insert " ")) (widget-insert (concat " " (number-to-string (1+ count)) ".: " (oref (nth (nth count ede-project-sort-targets-order) - targets) name) "\n")) + targets) + name) + "\n")) (setq count (1+ count)))))) ;;; Customization hooks @@ -195,11 +197,11 @@ OBJ is the target object to customize." ;; These two methods should be implemented by subclasses of ;; project and targets in order to account for user specified ;; changes. -(cl-defmethod eieio-done-customizing ((target ede-target)) +(cl-defmethod eieio-done-customizing ((_target ede-target)) "Call this when a user finishes customizing TARGET." nil) -(cl-defmethod ede-commit-project ((proj ede-project)) +(cl-defmethod ede-commit-project ((_proj ede-project)) "Commit any change to PROJ to its file." nil ) diff --git a/lisp/cedet/ede/detect.el b/lisp/cedet/ede/detect.el index 027d008ea38..c933fc4515e 100644 --- a/lisp/cedet/ede/detect.el +++ b/lisp/cedet/ede/detect.el @@ -1,4 +1,4 @@ -;;; ede/detect.el --- EDE project detection and file associations +;;; ede/detect.el --- EDE project detection and file associations -*- lexical-binding: t; -*- ;; Copyright (C) 2014-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/ede/dired.el b/lisp/cedet/ede/dired.el index 8b9eae0b430..27735176c2a 100644 --- a/lisp/cedet/ede/dired.el +++ b/lisp/cedet/ede/dired.el @@ -35,11 +35,11 @@ (defvar ede-dired-keymap (let ((map (make-sparse-keymap))) - (define-key map ".a" 'ede-dired-add-to-target) - (define-key map ".t" 'ede-new-target) - (define-key map ".s" 'ede-speedbar) - (define-key map ".C" 'ede-compile-project) - (define-key map ".d" 'ede-make-dist) + (define-key map ".a" #'ede-dired-add-to-target) + (define-key map ".t" #'ede-new-target) + (define-key map ".s" #'ede-speedbar) + (define-key map ".C" #'ede-compile-project) + (define-key map ".d" #'ede-make-dist) (easy-menu-define ede-dired-menu map "EDE Dired Minor Mode Menu" diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el index cf5396ad00e..6b7e1595646 100644 --- a/lisp/cedet/ede/files.el +++ b/lisp/cedet/ede/files.el @@ -1,4 +1,4 @@ -;;; ede/files.el --- Associate projects with files and directories. +;;; ede/files.el --- Associate projects with files and directories. -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -33,6 +33,7 @@ ;; till no ede-project-autoload structure matches. ;; +(require 'eieio) (require 'ede) (declare-function ede-locate-file-in-hash "ede/locate") @@ -75,13 +76,13 @@ Allows for one-project-object-for-a-tree type systems." (oref this rootproject)) (cl-defmethod ede-project-root-directory ((this ede-project-placeholder) - &optional file) + &optional _file) "If a project knows its root, return it here. Allows for one-project-object-for-a-tree type systems. Optional FILE is the file to test. It is ignored in preference of the anchor file for the project." - (let ((root (or (ede-project-root this) this))) - (file-name-directory (expand-file-name (oref this file))))) + ;; (let ((root (or (ede-project-root this) this))) + (file-name-directory (expand-file-name (oref this file)))) ;; ) ;; Why INODEs? @@ -141,7 +142,7 @@ Does not check subprojects." (defun ede-directory-get-open-project (dir &optional rootreturn) "Return an already open project that is managing DIR. -Optional ROOTRETURN specifies a symbol to set to the root project. +Optional ROOTRETURN specifies a `gv-ref' to set to the root project. If DIR is the root project, then it is the same." (let* ((inode (ede--inode-for-dir dir)) (ft (file-name-as-directory (expand-file-name dir))) @@ -153,7 +154,8 @@ If DIR is the root project, then it is the same." ;; Default answer is this project (setq ans proj) ;; Save. - (when rootreturn (set rootreturn proj)) + (when rootreturn (if (symbolp rootreturn) (set rootreturn proj) + (setf (gv-deref rootreturn) proj))) ;; Find subprojects. (when (and proj (if ede--disable-inode (not (string= ft (expand-file-name @@ -272,7 +274,7 @@ Do this whenever a new project is created, as opposed to loaded." (remhash (file-name-as-directory dir) ede-project-directory-hash) ;; Look for all subdirs of D, and remove them. (let ((match (concat "^" (regexp-quote dir)))) - (maphash (lambda (K O) + (maphash (lambda (K _O) (when (string-match match K) (remhash K ede-project-directory-hash))) ede-project-directory-hash))) @@ -363,7 +365,7 @@ If DIR is not part of a project, return nil." (t nil)))) -(defalias 'ede-toplevel-project-or-nil 'ede-toplevel-project) +(defalias 'ede-toplevel-project-or-nil #'ede-toplevel-project) ;;; DIRECTORY CONVERSION STUFF ;; @@ -469,15 +471,15 @@ is returned." ans)) -(cl-defmethod ede-expand-filename-impl ((this ede-project) filename &optional force) +(cl-defmethod ede-expand-filename-impl ((this ede-project) filename &optional _force) "Return a fully qualified file name based on project THIS. FILENAME should be just a filename which occurs in a directory controlled by this project. Optional argument FORCE forces the default filename to be provided even if it doesn't exist." (let ((loc (ede-get-locator-object this)) - (path (ede-project-root-directory this)) - (proj (oref this subproj)) + ;; (path (ede-project-root-directory this)) + ;; (proj (oref this subproj)) (found nil)) ;; find it Locally. (setq found (or (ede-expand-filename-local this filename) diff --git a/lisp/cedet/ede/generic.el b/lisp/cedet/ede/generic.el index 3d1e1c5818e..b3b59b5dc35 100644 --- a/lisp/cedet/ede/generic.el +++ b/lisp/cedet/ede/generic.el @@ -1,4 +1,4 @@ -;;; ede/generic.el --- Base Support for generic build systems +;;; ede/generic.el --- Base Support for generic build systems -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2021 Free Software Foundation, Inc. @@ -93,7 +93,7 @@ ) "User Configuration object for a generic project.") -(defun ede-generic-load (dir &optional rootproj) +(defun ede-generic-load (dir &optional _rootproj) "Return a Generic Project object if there is a match. Return nil if there isn't one. Argument DIR is the directory it is created for. @@ -149,7 +149,7 @@ The class allocated value is replace by different sub classes.") :abstract t) (cl-defmethod initialize-instance ((this ede-generic-project) - &rest fields) + &rest _fields) "Make sure the targets slot is bound." (cl-call-next-method) (unless (slot-boundp this 'targets) @@ -161,7 +161,7 @@ The class allocated value is replace by different sub classes.") this) (cl-defmethod ede-find-subproject-for-directory ((proj ede-generic-project) - dir) + _dir) "Return PROJ, for handling all subdirs below DIR." proj) @@ -324,7 +324,7 @@ CLASS is the EIEIO class that is used to track this project. It should subclass ) "Generic Project for makefiles.") -(cl-defmethod ede-generic-setup-configuration ((proj ede-generic-makefile-project) config) +(cl-defmethod ede-generic-setup-configuration ((_proj ede-generic-makefile-project) config) "Setup a configuration for Make." (oset config build-command "make -k") (oset config debug-command "gdb ") @@ -337,7 +337,7 @@ CLASS is the EIEIO class that is used to track this project. It should subclass ) "Generic Project for scons.") -(cl-defmethod ede-generic-setup-configuration ((proj ede-generic-scons-project) config) +(cl-defmethod ede-generic-setup-configuration ((_proj ede-generic-scons-project) config) "Setup a configuration for SCONS." (oset config build-command "scons") (oset config debug-command "gdb ") @@ -350,7 +350,7 @@ CLASS is the EIEIO class that is used to track this project. It should subclass ) "Generic Project for cmake.") -(cl-defmethod ede-generic-setup-configuration ((proj ede-generic-cmake-project) config) +(cl-defmethod ede-generic-setup-configuration ((_proj ede-generic-cmake-project) config) "Setup a configuration for CMake." (oset config build-command "cmake") (oset config debug-command "gdb ") @@ -361,9 +361,9 @@ CLASS is the EIEIO class that is used to track this project. It should subclass () "Generic project found via Version Control files.") -(cl-defmethod ede-generic-setup-configuration ((proj ede-generic-vc-project) config) +(cl-defmethod ede-generic-setup-configuration ((_proj ede-generic-vc-project) _config) "Setup a configuration for projects identified by revision control." - ) + nil) (provide 'ede/generic) diff --git a/lisp/cedet/ede/linux.el b/lisp/cedet/ede/linux.el index 7a1c4c9e262..4b5530d6aca 100644 --- a/lisp/cedet/ede/linux.el +++ b/lisp/cedet/ede/linux.el @@ -1,4 +1,4 @@ -;;; ede/linux.el --- Special project for Linux +;;; ede/linux.el --- Special project for Linux -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -47,26 +47,22 @@ (defcustom project-linux-build-directory-default 'ask "Build directory." :version "24.4" - :group 'project-linux :type '(choice (const :tag "Same as source directory" same) (const :tag "Ask the user" ask))) (defcustom project-linux-architecture-default 'ask "Target architecture to assume when not auto-detected." :version "24.4" - :group 'project-linux :type '(choice (string :tag "Architecture name") (const :tag "Ask the user" ask))) (defcustom project-linux-compile-target-command (concat ede-make-command " -k -C %s SUBDIRS=%s") "Default command used to compile a target." - :group 'project-linux :type 'string) (defcustom project-linux-compile-project-command (concat ede-make-command " -k -C %s") "Default command used to compile a project." - :group 'project-linux :type 'string) (defun ede-linux-version (dir) diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el index e6a89533cca..016092cd8bf 100644 --- a/lisp/cedet/ede/locate.el +++ b/lisp/cedet/ede/locate.el @@ -1,4 +1,4 @@ -;;; ede/locate.el --- Locate support +;;; ede/locate.el --- Locate support -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -110,7 +110,7 @@ based on `ede-locate-setup-options'." ) "Baseclass for LOCATE feature in EDE.") -(cl-defmethod initialize-instance ((loc ede-locate-base) &rest fields) +(cl-defmethod initialize-instance ((loc ede-locate-base) &rest _fields) "Make sure we have a hash table." ;; Basic setup. (cl-call-next-method) @@ -118,8 +118,8 @@ based on `ede-locate-setup-options'." (ede-locate-flush-hash loc) ) -(cl-defmethod ede-locate-ok-in-project ((loc (subclass ede-locate-base)) - root) +(cl-defmethod ede-locate-ok-in-project ((_loc (subclass ede-locate-base)) + _root) "Is it ok to use this project type under ROOT." t) @@ -149,17 +149,15 @@ that created this EDE locate object." (oset loc lastanswer ans) ans)) -(cl-defmethod ede-locate-file-in-project-impl ((loc ede-locate-base) - filesubstring - ) +(cl-defmethod ede-locate-file-in-project-impl ((_loc ede-locate-base) + _filesubstring) "Locate with LOC occurrences of FILESUBSTRING. Searches are done under the current root of the EDE project that created this EDE locate object." - nil - ) + nil) (cl-defmethod ede-locate-create/update-root-database - ((loc (subclass ede-locate-base)) root) + ((loc (subclass ede-locate-base)) _root) "Create or update the database for the current project. You cannot create projects for the baseclass." (error "Cannot create/update a database of type %S" @@ -177,8 +175,8 @@ You cannot create projects for the baseclass." Configure the Emacs `locate-program' variable to also configure the use of EDE locate.") -(cl-defmethod ede-locate-ok-in-project ((loc (subclass ede-locate-locate)) - root) +(cl-defmethod ede-locate-ok-in-project ((_loc (subclass ede-locate-locate)) + _root) "Is it ok to use this project type under ROOT." (or (featurep 'locate) (locate-library "locate")) ) @@ -198,7 +196,7 @@ that created this EDE locate object." (with-current-buffer b (setq default-directory cd) (erase-buffer)) - (apply 'call-process locate-command + (apply #'call-process locate-command nil b nil searchstr nil) (with-current-buffer b @@ -221,7 +219,7 @@ Configure EDE's use of GNU Global through the cedet-global.el variable `cedet-global-command'.") (cl-defmethod initialize-instance ((loc ede-locate-global) - &rest slots) + &rest _slots) "Make sure that we can use GNU Global." (require 'cedet-global) ;; Get ourselves initialized. @@ -235,8 +233,8 @@ variable `cedet-global-command'.") (oref loc root)))) ) -(cl-defmethod ede-locate-ok-in-project ((loc (subclass ede-locate-global)) - root) +(cl-defmethod ede-locate-ok-in-project ((_loc (subclass ede-locate-global)) + root) "Is it ok to use this project type under ROOT." (require 'cedet-global) (cedet-gnu-global-version-check) @@ -252,7 +250,7 @@ variable `cedet-global-command'.") (cedet-gnu-global-expand-filename filesubstring))) (cl-defmethod ede-locate-create/update-root-database - ((loc (subclass ede-locate-global)) root) + ((_loc (subclass ede-locate-global)) root) "Create or update the GNU Global database for the current project." (cedet-gnu-global-create/update-database root)) @@ -271,7 +269,7 @@ Configure EDE's use of IDUtils through the cedet-idutils.el file name searching variable `cedet-idutils-file-command'.") (cl-defmethod initialize-instance ((loc ede-locate-idutils) - &rest slots) + &rest _slots) "Make sure that we can use IDUtils." ;; Get ourselves initialized. (cl-call-next-method) @@ -283,8 +281,8 @@ file name searching variable `cedet-idutils-file-command'.") (oref loc root))) ) -(cl-defmethod ede-locate-ok-in-project ((loc (subclass ede-locate-idutils)) - root) +(cl-defmethod ede-locate-ok-in-project ((_loc (subclass ede-locate-idutils)) + root) "Is it ok to use this project type under ROOT." (require 'cedet-idutils) (cedet-idutils-version-check) @@ -301,7 +299,7 @@ that created this EDE locate object." (cedet-idutils-expand-filename filesubstring))) (cl-defmethod ede-locate-create/update-root-database - ((loc (subclass ede-locate-idutils)) root) + ((_loc (subclass ede-locate-idutils)) root) "Create or update the GNU Global database for the current project." (cedet-idutils-create/update-database root)) @@ -320,7 +318,7 @@ Configure EDE's use of Cscope through the cedet-cscope.el file name searching variable `cedet-cscope-file-command'.") (cl-defmethod initialize-instance ((loc ede-locate-cscope) - &rest slots) + &rest _slots) "Make sure that we can use Cscope." ;; Get ourselves initialized. (cl-call-next-method) @@ -332,8 +330,8 @@ file name searching variable `cedet-cscope-file-command'.") (oref loc root))) ) -(cl-defmethod ede-locate-ok-in-project ((loc (subclass ede-locate-cscope)) - root) +(cl-defmethod ede-locate-ok-in-project ((_loc (subclass ede-locate-cscope)) + root) "Is it ok to use this project type under ROOT." (require 'cedet-cscope) (cedet-cscope-version-check) @@ -350,7 +348,7 @@ that created this EDE locate object." (cedet-cscope-expand-filename filesubstring))) (cl-defmethod ede-locate-create/update-root-database - ((loc (subclass ede-locate-cscope)) root) + ((_loc (subclass ede-locate-cscope)) root) "Create or update the Cscope database for the current project." (require 'cedet-cscope) (cedet-cscope-create/update-database root)) diff --git a/lisp/cedet/ede/makefile-edit.el b/lisp/cedet/ede/makefile-edit.el index 43655a5d1e3..d6965945494 100644 --- a/lisp/cedet/ede/makefile-edit.el +++ b/lisp/cedet/ede/makefile-edit.el @@ -1,4 +1,4 @@ -;;; makefile-edit.el --- Makefile editing/scanning commands. +;;; makefile-edit.el --- Makefile editing/scanning commands. -*- lexical-binding: t; -*- ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/ede/pconf.el b/lisp/cedet/ede/pconf.el index 5bed32ff058..106ba2cf5b9 100644 --- a/lisp/cedet/ede/pconf.el +++ b/lisp/cedet/ede/pconf.el @@ -1,4 +1,4 @@ -;;; ede/pconf.el --- configure.ac maintenance for EDE +;;; ede/pconf.el --- configure.ac maintenance for EDE -*- lexical-binding: t; -*- ;;; Copyright (C) 1998-2000, 2005, 2008-2021 Free Software Foundation, ;;; Inc. @@ -67,7 +67,7 @@ don't do it. A value of nil means to just do it.") ;;(td (file-name-directory (ede-proj-configure-file this))) (targs (oref this targets)) (postcmd "") - (add-missing nil)) + ) ;; (add-missing nil) ;; First, make sure we have a file. (if (not (file-exists-p (ede-proj-configure-file this))) (autoconf-new-program b (oref this name) "Project.ede")) @@ -97,7 +97,7 @@ don't do it. A value of nil means to just do it.") (ede-map-targets sp #'ede-proj-flush-autoconf))) (ede-map-all-subprojects this - (lambda (sp) + (lambda (_sp) (ede-map-targets this #'ede-proj-tweak-autoconf))) ;; Now save (save-buffer) @@ -109,14 +109,15 @@ don't do it. A value of nil means to just do it.") (ede-proj-configure-test-required-file this "README") (ede-proj-configure-test-required-file this "ChangeLog") ;; Let specific targets get missing files. - (mapc 'ede-proj-configure-create-missing targs) + (mapc #'ede-proj-configure-create-missing targs) ;; Verify that we have a make system. (if (or (not (ede-expand-filename (ede-toplevel this) "Makefile")) ;; Now is this one of our old Makefiles? (with-current-buffer (find-file-noselect (ede-expand-filename (ede-toplevel this) - "Makefile" t) t) + "Makefile" t) + t) (goto-char (point-min)) ;; Here is the unique piece for our makefiles. (re-search-forward "For use with: make" nil t))) @@ -166,11 +167,11 @@ don't do it. A value of nil means to just do it.") "Tweak the configure file (current buffer) to accommodate THIS." ;; Check the compilers belonging to THIS, and call the autoconf ;; setup for those compilers. - (mapc 'ede-proj-tweak-autoconf (ede-proj-compilers this)) - (mapc 'ede-proj-tweak-autoconf (ede-proj-linkers this)) + (mapc #'ede-proj-tweak-autoconf (ede-proj-compilers this)) + (mapc #'ede-proj-tweak-autoconf (ede-proj-linkers this)) ) -(cl-defmethod ede-proj-flush-autoconf ((this ede-proj-target)) +(cl-defmethod ede-proj-flush-autoconf ((_this ede-proj-target)) "Flush the configure file (current buffer) to accommodate THIS. By flushing, remove any cruft that may be in the file. Subsequent calls to `ede-proj-tweak-autoconf' can restore items removed by flush." @@ -178,13 +179,13 @@ calls to `ede-proj-tweak-autoconf' can restore items removed by flush." ;; @TODO - No-one calls this ??? -(cl-defmethod ede-proj-configure-add-missing ((this ede-proj-target)) +(cl-defmethod ede-proj-configure-add-missing ((_this ede-proj-target)) "Query if any files needed by THIS provided by automake are missing. Results in --add-missing being passed to automake." nil) ;; @TODO - No-one implements this yet. -(cl-defmethod ede-proj-configure-create-missing ((this ede-proj-target)) +(cl-defmethod ede-proj-configure-create-missing ((_this ede-proj-target)) "Add any missing files for THIS by creating them." nil) diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el index 47bb0c61eb4..ceb44031f6a 100644 --- a/lisp/cedet/ede/pmake.el +++ b/lisp/cedet/ede/pmake.el @@ -46,6 +46,7 @@ (require 'ede/proj) (require 'ede/proj-obj) (require 'ede/proj-comp) +(require 'seq) (declare-function ede-srecode-setup "ede/srecode") (declare-function ede-srecode-insert "ede/srecode") @@ -111,13 +112,13 @@ MFILENAME is the makefile to generate." (let* ((targ (if isdist (oref this targets) mt)) (sp (oref this subproj)) - (df (apply 'append + (df (apply #'append (mapcar (lambda (tg) (ede-proj-makefile-dependency-files tg)) targ)))) ;; Distribution variables (ede-compiler-begin-unique - (mapc 'ede-proj-makefile-insert-variables targ)) + (mapc #'ede-proj-makefile-insert-variables targ)) ;; Only add the distribution stuff in when depth != 0 (let ((top (ede-toplevel this)) (tmp this) @@ -153,7 +154,8 @@ MFILENAME is the makefile to generate." (concat ".deps/" (file-name-nondirectory (file-name-sans-extension - f)) ".P")) + f)) + ".P")) df " ")))) ;; ;; Insert ALL Rule @@ -188,11 +190,11 @@ MFILENAME is the makefile to generate." ;; (ede-compiler-begin-unique (ede-proj-makefile-insert-rules this) - (mapc 'ede-proj-makefile-insert-rules targ)) + (mapc #'ede-proj-makefile-insert-rules targ)) ;; ;; phony targets for sub projects ;; - (mapc 'ede-proj-makefile-insert-subproj-rules sp) + (mapc #'ede-proj-makefile-insert-subproj-rules sp) ;; ;; Distribution rules such as CLEAN and DIST ;; @@ -210,11 +212,11 @@ MFILENAME is the makefile to generate." ;; Distribution variables (let ((targ (if isdist (oref this targets) mt))) (ede-compiler-begin-unique - (mapc 'ede-proj-makefile-insert-automake-pre-variables targ)) + (mapc #'ede-proj-makefile-insert-automake-pre-variables targ)) (ede-compiler-begin-unique - (mapc 'ede-proj-makefile-insert-source-variables targ)) + (mapc #'ede-proj-makefile-insert-source-variables targ)) (ede-compiler-begin-unique - (mapc 'ede-proj-makefile-insert-automake-post-variables targ)) + (mapc #'ede-proj-makefile-insert-automake-post-variables targ)) (ede-compiler-begin-unique (ede-proj-makefile-insert-user-rules this)) (insert "\n# End of Makefile.am\n") @@ -464,9 +466,9 @@ sources variable." "Return a list of patterns that are considered garbage to THIS. These are removed with make clean." (let ((mc (ede-map-targets - this (lambda (c) (ede-proj-makefile-garbage-patterns c)))) + this #'ede-proj-makefile-garbage-patterns)) (uniq nil)) - (setq mc (sort (apply 'append mc) 'string<)) + (setq mc (sort (apply #'append mc) #'string<)) ;; Filter out duplicates from the targets. (while mc (if (and (car uniq) (string= (car uniq) (car mc))) @@ -502,13 +504,13 @@ These are removed with make clean." (cl-defmethod ede-proj-makefile-insert-rules ((this ede-proj-project)) "Insert rules needed by THIS target." - (mapc 'ede-proj-makefile-insert-rules (oref this inference-rules)) + (mapc #'ede-proj-makefile-insert-rules (oref this inference-rules)) ) (cl-defmethod ede-proj-makefile-insert-dist-dependencies ((this ede-proj-project)) "Insert any symbols that the DIST rule should depend on. Argument THIS is the project that should insert stuff." - (mapc 'ede-proj-makefile-insert-dist-dependencies (oref this targets)) + (mapc #'ede-proj-makefile-insert-dist-dependencies (oref this targets)) ) (cl-defmethod ede-proj-makefile-insert-dist-dependencies ((_this ede-proj-target)) @@ -608,10 +610,10 @@ Argument THIS is the target that should insert stuff." (cl-defmethod ede-proj-makefile-insert-rules ((this ede-proj-target-makefile)) "Insert rules needed by THIS target." - (mapc 'ede-proj-makefile-insert-rules (oref this rules)) + (mapc #'ede-proj-makefile-insert-rules (oref this rules)) (let ((c (ede-proj-compilers this))) (when c - (mapc 'ede-proj-makefile-insert-rules c) + (mapc #'ede-proj-makefile-insert-rules c) (if (oref this phony) (insert ".PHONY: " (ede-proj-makefile-target-name this) "\n")) (insert (ede-proj-makefile-target-name this) ": " @@ -622,9 +624,9 @@ Argument THIS is the target that should insert stuff." (cl-defmethod ede-proj-makefile-insert-commands ((this ede-proj-target-makefile)) "Insert the commands needed by target THIS. For targets, insert the commands needed by the chosen compiler." - (mapc 'ede-proj-makefile-insert-commands (ede-proj-compilers this)) + (mapc #'ede-proj-makefile-insert-commands (ede-proj-compilers this)) (when (object-assoc t :uselinker (ede-proj-compilers this)) - (mapc 'ede-proj-makefile-insert-commands (ede-proj-linkers this)))) + (mapc #'ede-proj-makefile-insert-commands (ede-proj-linkers this)))) (cl-defmethod ede-proj-makefile-insert-user-rules ((this ede-proj-project)) @@ -632,11 +634,11 @@ For targets, insert the commands needed by the chosen compiler." This is different from `ede-proj-makefile-insert-rules' in that this function won't create the building rules which are auto created with automake." - (mapc 'ede-proj-makefile-insert-user-rules (oref this inference-rules))) + (mapc #'ede-proj-makefile-insert-user-rules (oref this inference-rules))) (cl-defmethod ede-proj-makefile-insert-user-rules ((this ede-proj-target)) "Insert user specified rules needed by THIS target." - (mapc 'ede-proj-makefile-insert-rules (oref this rules))) + (mapc #'ede-proj-makefile-insert-rules (oref this rules))) (cl-defmethod ede-proj-makefile-dependencies ((this ede-proj-target-makefile)) "Return a string representing the dependencies for THIS. @@ -644,7 +646,7 @@ Some compilers only use the first element in the dependencies, others have a list of intermediates (object files), and others don't care. This allows customization of how these elements appear." (let* ((c (ede-proj-compilers this)) - (io (eval (cons 'or (mapcar 'ede-compiler-intermediate-objects-p c)))) + (io (seq-some #'ede-compiler-intermediate-objects-p c)) (out nil)) (if io (progn @@ -652,7 +654,8 @@ This allows customization of how these elements appear." (setq out (concat out "$(" (ede-compiler-intermediate-object-variable (car c) - (ede-proj-makefile-target-name this)) ")") + (ede-proj-makefile-target-name this)) + ")") c (cdr c))) out) (let ((sv (ede-proj-makefile-sourcevar this)) diff --git a/lisp/cedet/ede/proj-comp.el b/lisp/cedet/ede/proj-comp.el index 397354ad9c0..1d6a4eb47cd 100644 --- a/lisp/cedet/ede/proj-comp.el +++ b/lisp/cedet/ede/proj-comp.el @@ -309,7 +309,7 @@ Not all compilers do this." (cl-defmethod ede-proj-makefile-insert-rules ((this ede-compilation-program)) "Insert rules needed for THIS compiler object." (ede-compiler-only-once this - (mapc 'ede-proj-makefile-insert-rules (oref this rules)))) + (mapc #'ede-proj-makefile-insert-rules (oref this rules)))) (cl-defmethod ede-proj-makefile-insert-rules ((this ede-makefile-rule)) "Insert rules needed for THIS rule object." diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el index 9ec96945c10..7e0f5a89346 100644 --- a/lisp/cedet/ede/proj-elisp.el +++ b/lisp/cedet/ede/proj-elisp.el @@ -1,4 +1,4 @@ -;;; ede-proj-elisp.el --- EDE Generic Project Emacs Lisp support +;;; ede-proj-elisp.el --- EDE Generic Project Emacs Lisp support -*- lexical-binding: t; -*- ;; Copyright (C) 1998-2005, 2007-2021 Free Software Foundation, Inc. @@ -64,7 +64,7 @@ This inserts the PRELOADS target-local variable." (when preloads (insert (format "%s: PRELOADS=%s\n" (oref this name) - (mapconcat 'identity preloads " "))))) + (mapconcat #'identity preloads " "))))) (insert "\n")) (cl-defmethod ede-proj-makefile-dependencies ((this ede-proj-target-elisp)) @@ -152,7 +152,7 @@ Bonus: Return a cons cell: (COMPILED . UPTODATE)." (utd 0)) (mapc (lambda (src) (let* ((fsrc (expand-file-name src dir)) - (elc (concat (file-name-sans-extension fsrc) ".elc"))) + ) ;; (elc (concat (file-name-sans-extension fsrc) ".elc")) (with-no-warnings (if (eq (byte-recompile-file fsrc nil 0) t) (setq comp (1+ comp)) @@ -169,7 +169,7 @@ is found, such as a `-version' variable, or the standard header." (if (and (slot-boundp this 'versionsource) (oref this versionsource)) (let ((vs (oref this versionsource)) - (match nil)) + ) ;; (match nil) (while vs (with-current-buffer (find-file-noselect (ede-expand-filename this (car vs))) @@ -177,7 +177,7 @@ is found, such as a `-version' variable, or the standard header." (let ((case-fold-search t)) (if (re-search-forward "-version\\s-+\"\\([^\"]+\\)\"" nil t) (progn - (setq match t) + ;; (setq match t) (delete-region (match-beginning 1) (match-end 1)) (goto-char (match-beginning 1)) @@ -331,27 +331,27 @@ Lays claim to all .elc files that match .el files in this target." If the `compiler' slot is empty, get the car of the compilers list." (let ((comp (oref obj compiler))) (if comp - (if (listp comp) - (setq comp (mapcar 'symbol-value comp)) - (setq comp (list (symbol-value comp)))) + (setq comp (if (listp comp) + (mapcar #'symbol-value comp) + (list (symbol-value comp)))) ;; Get the first element from our list of compilers. - (let ((avail (mapcar 'symbol-value (oref obj availablecompilers)))) + (let ((avail (mapcar #'symbol-value (oref obj availablecompilers)))) (setq comp (list (car avail))))) comp)) -(cl-defmethod ede-proj-makefile-insert-source-variables ((this ede-proj-target-elisp-autoloads) - &optional - moresource) +(cl-defmethod ede-proj-makefile-insert-source-variables ((_this ede-proj-target-elisp-autoloads) + &optional + _moresource) "Insert the source variables needed by THIS. Optional argument MORESOURCE is a list of additional sources to add to the sources variable." nil) -(cl-defmethod ede-proj-makefile-sourcevar ((this ede-proj-target-elisp-autoloads)) +(cl-defmethod ede-proj-makefile-sourcevar ((_this ede-proj-target-elisp-autoloads)) "Return the variable name for THIS's sources." nil) ; "LOADDEFS") -(cl-defmethod ede-proj-makefile-dependencies ((this ede-proj-target-elisp-autoloads)) +(cl-defmethod ede-proj-makefile-dependencies ((_this ede-proj-target-elisp-autoloads)) "Return a string representing the dependencies for THIS. Always return an empty string for an autoloads generator." "") @@ -361,21 +361,22 @@ Always return an empty string for an autoloads generator." (ede-pmake-insert-variable-shared "LOADDEFS" (insert (oref this autoload-file))) (ede-pmake-insert-variable-shared "LOADDIRS" - (insert (mapconcat 'identity + (insert (mapconcat #'identity (or (oref this autoload-dirs) '(".")) " "))) ) (cl-defmethod project-compile-target ((obj ede-proj-target-elisp-autoloads)) "Create or update the autoload target." - (require 'cedet-autogen) + (require 'cedet-autogen) ;FIXME: We don't have this file! + (declare-function cedet-update-autoloads "cedet-autogen") (let ((default-directory (ede-expand-filename obj "."))) - (apply 'cedet-update-autoloads + (apply #'cedet-update-autoloads (oref obj autoload-file) (oref obj autoload-dirs)) )) -(cl-defmethod ede-update-version-in-source ((this ede-proj-target-elisp-autoloads) version) +(cl-defmethod ede-update-version-in-source ((_this ede-proj-target-elisp-autoloads) _version) "In a Lisp file, updated a version string for THIS to VERSION. There are standards in Elisp files specifying how the version string is found, such as a `-version' variable, or the standard header." @@ -397,11 +398,11 @@ Argument THIS is the target which needs to insert an info file." (insert " " (oref this autoload-file)) ) -(cl-defmethod ede-proj-tweak-autoconf ((this ede-proj-target-elisp-autoloads)) +(cl-defmethod ede-proj-tweak-autoconf ((_this ede-proj-target-elisp-autoloads)) "Tweak the configure file (current buffer) to accommodate THIS." (error "Autoloads not supported in autoconf yet")) -(cl-defmethod ede-proj-flush-autoconf ((this ede-proj-target-elisp-autoloads)) +(cl-defmethod ede-proj-flush-autoconf ((_this ede-proj-target-elisp-autoloads)) "Flush the configure file (current buffer) to accommodate THIS." nil) diff --git a/lisp/cedet/ede/proj-info.el b/lisp/cedet/ede/proj-info.el index 3d437016e93..11e0f302e2b 100644 --- a/lisp/cedet/ede/proj-info.el +++ b/lisp/cedet/ede/proj-info.el @@ -1,4 +1,4 @@ -;;; ede-proj-info.el --- EDE Generic Project texinfo support +;;; ede-proj-info.el --- EDE Generic Project texinfo support -*- lexical-binding: t; -*- ;;; Copyright (C) 1998-2001, 2004, 2007-2021 Free Software Foundation, ;;; Inc. @@ -70,7 +70,7 @@ All other sources should be included independently.")) ;;; Makefile generation ;; (cl-defmethod ede-proj-configure-add-missing - ((this ede-proj-target-makefile-info)) + ((_this ede-proj-target-makefile-info)) "Query if any files needed by THIS provided by automake are missing. Results in --add-missing being passed to automake." (not (ede-expand-filename (ede-toplevel) "texinfo.tex"))) @@ -97,7 +97,7 @@ when working in Automake mode." (insert menu)) ;; Now insert the rest of the source elsewhere (ede-pmake-insert-variable-shared sv - (insert (mapconcat 'identity src " "))) + (insert (mapconcat #'identity src " "))) (if moresource (error "Texinfo files should not have moresource"))))) diff --git a/lisp/cedet/ede/proj-obj.el b/lisp/cedet/ede/proj-obj.el index 3aa4497f932..72d09167ab8 100644 --- a/lisp/cedet/ede/proj-obj.el +++ b/lisp/cedet/ede/proj-obj.el @@ -1,4 +1,4 @@ -;;; ede/proj-obj.el --- EDE Generic Project Object code generation support +;;; ede/proj-obj.el --- EDE Generic Project Object code generation support -*- lexical-binding: t; -*- ;;; Copyright (C) 1998-2000, 2005, 2008-2021 Free Software Foundation, ;;; Inc. @@ -282,15 +282,15 @@ Argument THIS is the target to get sources from." (append (oref this source) (oref this auxsource))) (cl-defmethod ede-proj-makefile-insert-variables ((this ede-proj-target-makefile-objectcode) - &optional moresource) + &optional _moresource) "Insert variables needed by target THIS. Optional argument MORESOURCE is not used." (let ((ede-proj-objectcode-dodependencies (oref (ede-target-parent this) automatic-dependencies))) (cl-call-next-method))) -(cl-defmethod ede-buffer-header-file((this ede-proj-target-makefile-objectcode) - buffer) +(cl-defmethod ede-buffer-header-file ((this ede-proj-target-makefile-objectcode) + _buffer) "There are no default header files." (or (cl-call-next-method) ;; Ok, nothing obvious. Try looking in ourselves. diff --git a/lisp/cedet/ede/proj-prog.el b/lisp/cedet/ede/proj-prog.el index 3817cd7d40e..87b2ff7a551 100644 --- a/lisp/cedet/ede/proj-prog.el +++ b/lisp/cedet/ede/proj-prog.el @@ -1,4 +1,4 @@ -;;; ede-proj-prog.el --- EDE Generic Project program support +;;; ede-proj-prog.el --- EDE Generic Project program support -*- lexical-binding: t; -*- ;; Copyright (C) 1998-2001, 2005, 2008-2021 Free Software Foundation, ;; Inc. @@ -90,11 +90,11 @@ Note: Currently only used for Automake projects." (cl-defmethod ede-proj-makefile-insert-variables ((this ede-proj-target-makefile-program)) "Insert variables needed by the compiler THIS." (cl-call-next-method) - (let ((lf (mapconcat 'identity (oref this ldflags) " "))) + (let ((lf (mapconcat #'identity (oref this ldflags) " "))) (with-slots (ldlibs) this (if ldlibs (setq lf - (concat lf " -l" (mapconcat 'identity ldlibs " -l"))))) + (concat lf " -l" (mapconcat #'identity ldlibs " -l"))))) ;; LDFLAGS as needed. (when (and lf (not (string= "" lf))) (ede-pmake-insert-variable-once "LDDEPS" (insert lf))))) diff --git a/lisp/cedet/ede/proj-shared.el b/lisp/cedet/ede/proj-shared.el index 130d7b897aa..8688d15174f 100644 --- a/lisp/cedet/ede/proj-shared.el +++ b/lisp/cedet/ede/proj-shared.el @@ -1,4 +1,4 @@ -;;; ede-proj-shared.el --- EDE Generic Project shared library support +;;; ede-proj-shared.el --- EDE Generic Project shared library support -*- lexical-binding: t; -*- ;;; Copyright (C) 1998-2000, 2009-2021 Free Software Foundation, Inc. @@ -170,7 +170,7 @@ Use ldlibs to add addition libraries.") ) (cl-defmethod ede-proj-configure-add-missing - ((this ede-proj-target-makefile-shared-object)) + ((_this ede-proj-target-makefile-shared-object)) "Query if any files needed by THIS provided by automake are missing. Results in --add-missing being passed to automake." (not (and (ede-expand-filename (ede-toplevel) "ltconfig") @@ -185,7 +185,7 @@ Makefile.am generator, so use it to add this important bin program." (insert (concat "lib" (ede-name this) ".la")))) (cl-defmethod ede-proj-makefile-insert-automake-post-variables - ((this ede-proj-target-makefile-shared-object)) + ((_this ede-proj-target-makefile-shared-object)) "Insert bin_PROGRAMS variables needed by target THIS. We need to override -program which has an LDADD element." nil) diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el index 4af8b4104f5..6ff763016ef 100644 --- a/lisp/cedet/ede/proj.el +++ b/lisp/cedet/ede/proj.el @@ -1,4 +1,4 @@ -;;; ede/proj.el --- EDE Generic Project file driver +;;; ede/proj.el --- EDE Generic Project file driver -*- lexical-binding: t; -*- ;; Copyright (C) 1998-2003, 2007-2021 Free Software Foundation, Inc. @@ -339,7 +339,7 @@ Argument PROJ is the project to save." (cl-call-next-method) (ede-proj-save proj)) -(cl-defmethod eieio-done-customizing ((target ede-proj-target)) +(cl-defmethod eieio-done-customizing ((_target ede-proj-target)) "Call this when a user finishes customizing this object. Argument TARGET is the project we are completing customization on." (cl-call-next-method) @@ -462,7 +462,7 @@ FILE must be massaged by `ede-convert-path'." (object-remove-from-list target 'auxsource (ede-convert-path target file)) (ede-proj-save)) -(cl-defmethod project-update-version ((this ede-proj-project)) +(cl-defmethod project-update-version ((_this ede-proj-project)) "The :version of project THIS has changed." (ede-proj-save)) @@ -486,7 +486,7 @@ FILE must be massaged by `ede-convert-path'." (concat (oref this name) "-" (oref this version) ".tar.gz") )) -(cl-defmethod project-compile-project ((proj ede-proj-project) &optional command) +(cl-defmethod project-compile-project ((proj ede-proj-project) &optional _command) "Compile the entire current project PROJ. Argument COMMAND is the command to use when compiling." (let ((pm (ede-proj-dist-makefile proj)) @@ -499,13 +499,13 @@ Argument COMMAND is the command to use when compiling." ;;; Target type specific compilations/debug ;; -(cl-defmethod project-compile-target ((obj ede-proj-target) &optional command) +(cl-defmethod project-compile-target ((_obj ede-proj-target) &optional command) "Compile the current target OBJ. Argument COMMAND is the command to use for compiling the target." (project-compile-project (ede-current-project) command)) (cl-defmethod project-compile-target ((obj ede-proj-target-makefile) - &optional command) + &optional _command) "Compile the current target program OBJ. Optional argument COMMAND is the s the alternate command to use." (ede-proj-setup-buildenvironment (ede-current-project)) @@ -545,11 +545,11 @@ Converts all symbols into the objects to be used." (if comp ;; Now that we have a pre-set compilers to use, convert tye symbols ;; into objects for ease of use - (if (listp comp) - (setq comp (mapcar 'symbol-value comp)) - (setq comp (list (symbol-value comp)))) + (setq comp (if (listp comp) + (mapcar #'symbol-value comp) + (list (symbol-value comp)))) (let* ((acomp (oref obj availablecompilers)) - (avail (mapcar 'symbol-value acomp)) + (avail (mapcar #'symbol-value acomp)) (st (oref obj sourcetype)) (sources (oref obj source))) ;; COMP is not specified, so generate a list from the available @@ -585,7 +585,7 @@ Converts all symbols into the objects to be used." (setq link (list (symbol-value link))) (error ":linker is not a symbol. Howd you do that?")) (let* ((alink (oref obj availablelinkers)) - (avail (mapcar 'symbol-value alink)) + (avail (mapcar #'symbol-value alink)) (st (oref obj sourcetype)) (sources (oref obj source))) ;; LINKER is not specified, so generate a list from the available diff --git a/lisp/cedet/ede/shell.el b/lisp/cedet/ede/shell.el index ba36fccd0ba..371b04f9d29 100644 --- a/lisp/cedet/ede/shell.el +++ b/lisp/cedet/ede/shell.el @@ -1,4 +1,4 @@ -;;; ede/shell.el --- A shell controlled by EDE. +;;; ede/shell.el --- A shell controlled by EDE. -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. ;; diff --git a/lisp/cedet/ede/simple.el b/lisp/cedet/ede/simple.el index ea6162ef94f..aaeb3f713c9 100644 --- a/lisp/cedet/ede/simple.el +++ b/lisp/cedet/ede/simple.el @@ -1,4 +1,4 @@ -;;; ede/simple.el --- Overlay an EDE structure on an existing project +;;; ede/simple.el --- Overlay an EDE structure on an existing project -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -78,7 +78,7 @@ The directory has three parts: ede-simple-save-file-name) )) -(defun ede-simple-load (dir &optional rootproj) +(defun ede-simple-load (dir &optional _rootproj) "Load a project of type `Simple' for the directory DIR. Return nil if there isn't one. ROOTPROJ is nil, since we will only create a single EDE project here." @@ -112,7 +112,7 @@ Each directory needs a project file to control it.") (eieio-persistent-save proj)) (cl-defmethod ede-find-subproject-for-directory ((proj ede-simple-project) - dir) + _dir) "Return PROJ, for handling all subdirs below DIR." proj) diff --git a/lisp/cedet/ede/source.el b/lisp/cedet/ede/source.el index abdb07f2d73..5dbad4fcc00 100644 --- a/lisp/cedet/ede/source.el +++ b/lisp/cedet/ede/source.el @@ -1,4 +1,4 @@ -;; ede/source.el --- EDE source code object +;; ede/source.el --- EDE source code object -*- lexical-binding: t; -*- ;; Copyright (C) 2000, 2008-2021 Free Software Foundation, Inc. @@ -72,7 +72,7 @@ that they are willing to use.") ;;; Methods ;; -(cl-defmethod initialize-instance :after ((this ede-sourcecode) &rest fields) +(cl-defmethod initialize-instance :after ((this ede-sourcecode) &rest _fields) "Make sure that all ede compiler objects are cached in `ede-compiler-list'." (let ((lst ede-sourcecode-list)) diff --git a/lisp/cedet/ede/speedbar.el b/lisp/cedet/ede/speedbar.el index 48c4a89c440..01d4f943df5 100644 --- a/lisp/cedet/ede/speedbar.el +++ b/lisp/cedet/ede/speedbar.el @@ -1,4 +1,4 @@ -;;; ede/speedbar.el --- Speedbar viewing of EDE projects +;;; ede/speedbar.el --- Speedbar viewing of EDE projects -*- lexical-binding: t; -*- ;; Copyright (C) 1998-2001, 2003, 2005, 2007-2021 Free Software ;; Foundation, Inc. @@ -42,21 +42,21 @@ (setq ede-speedbar-key-map (speedbar-make-specialized-keymap)) ;; General viewing things - (define-key ede-speedbar-key-map "\C-m" 'speedbar-edit-line) - (define-key ede-speedbar-key-map "+" 'speedbar-expand-line) - (define-key ede-speedbar-key-map "=" 'speedbar-expand-line) - (define-key ede-speedbar-key-map "-" 'speedbar-contract-line) - (define-key ede-speedbar-key-map " " 'speedbar-toggle-line-expansion) + (define-key ede-speedbar-key-map "\C-m" #'speedbar-edit-line) + (define-key ede-speedbar-key-map "+" #'speedbar-expand-line) + (define-key ede-speedbar-key-map "=" #'speedbar-expand-line) + (define-key ede-speedbar-key-map "-" #'speedbar-contract-line) + (define-key ede-speedbar-key-map " " #'speedbar-toggle-line-expansion) ;; Some object based things - (define-key ede-speedbar-key-map "C" 'eieio-speedbar-customize-line) + (define-key ede-speedbar-key-map "C" #'eieio-speedbar-customize-line) ;; Some project based things - (define-key ede-speedbar-key-map "R" 'ede-speedbar-remove-file-from-target) - (define-key ede-speedbar-key-map "b" 'ede-speedbar-compile-line) - (define-key ede-speedbar-key-map "B" 'ede-speedbar-compile-project) - (define-key ede-speedbar-key-map "D" 'ede-speedbar-make-distribution) - (define-key ede-speedbar-key-map "E" 'ede-speedbar-edit-projectfile) + (define-key ede-speedbar-key-map "R" #'ede-speedbar-remove-file-from-target) + (define-key ede-speedbar-key-map "b" #'ede-speedbar-compile-line) + (define-key ede-speedbar-key-map "B" #'ede-speedbar-compile-project) + (define-key ede-speedbar-key-map "D" #'ede-speedbar-make-distribution) + (define-key ede-speedbar-key-map "E" #'ede-speedbar-edit-projectfile) ) (defvar ede-speedbar-menu @@ -98,7 +98,7 @@ (speedbar-get-focus) ) -(defun ede-speedbar-toplevel-buttons (dir) +(defun ede-speedbar-toplevel-buttons (_dir) "Return a list of objects to display in speedbar. Argument DIR is the directory from which to derive the list of objects." ede-projects @@ -180,13 +180,13 @@ Argument DIR is the directory from which to derive the list of objects." (setq depth (1- depth))) (speedbar-line-token)))) -(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-project) &optional depth) +(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-project) &optional _depth) "Return the path to OBJ. Optional DEPTH is the depth we start at." (file-name-directory (oref obj file)) ) -(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-target) &optional depth) +(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-target) &optional _depth) "Return the path to OBJ. Optional DEPTH is the depth we start at." (let ((proj (ede-target-parent obj))) @@ -208,7 +208,7 @@ Optional DEPTH is the depth we start at." "Provide a speedbar description for OBJ." (ede-description obj)) -(cl-defmethod eieio-speedbar-child-description ((obj ede-target)) +(cl-defmethod eieio-speedbar-child-description ((_obj ede-target)) "Provide a speedbar description for a plain-child of OBJ. A plain child is a child element which is not an EIEIO object." (or (speedbar-item-info-file-helper) @@ -251,7 +251,7 @@ It has depth DEPTH." ;;; Generic file management for TARGETS ;; -(defun ede-file-find (text token indent) +(defun ede-file-find (_text token indent) "Find the file TEXT at path TOKEN. INDENT is the current indentation level." (speedbar-find-file-in-frame @@ -290,7 +290,7 @@ level." (t (error "Ooops... not sure what to do"))) (speedbar-center-buffer-smartly)) -(defun ede-tag-find (text token indent) +(defun ede-tag-find (_text token _indent) "For the tag TEXT in a file TOKEN, goto that position. INDENT is the current indentation level." (let ((file (ede-find-nearest-file-line))) @@ -314,21 +314,21 @@ INDENT is the current indentation level." (defvar ede-speedbar-file-menu-additions '("----" ["Create EDE Target" ede-new-target (ede-current-project) ] - ["Add to project" ede-speedbar-file-add-to-project (ede-current-project) ] + ;; ["Add to project" ede-speedbar-file-add-to-project (ede-current-project) ] ["Compile project" ede-speedbar-compile-project (ede-current-project) ] - ["Compile file target" ede-speedbar-compile-file-target (ede-current-project) ] + ;; ["Compile file target" ede-speedbar-compile-file-target (ede-current-project) ] ["Make distribution" ede-make-dist (ede-current-project) ] ) "Set of menu items to splice into the speedbar menu.") (defvar ede-speedbar-file-keymap (let ((km (make-sparse-keymap))) - (define-key km "a" 'ede-speedbar-file-add-to-project) - (define-key km "t" 'ede-new-target) - (define-key km "s" 'ede-speedbar) - (define-key km "C" 'ede-speedbar-compile-project) - (define-key km "c" 'ede-speedbar-compile-file-target) - (define-key km "d" 'ede-make-dist) + ;; (define-key km "a" #'ede-speedbar-file-add-to-project) + (define-key km "t" #'ede-new-target) + (define-key km "s" #'ede-speedbar) + (define-key km "C" #'ede-speedbar-compile-project) + ;; (define-key km "c" #'ede-speedbar-compile-file-target) + (define-key km "d" #'ede-make-dist) km) "Keymap spliced into the speedbar keymap.") diff --git a/lisp/cedet/ede/util.el b/lisp/cedet/ede/util.el index 80cbc211fc2..2b2402c6425 100644 --- a/lisp/cedet/ede/util.el +++ b/lisp/cedet/ede/util.el @@ -1,4 +1,4 @@ -;;; ede/util.el --- EDE utilities +;;; ede/util.el --- EDE utilities -*- lexical-binding: t; -*- ;; Copyright (C) 2000, 2005, 2009-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el index 63e0cef61a3..4218b23c179 100644 --- a/lisp/cedet/mode-local.el +++ b/lisp/cedet/mode-local.el @@ -576,7 +576,7 @@ OVERARGS is a list of arguments passed to the override and (put :override-with-args 'lisp-indent-function 1) (define-obsolete-function-alias 'define-overload - 'define-overloadable-function "27.1") + #'define-overloadable-function "27.1") (define-obsolete-function-alias 'function-overload-p #'mode-local--function-overload-p "27.1") diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el index 3257feb1fed..cfd2152162f 100644 --- a/lisp/cedet/pulse.el +++ b/lisp/cedet/pulse.el @@ -194,7 +194,7 @@ Optional argument FACE specifies the face to do the highlighting." (progn (overlay-put o 'face (or face 'pulse-highlight-start-face)) (add-hook 'pre-command-hook - 'pulse-momentary-unhighlight)) + #'pulse-momentary-unhighlight)) ;; Pulse it. (overlay-put o 'face 'pulse-highlight-face) ;; The pulse function puts FACE onto 'pulse-highlight-face. @@ -233,7 +233,7 @@ Optional argument FACE specifies the face to do the highlighting." (cancel-timer pulse-momentary-timer)) ;; Remove this hook. - (remove-hook 'pre-command-hook 'pulse-momentary-unhighlight)) + (remove-hook 'pre-command-hook #'pulse-momentary-unhighlight)) ;;;###autoload (defun pulse-momentary-highlight-one-line (point &optional face) diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 797ff753a6c..15388f08d66 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -1,4 +1,4 @@ -;;; semantic.el --- Semantic buffer evaluator. +;;; semantic.el --- Semantic buffer evaluator. -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. @@ -297,7 +297,7 @@ to use Semantic, and `semantic-init-hook' is run." 'semantic-inhibit-functions))) ;; Make sure that if this buffer is cloned, our tags and overlays ;; don't go along for the ride. - (add-hook 'clone-indirect-buffer-hook 'semantic-clear-toplevel-cache + (add-hook 'clone-indirect-buffer-hook #'semantic-clear-toplevel-cache nil t) ;; Specify that this function has done its work. At this point ;; we can consider that semantic is active in this buffer. @@ -466,12 +466,12 @@ is requested." ;; Nuke all semantic overlays. This is faster than deleting based ;; on our data structure. (let ((l (overlay-lists))) - (mapc 'semantic-delete-overlay-maybe (car l)) - (mapc 'semantic-delete-overlay-maybe (cdr l)) + (mapc #'semantic-delete-overlay-maybe (car l)) + (mapc #'semantic-delete-overlay-maybe (cdr l)) ) (semantic-parse-tree-set-needs-rebuild) ;; Remove this hook which tracks if a buffer is up to date or not. - (remove-hook 'after-change-functions 'semantic-change-function t) + (remove-hook 'after-change-functions #'semantic-change-function t) (run-hook-with-args 'semantic-after-toplevel-cache-change-hook semantic--buffer-cache) @@ -487,7 +487,7 @@ is requested." ;; This is specific to the bovine parser. (setq-local semantic-bovinate-nonterminal-check-obarray nil) (semantic-parse-tree-set-up-to-date) - (add-hook 'after-change-functions 'semantic-change-function nil t) + (add-hook 'after-change-functions #'semantic-change-function nil t) (run-hook-with-args 'semantic-after-toplevel-cache-change-hook semantic--buffer-cache) (setq semantic--completion-cache nil) @@ -779,25 +779,25 @@ Throw away all the old tags, and recreate the tag database." (defvar semantic-mode-map (let ((map (make-sparse-keymap))) ;; Key bindings: - ;; (define-key km "f" 'senator-search-set-tag-class-filter) - ;; (define-key km "i" 'senator-isearch-toggle-semantic-mode) - (define-key map "\C-c,j" 'semantic-complete-jump-local) - (define-key map "\C-c,J" 'semantic-complete-jump) - (define-key map "\C-c,m" 'semantic-complete-jump-local-members) - (define-key map "\C-c,g" 'semantic-symref-symbol) - (define-key map "\C-c,G" 'semantic-symref) - (define-key map "\C-c,p" 'senator-previous-tag) - (define-key map "\C-c,n" 'senator-next-tag) - (define-key map "\C-c,u" 'senator-go-to-up-reference) - (define-key map "\C-c, " 'semantic-complete-analyze-inline) - (define-key map "\C-c,\C-w" 'senator-kill-tag) - (define-key map "\C-c,\M-w" 'senator-copy-tag) - (define-key map "\C-c,\C-y" 'senator-yank-tag) - (define-key map "\C-c,r" 'senator-copy-tag-to-register) - (define-key map "\C-c,," 'semantic-force-refresh) - (define-key map [?\C-c ?, up] 'senator-transpose-tags-up) - (define-key map [?\C-c ?, down] 'senator-transpose-tags-down) - (define-key map "\C-c,l" 'semantic-analyze-possible-completions) + ;; (define-key km "f" #'senator-search-set-tag-class-filter) + ;; (define-key km "i" #'senator-isearch-toggle-semantic-mode) + (define-key map "\C-c,j" #'semantic-complete-jump-local) + (define-key map "\C-c,J" #'semantic-complete-jump) + (define-key map "\C-c,m" #'semantic-complete-jump-local-members) + (define-key map "\C-c,g" #'semantic-symref-symbol) + (define-key map "\C-c,G" #'semantic-symref) + (define-key map "\C-c,p" #'senator-previous-tag) + (define-key map "\C-c,n" #'senator-next-tag) + (define-key map "\C-c,u" #'senator-go-to-up-reference) + (define-key map "\C-c, " #'semantic-complete-analyze-inline) + (define-key map "\C-c,\C-w" #'senator-kill-tag) + (define-key map "\C-c,\M-w" #'senator-copy-tag) + (define-key map "\C-c,\C-y" #'senator-yank-tag) + (define-key map "\C-c,r" #'senator-copy-tag-to-register) + (define-key map "\C-c,," #'semantic-force-refresh) + (define-key map [?\C-c ?, up] #'senator-transpose-tags-up) + (define-key map [?\C-c ?, down] #'senator-transpose-tags-down) + (define-key map "\C-c,l" #'semantic-analyze-possible-completions) ;; This hack avoids showing the CEDET menu twice if ede-minor-mode ;; and Semantic are both enabled. Is there a better way? (define-key map [menu-bar cedet-menu] @@ -1029,7 +1029,7 @@ Semantic mode. (file-exists-p semanticdb-default-system-save-directory)) (require 'semantic/db-ebrowse) (semanticdb-load-ebrowse-caches))) - (add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn) + (add-hook 'mode-local-init-hook #'semantic-new-buffer-fcn) ;; Add semantic-ia-complete-symbol to ;; completion-at-point-functions, so that it is run from ;; M-TAB. @@ -1037,11 +1037,11 @@ Semantic mode. ;; Note: The first entry added is the last entry run, so the ;; most specific entry should be last. (add-hook 'completion-at-point-functions - 'semantic-analyze-nolongprefix-completion-at-point-function) + #'semantic-analyze-nolongprefix-completion-at-point-function) (add-hook 'completion-at-point-functions - 'semantic-analyze-notc-completion-at-point-function) + #'semantic-analyze-notc-completion-at-point-function) (add-hook 'completion-at-point-functions - 'semantic-analyze-completion-at-point-function) + #'semantic-analyze-completion-at-point-function) (if (bound-and-true-p global-ede-mode) (define-key cedet-menu-map [cedet-menu-separator] '("--"))) @@ -1052,21 +1052,21 @@ Semantic mode. ;; introduced in the buffer is pretty much futile, but we have to ;; clean the hooks and delete Semantic-related overlays, so that ;; Semantic can be re-activated cleanly. - (remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn) + (remove-hook 'mode-local-init-hook #'semantic-new-buffer-fcn) (remove-hook 'completion-at-point-functions - 'semantic-analyze-completion-at-point-function) + #'semantic-analyze-completion-at-point-function) (remove-hook 'completion-at-point-functions - 'semantic-analyze-notc-completion-at-point-function) + #'semantic-analyze-notc-completion-at-point-function) (remove-hook 'completion-at-point-functions - 'semantic-analyze-nolongprefix-completion-at-point-function) + #'semantic-analyze-nolongprefix-completion-at-point-function) (remove-hook 'after-change-functions - 'semantic-change-function) + #'semantic-change-function) (define-key cedet-menu-map [cedet-menu-separator] nil) (define-key cedet-menu-map [semantic-options-separator] nil) ;; FIXME: handle semanticdb-load-ebrowse-caches (dolist (mode semantic-submode-list) - (if (and (boundp mode) (eval mode)) + (if (and (boundp mode) (symbol-value mode)) (funcall mode -1))) ;; Unlink buffer and clear cache (semantic--tag-unlink-cache-from-buffer) |