diff options
Diffstat (limited to 'lisp/cedet')
44 files changed, 418 insertions, 1021 deletions
diff --git a/lisp/cedet/cedet-cscope.el b/lisp/cedet/cedet-cscope.el index 75a69db0a8c..4d4a9f78d5d 100644 --- a/lisp/cedet/cedet-cscope.el +++ b/lisp/cedet/cedet-cscope.el @@ -26,8 +26,6 @@ ;;; Code: -(declare-function inversion-check-version "inversion") - (defvar cedet-cscope-min-version "15.7" "Minimum version of CScope required.") @@ -139,7 +137,6 @@ If optional programmatic argument NOERROR is non-nil, then instead of throwing an error if CScope isn't available, return nil." (interactive) - (require 'inversion) (let ((b (condition-case nil (cedet-cscope-call (list "-V")) (error nil))) @@ -153,7 +150,7 @@ return nil." (goto-char (point-min)) (re-search-forward "cscope: version \\([0-9.]+\\)" nil t) (setq rev (match-string 1)) - (if (inversion-check-version rev nil cedet-cscope-min-version) + (if (version< rev cedet-cscope-min-version) (if noerror nil (error "Version of CScope is %s. Need at least %s" diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el index 5878ec1f485..77b44744399 100644 --- a/lisp/cedet/cedet-global.el +++ b/lisp/cedet/cedet-global.el @@ -24,8 +24,6 @@ ;; ;; Basic support for calling GNU Global, and testing version numbers. -(declare-function inversion-check-version "inversion") - (defvar cedet-global-min-version "5.0" "Minimum version of GNU Global required.") @@ -143,7 +141,6 @@ If optional programmatic argument NOERROR is non-nil, then instead of throwing an error if Global isn't available, return nil." (interactive) - (require 'inversion) (let ((b (condition-case nil (cedet-gnu-global-call (list "--version")) (error nil))) @@ -157,7 +154,7 @@ return nil." (goto-char (point-min)) (re-search-forward "(?GNU GLOBAL)? \\([0-9.]+\\)" nil t) (setq rev (match-string 1)) - (if (inversion-check-version rev nil cedet-global-min-version) + (if (version< rev cedet-global-min-version) (if noerror nil (error "Version of GNU Global is %s. Need at least %s" diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el index fc5e05af88e..3e3d6a5e949 100644 --- a/lisp/cedet/cedet-idutils.el +++ b/lisp/cedet/cedet-idutils.el @@ -29,8 +29,6 @@ ;;; Code: -(declare-function inversion-check-version "inversion") - (defvar cedet-idutils-min-version "4.0" "Minimum version of ID Utils required.") @@ -167,7 +165,6 @@ If optional programmatic argument NOERROR is non-nil, then instead of throwing an error if Global isn't available, return nil." (interactive) - (require 'inversion) (let ((b (condition-case nil (cedet-idutils-fnid-call (list "--version")) (error nil))) @@ -182,7 +179,7 @@ return nil." (if (re-search-forward "fnid - \\([0-9.]+\\)" nil t) (setq rev (match-string 1)) (setq rev "0")) - (if (inversion-check-version rev nil cedet-idutils-min-version) + (if (version< rev cedet-idutils-min-version) (if noerror nil (error "Version of ID Utils is %s. Need at least %s" diff --git a/lisp/cedet/cedet.el b/lisp/cedet/cedet.el index caaec473a2c..5d98a1939d7 100644 --- a/lisp/cedet/cedet.el +++ b/lisp/cedet/cedet.el @@ -85,6 +85,7 @@ for the specified PACKAGE. LOADED VERSION is the version of PACKAGE currently loaded in Emacs memory and (presumably) running in this Emacs instance. Value is X if the package has not been loaded." + (declare (obsolete emacs-version "28.1")) (interactive) (require 'inversion) (with-output-to-temp-buffer "*CEDET*" diff --git a/lisp/cedet/ede/custom.el b/lisp/cedet/ede/custom.el index aada872cd0a..a128f9e1241 100644 --- a/lisp/cedet/ede/custom.el +++ b/lisp/cedet/ede/custom.el @@ -53,7 +53,7 @@ (setq-local eieio-ede-old-variables ov))) ;;;###autoload -(defalias 'customize-project 'ede-customize-project) +(defalias 'customize-project #'ede-customize-project) ;;;###autoload (defun ede-customize-current-target() @@ -65,7 +65,7 @@ (ede-customize-target ede-object)) ;;;###autoload -(defalias 'customize-target 'ede-customize-current-target) +(defalias 'customize-target #'ede-customize-current-target) (defun ede-customize-target (obj) "Edit fields of the current target through EIEIO & Custom. diff --git a/lisp/cedet/ede/dired.el b/lisp/cedet/ede/dired.el index 7eb42ed9de8..8b9eae0b430 100644 --- a/lisp/cedet/ede/dired.el +++ b/lisp/cedet/ede/dired.el @@ -30,7 +30,6 @@ ;;; Code: -(require 'easymenu) (require 'dired) (require 'ede) diff --git a/lisp/cedet/ede/make.el b/lisp/cedet/ede/make.el index 4f86558c626..d9811ce52f9 100644 --- a/lisp/cedet/ede/make.el +++ b/lisp/cedet/ede/make.el @@ -30,8 +30,6 @@ ;;; Code: -(declare-function inversion-check-version "inversion") - (defsubst ede--find-executable (exec) "Return an expanded file name for a program EXEC on the exec path." (declare (obsolete locate-file "28.1")) @@ -60,8 +58,7 @@ If NOERROR is nil, then throw an error on failure. Return t otherwise." (let ((b (get-buffer-create "*EDE Make Version*")) (cd default-directory) (rev nil) - (ans nil) - ) + (ans nil)) (with-current-buffer b ;; Setup, and execute make. (setq default-directory cd) @@ -70,18 +67,18 @@ If NOERROR is nil, then throw an error on failure. Return t otherwise." "--version") ;; Check the buffer for the string (goto-char (point-min)) - (when (looking-at "GNU Make\\(?: version\\)? \\([0-9][^,]+\\),") + (when (looking-at "GNU Make\\(?: version\\)? \\([0-9][^,[:space:]]+\\),?") (setq rev (match-string 1)) - (require 'inversion) - (setq ans (not (inversion-check-version rev nil ede-make-min-version)))) + (setq ans (not (version< rev ede-make-min-version)))) ;; Answer reporting. (when (and (called-interactively-p 'interactive) ans) (message "GNU Make version %s. Good enough for CEDET." rev)) (when (and (not noerror) (not ans)) - (error "EDE requires GNU Make version %s or later. Configure `ede-make-command' to fix" - ede-make-min-version)) + (error "EDE requires GNU Make version %s or later (found %s). Configure `ede-make-command' to fix" + ede-make-min-version + rev)) ans))) (provide 'ede/make) diff --git a/lisp/cedet/inversion.el b/lisp/cedet/inversion.el deleted file mode 100644 index 2ef7e0df961..00000000000 --- a/lisp/cedet/inversion.el +++ /dev/null @@ -1,554 +0,0 @@ -;;; inversion.el --- When you need something in version XX.XX - -;;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc. - -;; Author: Eric M. Ludlam <zappo@gnu.org> -;; Version: 1.3 -;; Keywords: OO, lisp - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. - -;;; Commentary: -;; -;; Keeping track of rapidly developing software is a tough thing to -;; do, especially if you want to have co-dependent packages which all -;; move at different rates. -;; -;; This library provides a framework for specifying version numbers -;; and (as side effect) have a flexible way of getting a desired feature set. -;; -;; If you would like to use this package to satisfy dependency replace this: -;; -;; (require 'spiffy) -;; -;; with this: -;; -;; (require 'inversion) -;; (inversion-require 'spiffy "1.0") -;; -;; If you feel the need to not throw errors, you can do this instead: -;; -;; (let ((err (inversion-test 'spiffy "1.0"))) -;; (if err (your-stuff-here))) -;; -;; If you new package (2.0) needs to make sure a load file from your -;; package is compatible, use this test: -;; -;; (if (not (inversion-reverse-test 'spiffy version-from-file)) -;; ;; Everything ok -;; (do stuff) -;; ;; Out of date -;; (import-old-code)) -;; -;; If you would like to make inversion optional, do this: -;; -;; (or (require 'inversion nil t) -;; (defun inversion-test (p v) -;; (string= v (symbol-value -;; (intern-soft (concat (symbol-string p) "-version")))))) -;; -;; Or modify to specify `inversion-require' instead. -;; -;; TODO: -;; Offer to download newer versions of a package. - -;;; History: -;; -;; Sept 3, 2002: First general publication. - -;;; Code: - -(defvar inversion-version "1.3" - "Current version of InVersion.") - -(defvar inversion-incompatible-version "0.1alpha1" - "An earlier release which is incompatible with this release.") - -(defconst inversion-decoders - '( - (alpha "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?alpha\\([0-9]+\\)?$" 4) - (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?beta\\([0-9]+\\)?$" 4) - (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?(beta\\([0-9]+\\)?)$" 4) - (beta "^[^/]+/\\w+--\\w+--\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)--patch-\\([0-9]+\\)" 4) - (beta "^\\w+: v\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)-\\([0-9]+\\)-\\(.*\\)" 5) - (prerelease "^\\([0-9]+\\)\\.\\([0-9]+\\)\\s-*\\.?pre\\([0-9]+\\)?$" 3) - (full "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?$" 3) - (fullsingle "^\\([0-9]+\\)$" 1) - (patch "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?\\s-*(patch \\([0-9]+\\))" 4) - (point "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)$" 3) - (point "^\\w+: v\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)-\\(0\\)-\\(.*\\)" 5) - (build "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\).\\([0-9]+\\)$" 4) - (full "^[^/]+/\\w+--\\w+--\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)--version-\\([0-9]+\\)" 4) - (full "^\\w+: v\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" 5) - ) - "List of decoders for version strings. -Each decoder is of the form: - - ( RELEASE-TYPE REGEXP MAX ) - -RELEASE-TYPE is a symbol specifying something like `beta' or `alpha'. -REGEXP is the regular expression to match a version string. -MAX is the maximum number of match-numbers in the release number. -Decoders must be ordered to decode least stable versions before the -more stable ones.") - -;;; Version Checking -;; -(defun inversion-decode-version (version-string) - "Decode VERSION-STRING into an encoded list. -Return value is of the form: - (RELEASE MAJOR MINOR ...) -where RELEASE is a symbol such as `full', or `beta'." - (let ((decoders inversion-decoders) - (result nil)) - (while (and decoders (not result)) - (if (string-match (nth 1 (car decoders)) version-string) - (let ((ver nil) - (num-left (nth 2 (car decoders))) - (count 1)) - (while (<= count num-left) - (setq ver (cons - (if (match-beginning count) - (string-to-number - (substring version-string - (match-beginning count) - (match-end count))) - 1) - ver) - count (1+ count))) - (setq result (cons (caar decoders) (nreverse ver)))) - (setq decoders (cdr decoders)))) - result)) - -(defun inversion-package-version (package) - "Return the decoded version for PACKAGE." - (let ((ver (symbol-value - (intern-soft - (concat (symbol-name package) - "-version")))) - (code nil)) - (unless ver - (error "Package %S does not define %S-version" package package)) - ;; Decode the code - (setq code (inversion-decode-version ver)) - (unless code - (error "%S-version value (%s) cannot be decoded" package ver)) - code)) - -(defun inversion-package-incompatibility-version (package) - "Return the decoded incompatibility version for PACKAGE. -The incompatibility version is specified by the programmer of -a package when a package is not backward compatible. It is -not an indication of new features or bug fixes." - (let ((ver (symbol-value - (intern-soft - (concat (symbol-name package) - "-incompatible-version"))))) - (if (not ver) - nil - ;; Decode the code - (inversion-decode-version ver)))) - -(defun inversion-recode (code) - "Convert CODE into a string." - (let ((r (nth 0 code)) ; release-type - (n (nth 1 code)) ; main number - (i (nth 2 code)) ; first increment - (p (nth 3 code))) ; second increment - (cond - ((eq r 'full) - (setq r "" p "")) - ((eq r 'point) - (setq r "."))) - (format "%s.%s%s%s" n i r p))) - -(defun inversion-release-to-number (release-symbol) - "Convert RELEASE-SYMBOL into a number." - (let* ((ra (assoc release-symbol inversion-decoders)) - (rn (- (length inversion-decoders) - (length (member ra inversion-decoders))))) - rn)) - -(defun inversion-= (ver1 ver2) - "Return non-nil if VER1 is equal to VER2." - (equal ver1 ver2)) - -(defun inversion-< (ver1 ver2) - "Return non-nil if VER1 is less than VER2." - (let ((v1-0 (inversion-release-to-number (nth 0 ver1))) - (v1-1 (nth 1 ver1)) - (v1-2 (nth 2 ver1)) - (v1-3 (nth 3 ver1)) - (v1-4 (nth 4 ver1)) - ;; v2 - (v2-0 (inversion-release-to-number (nth 0 ver2))) - (v2-1 (nth 1 ver2)) - (v2-2 (nth 2 ver2)) - (v2-3 (nth 3 ver2)) - (v2-4 (nth 4 ver2)) - ) - - (cond ((and (equal (list v1-1 v1-2 v1-3 v1-4) - (list v2-1 v2-2 v2-3 v2-4)) - v1-0 v2-0) - (< v1-0 v2-0)) - ((and (equal v1-1 v2-1) - (equal v1-2 v2-2) - (equal v1-3 v2-3) - v1-4 v2-4) ; all or nothing if elt - is = - (< v1-4 v2-4)) - ((and (equal v1-1 v2-1) - (equal v1-2 v2-2) - v1-3 v2-3) ; all or nothing if elt - is = - (< v1-3 v2-3)) - ((and (equal v1-1 v2-1) - v1-2 v2-2) - (< v1-2 v2-2)) - ((and v1-1 v2-1) - (< v1-1 v2-1)) - ))) - -(defun inversion-check-version (version incompatible-version - minimum &rest reserved) - "Check that a given version meets the minimum requirement. -VERSION, INCOMPATIBLE-VERSION and MINIMUM are of similar format to -return entries of `inversion-decode-version', or a classic version -string. INCOMPATIBLE-VERSION can be nil. -RESERVED arguments are kept for a later use. -Return: -- nil if everything is ok. -- `outdated' if VERSION is less than MINIMUM. -- `incompatible' if VERSION is not backward compatible with MINIMUM. -- t if the check failed." - (let ((code (if (stringp version) - (inversion-decode-version version) - version)) - (req (if (stringp minimum) - (inversion-decode-version minimum) - minimum)) - ) - ;; Perform a test. - (cond - ((inversion-= code req) - ;; Same version.. Yay! - nil) - ((inversion-< code req) - ;; Version is too old! - 'outdated) - ((inversion-< req code) - ;; Newer is installed. What to do? - (let ((incompatible - (if (stringp incompatible-version) - (inversion-decode-version incompatible-version) - incompatible-version))) - (cond - ((not incompatible) nil) - ((or (inversion-= req incompatible) - (inversion-< req incompatible)) - ;; The requested version is = or < than what the package - ;; maintainer says is incompatible. - 'incompatible) - ;; Things are ok. - (t nil)))) - ;; Check failed - (t t)))) - -(defun inversion-test (package minimum &rest reserved) - "Test that PACKAGE meets the MINIMUM version requirement. -PACKAGE is a symbol, similar to what is passed to `require'. -MINIMUM is of similar format to return entries of -`inversion-decode-version', or a classic version string. -RESERVED arguments are kept for a later user. -This depends on the symbols `PACKAGE-version' and optionally -`PACKAGE-incompatible-version' being defined in PACKAGE. -Return nil if everything is ok. Return an error string otherwise." - (let ((check (inversion-check-version - (inversion-package-version package) - (inversion-package-incompatibility-version package) - minimum reserved))) - (cond - ((null check) - ;; Same version.. Yay! - nil) - ((eq check 'outdated) - ;; Version is too old! - (format "You need to upgrade package %s to %s" package minimum)) - ((eq check 'incompatible) - ;; Newer is installed but the requested version is = or < than - ;; what the package maintainer says is incompatible, then throw - ;; that error. - (format "Package %s version is not backward compatible with %s" - package minimum)) - ;; Check failed - (t "Inversion version check failed.")))) - -(defun inversion-reverse-test (package oldversion &rest reserved) - "Test that PACKAGE at OLDVERSION is still compatible. -If something like a save file is loaded at OLDVERSION, this -test will identify if OLDVERSION is compatible with the current version -of PACKAGE. -PACKAGE is a symbol, similar to what is passed to `require'. -OLDVERSION is of similar format to return entries of -`inversion-decode-version', or a classic version string. -RESERVED arguments are kept for a later user. -This depends on the symbols `PACKAGE-version' and optionally -`PACKAGE-incompatible-version' being defined in PACKAGE. -Return nil if everything is ok. Return an error string otherwise." - (let ((check (inversion-check-version - (inversion-package-version package) - (inversion-package-incompatibility-version package) - oldversion reserved))) - (cond - ((null check) - ;; Same version.. Yay! - nil) - ((eq check 'outdated) - ;; Version is too old! - (format "Package %s version %s is not compatible with current version" - package oldversion)) - ((eq check 'incompatible) - ;; Newer is installed but the requested version is = or < than - ;; what the package maintainer says is incompatible, then throw - ;; that error. - (format "Package %s version is not backward compatible with %s" - package oldversion)) - ;; Check failed - (t "Inversion version check failed.")))) - -(defun inversion-require (package version &optional file directory - &rest reserved) - "Declare that you need PACKAGE with at least VERSION. -PACKAGE might be found in FILE. (See `require'.) -Throws an error if VERSION is incompatible with what is installed. -Optional argument DIRECTORY is a location where new versions of -this tool can be located. If there is a versioning problem and -DIRECTORY is provided, inversion will offer to download the file. -Optional argument RESERVED is saved for later use." - (require package file) - (let ((err (inversion-test package version))) - (when err - (if directory - (inversion-download-package-ask err package directory version) - (error err))) - ;; Return the package symbol that was required. - package)) - -;;;###autoload -(defun inversion-require-emacs (emacs-ver xemacs-ver sxemacs-ver) - "Declare that you need either EMACS-VER, XEMACS-VER or SXEMACS-ver. -Only checks one based on which kind of Emacs is being run. - -This function is obsolete; do this instead: - (when (version<= \"28.1\" emacs-version) ...)" - (declare (obsolete nil "28.1")) - (let ((err (inversion-test 'emacs - (cond ((featurep 'sxemacs) - sxemacs-ver) - ((featurep 'xemacs) - xemacs-ver) - (t - emacs-ver))))) - (if err (error err) - ;; Something nice... - t))) - -(defconst inversion-find-data - '("(def\\(var\\|const\\)\\s-+%s-%s\\s-+\"\\([^\"]+\\)" 2) - "Regexp template and match data index of a version string.") - -(defun inversion-find-version (package) - "Search for the version and incompatible version of PACKAGE. -Does not load PACKAGE nor requires that it has been previously loaded. -Search in the directories in `load-path' for a PACKAGE.el library. -Visit the file found and search for the declarations of variables or -constants `PACKAGE-version' and `PACKAGE-incompatible-version'. The -value of these variables must be a version string. - -Return a pair (VERSION-STRING . INCOMPATIBLE-VERSION-STRING) where -INCOMPATIBLE-VERSION-STRING can be nil. -Return nil when VERSION-STRING was not found." - (let* ((file (locate-library (format "%s.el" package) t)) - (tag (car inversion-find-data)) - (idx (nth 1 inversion-find-data)) - version) - (when file - (with-temp-buffer - ;; The 3000 is a bit arbitrary, but should cut down on - ;; fileio as version info usually is at the very top - ;; of a file. After a long commentary could be bad. - (insert-file-contents-literally file nil 0 3000) - (goto-char (point-min)) - (when (re-search-forward (format tag package 'version) nil t) - (setq version (list (match-string idx))) - (goto-char (point-min)) - (when (re-search-forward - (format tag package 'incompatible-version) nil t) - (setcdr version (match-string idx)))))) - version)) - -(defun inversion-add-to-load-path (package minimum - &optional installdir - &rest subdirs) - "Add the PACKAGE path to `load-path' if necessary. -MINIMUM is the minimum version requirement of PACKAGE. -Optional argument INSTALLDIR is the base directory where PACKAGE is -installed. It defaults to `default-directory'/PACKAGE. -SUBDIRS are sub-directories to add to `load-path', following the main -INSTALLDIR path." - (let ((ver (inversion-find-version package))) - ;; If PACKAGE not found or a bad version already in `load-path', - ;; prepend the new PACKAGE path, so it will be loaded first. - (when (or (not ver) - (and - (inversion-check-version (car ver) (cdr ver) minimum) - (message "Outdated %s %s shadowed to meet minimum version %s" - package (car ver) minimum) - t)) - (let* ((default-directory - (or installdir - (expand-file-name (format "./%s" package)))) - subdir) - (when (file-directory-p default-directory) - ;; Add SUBDIRS - (while subdirs - (setq subdir (expand-file-name (car subdirs)) - subdirs (cdr subdirs)) - (when (file-directory-p subdir) - ;;(message "%S added to `load-path'" subdir) - (add-to-list 'load-path subdir))) - ;; Add the main path - ;;(message "%S added to `load-path'" default-directory) - (add-to-list 'load-path default-directory)) - ;; We get to this point iff we do not accept or there is no - ;; system file. Let's check the version of what we just - ;; installed... just to be safe. - (let ((newver (inversion-find-version package))) - (if (not newver) - (error "Failed to find version for newly installed %s" - package)) - (if (inversion-check-version (car newver) (cdr newver) minimum) - (error "Outdated %s %s just installed" package (car newver))) - ))))) - -;;; URL and downloading code -;; -(defun inversion-locate-package-files (package directory &optional version) - "Get a list of distributions of PACKAGE from DIRECTORY. -DIRECTORY can be an ange-ftp compatible filename, such as: - \"/ftp@ftp1.sourceforge.net/pub/sourceforge/PACKAGE\" -If it is a URL, wget will be used for download. -Optional argument VERSION will restrict the list of available versions -to the file matching VERSION exactly, or nil." -;;DIRECTORY should also allow a URL: -;; \"http://ftp1.sourceforge.net/PACKAGE\" -;; but then I can get file listings easily. - (if (symbolp package) (setq package (symbol-name package))) - (directory-files directory t - (if version - (concat "^" package "-" version "\\>") - package))) - -(defvar inversion-package-common-tails '( ".tar.gz" - ".tar" - ".zip" - ".gz" - ) - "Common distribution mechanisms for Emacs Lisp packages.") - -(defun inversion-locate-package-files-and-split (package directory &optional version) - "Use `inversion-locate-package-files' to get a list of PACKAGE files. -DIRECTORY is the location where distributions of PACKAGE are. -VERSION is an optional argument specifying a version to restrict to. -The return list is an alist with the version string in the CAR, -and the full path name in the CDR." - (if (symbolp package) (setq package (symbol-name package))) - (let ((f (inversion-locate-package-files package directory version)) - (out nil)) - (while f - (let* ((file (car f)) - (dist (file-name-nondirectory file)) - (tails inversion-package-common-tails) - (verstring nil)) - (while (and tails (not verstring)) - (when (string-match (concat (car tails) "$") dist) - (setq verstring - (substring dist (1+ (length package)) (match-beginning 0)))) - (setq tails (cdr tails))) - (if (not verstring) - (error "Cannot decode version for %s" dist)) - (setq out - (cons - (cons verstring file) - out)) - (setq f (cdr f)))) - out)) - -(defun inversion-download-package-ask (err package directory version) - "Due to ERR, offer to download PACKAGE from DIRECTORY. -The package should have VERSION available for download." - (if (symbolp package) (setq package (symbol-name package))) - (let ((files (inversion-locate-package-files-and-split - package directory version))) - (if (not files) - (error err) - (if (not (y-or-n-p (concat err ": Download update? "))) - (error err) - (let ((dest (read-directory-name (format "Download %s to: " - package) - t))) - (if (> (length files) 1) - (setq files - (list - "foo" ;; ignored - (read-file-name "Version to download: " - directory - files - t - (concat - (file-name-as-directory directory) - package) - nil)))) - - (copy-file (cdr (car files)) dest)))))) - -;;; How we upgrade packages in Emacs has yet to be ironed out. - -;; (defun inversion-upgrade-package (package &optional directory) -;; "Try to upgrade PACKAGE in DIRECTORY is available." -;; (interactive "sPackage to upgrade: ") -;; (if (stringp package) (setq package (intern package))) -;; (if (not directory) -;; ;; Hope that the package maintainer specified. -;; (setq directory (symbol-value (or (intern-soft -;; (concat (symbol-name package) -;; "-url")) -;; (intern-soft -;; (concat (symbol-name package) -;; "-directory")))))) -;; (let ((files (inversion-locate-package-files-and-split -;; package directory)) -;; (cver (inversion-package-version package)) -;; (newer nil)) -;; (mapc (lambda (f) -;; (if (inversion-< cver (inversion-decode-version (car f))) -;; (setq newer (cons f newer)))) -;; files) -;; newer -;; )) - -(provide 'inversion) - -;;; inversion.el ends here diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 44bd4b0cd82..797ff753a6c 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -57,6 +57,7 @@ excluded if a released version is required. It is assumed that if the current version is newer than that specified, everything passes. Exceptions occur when known incompatibilities are introduced." + (declare (obsolete emacs-version "28.1")) (require 'inversion) (inversion-test 'semantic (concat major "." minor diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el index c0a054dafc3..1a4be11c789 100644 --- a/lisp/cedet/semantic/analyze.el +++ b/lisp/cedet/semantic/analyze.el @@ -1,4 +1,4 @@ -;;; semantic/analyze.el --- Analyze semantic tags against local context +;;; semantic/analyze.el --- Analyze semantic tags against local context -*- lexical-binding: t; -*- ;; Copyright (C) 2000-2005, 2007-2021 Free Software Foundation, Inc. @@ -167,7 +167,7 @@ of the parent function.") ;; Simple methods against the context classes. ;; (cl-defmethod semantic-analyze-type-constraint - ((context semantic-analyze-context) &optional desired-type) + ((_context semantic-analyze-context) &optional desired-type) "Return a type constraint for completing :prefix in CONTEXT. Optional argument DESIRED-TYPE may be a non-type tag to analyze." (when (semantic-tag-p desired-type) @@ -344,8 +344,8 @@ This function knows of flags: (setq tagtype (cons tmptype tagtype)) (when miniscope (let ((rawscope - (apply 'append - (mapcar 'semantic-tag-type-members tagtype)))) + (apply #'append + (mapcar #'semantic-tag-type-members tagtype)))) (oset miniscope fullscope rawscope))) ) (setq s (cdr s))) @@ -437,6 +437,8 @@ to provide a large number of non-cached analysis for filtering symbols." (:override))) ) +(defvar semantic--prefixtypes) + (defun semantic-analyze-current-symbol-default (analyzehookfcn position) "Call ANALYZEHOOKFCN on the analyzed symbol at POSITION." (let* ((semantic-analyze-error-stack nil) @@ -453,14 +455,14 @@ to provide a large number of non-cached analysis for filtering symbols." (catch 'unfindable ;; If debug on error is on, allow debugging in this fcn. (setq prefix (semantic-analyze-find-tag-sequence - prefix scope 'prefixtypes 'unfindable))) + prefix scope 'semantic--prefixtypes 'unfindable))) ;; Debug on error is off. Capture errors and move on (condition-case err ;; NOTE: This line is duplicated in ;; semantic-analyzer-debug-global-symbol ;; You will need to update both places. (setq prefix (semantic-analyze-find-tag-sequence - prefix scope 'prefixtypes)) + prefix scope 'semantic--prefixtypes)) (error (semantic-analyze-push-error err)))) ;;(message "Analysis took %.2f sec" (semantic-elapsed-time LLstart nil)) @@ -531,7 +533,7 @@ Returns an object based on symbol `semantic-analyze-context'." (bounds (nth 2 prefixandbounds)) ;; @todo - vv too early to really know this answer! vv (prefixclass (semantic-ctxt-current-class-list)) - (prefixtypes nil) + (semantic--prefixtypes nil) (scope (semantic-calculate-scope position)) (function nil) (fntag nil) @@ -611,13 +613,13 @@ Returns an object based on symbol `semantic-analyze-context'." (if debug-on-error (catch 'unfindable (setq prefix (semantic-analyze-find-tag-sequence - prefix scope 'prefixtypes 'unfindable)) + prefix scope 'semantic--prefixtypes 'unfindable)) ;; If there's an alias, dereference it and analyze ;; sequence again. (when (setq newseq (semantic-analyze-dereference-alias prefix)) (setq prefix (semantic-analyze-find-tag-sequence - newseq scope 'prefixtypes 'unfindable)))) + newseq scope 'semantic--prefixtypes 'unfindable)))) ;; Debug on error is off. Capture errors and move on (condition-case err ;; NOTE: This line is duplicated in @@ -625,11 +627,11 @@ Returns an object based on symbol `semantic-analyze-context'." ;; You will need to update both places. (progn (setq prefix (semantic-analyze-find-tag-sequence - prefix scope 'prefixtypes)) + prefix scope 'semantic--prefixtypes)) (when (setq newseq (semantic-analyze-dereference-alias prefix)) (setq prefix (semantic-analyze-find-tag-sequence - newseq scope 'prefixtypes)))) + newseq scope 'semantic--prefixtypes)))) (error (semantic-analyze-push-error err)))) ) @@ -650,7 +652,7 @@ Returns an object based on symbol `semantic-analyze-context'." :prefix prefix :prefixclass prefixclass :bounds bounds - :prefixtypes prefixtypes + :prefixtypes semantic--prefixtypes :errors semantic-analyze-error-stack))) ;; No function, try assignment @@ -670,7 +672,7 @@ Returns an object based on symbol `semantic-analyze-context'." :bounds bounds :prefix prefix :prefixclass prefixclass - :prefixtypes prefixtypes + :prefixtypes semantic--prefixtypes :errors semantic-analyze-error-stack))) ;; TODO: Identify return value condition. @@ -686,7 +688,7 @@ Returns an object based on symbol `semantic-analyze-context'." :bounds bounds :prefix prefix :prefixclass prefixclass - :prefixtypes prefixtypes + :prefixtypes semantic--prefixtypes :errors semantic-analyze-error-stack))) (t (setq context-return nil)) @@ -750,7 +752,7 @@ Some useful functions are found in `semantic-format-tag-functions'." :group 'semantic :type semantic-format-tag-custom-list) -(defun semantic-analyze-princ-sequence (sequence &optional prefix buff) +(defun semantic-analyze-princ-sequence (sequence &optional prefix _buff) "Send the tag SEQUENCE to standard out. Use PREFIX as a label. Use BUFF as a source of override methods." diff --git a/lisp/cedet/semantic/analyze/complete.el b/lisp/cedet/semantic/analyze/complete.el index e8139ab1aea..ccf405d62e2 100644 --- a/lisp/cedet/semantic/analyze/complete.el +++ b/lisp/cedet/semantic/analyze/complete.el @@ -1,4 +1,4 @@ -;;; semantic/analyze/complete.el --- Smart Completions +;;; semantic/analyze/complete.el --- Smart Completions -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -45,7 +45,7 @@ "For the tag TYPE, return any constant symbols of TYPE. Used as options when completing.") -(defun semantic-analyze-type-constants-default (type) +(defun semantic-analyze-type-constants-default (_type) "Do nothing with TYPE." nil) @@ -54,7 +54,7 @@ Used as options when completing.") (let ((origc tags)) ;; Accept only tags that are of the datatype specified by ;; the desired classes. - (setq tags (apply 'nconc ;; All input lists are permutable. + (setq tags (apply #'nconc ;; All input lists are permutable. (mapcar (lambda (class) (semantic-find-tags-by-class class origc)) classlist))) @@ -109,6 +109,8 @@ in a buffer." (when (called-interactively-p 'any) (error "Buffer was not parsed by Semantic.")))) +(defvar semantic--prefixtypes) + (defun semantic-analyze-possible-completions-default (context &optional flags) "Default method for producing smart completions. Argument CONTEXT is an object specifying the locally derived context. @@ -121,14 +123,14 @@ FLAGS can be any number of: (desired-type (semantic-analyze-type-constraint a)) (desired-class (oref a prefixclass)) (prefix (oref a prefix)) - (prefixtypes (oref a prefixtypes)) + (semantic--prefixtypes (oref a prefixtypes)) (completetext nil) (completetexttype nil) (scope (oref a scope)) (localvar (when scope (oref scope localvar))) (origc nil) (c nil) - (any nil) + ;; (any nil) (do-typeconstraint (not (memq 'no-tc flags))) (do-longprefix (not (memq 'no-longprefix flags))) (do-unique (not (memq 'no-unique flags))) @@ -138,7 +140,7 @@ FLAGS can be any number of: ;; If we are not doing the long prefix, shorten all the key ;; elements. (setq prefix (list (car (reverse prefix))) - prefixtypes nil)) + semantic--prefixtypes nil)) ;; Calculate what our prefix string is so that we can ;; find all our matching text. @@ -155,7 +157,7 @@ FLAGS can be any number of: ;; The prefixtypes should always be at least 1 less than ;; the prefix since the type is never looked up for the last ;; item when calculating a sequence. - (setq completetexttype (car (reverse prefixtypes))) + (setq completetexttype (car (reverse semantic--prefixtypes))) (when (or (not completetexttype) (not (and (semantic-tag-p completetexttype) (eq (semantic-tag-class completetexttype) 'type)))) diff --git a/lisp/cedet/semantic/analyze/debug.el b/lisp/cedet/semantic/analyze/debug.el index 4947368757e..58d6644f9a9 100644 --- a/lisp/cedet/semantic/analyze/debug.el +++ b/lisp/cedet/semantic/analyze/debug.el @@ -1,4 +1,4 @@ -;;; semantic/analyze/debug.el --- Debug the analyzer +;;; semantic/analyze/debug.el --- Debug the analyzer -*- lexical-binding: t; -*- ;;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -109,11 +109,11 @@ Argument COMP are possible completions here." (condition-case err (with-current-buffer origbuf (let* ((position (or (cdr-safe (oref ctxt bounds)) (point))) - (prefixtypes nil) ; Used as type return + ;; (semantic--prefixtypes nil) ; Used as type return (scope (semantic-calculate-scope position)) ) (semantic-analyze-find-tag-sequence - (list prefix "") scope 'prefixtypes) + (list prefix "") scope) ;; 'semantic--prefixtypes ) ) (error (setq finderr err))) @@ -149,7 +149,7 @@ path was setup incorrectly.\n") (semantic-analyzer-debug-add-buttons) )) -(defun semantic-analyzer-debug-missing-datatype (ctxt idx comp) +(defun semantic-analyzer-debug-missing-datatype (ctxt idx _comp) "Debug why we can't find a datatype entry for CTXT prefix at IDX. Argument COMP are possible completions here." (let* ((prefixitem (nth idx (oref ctxt prefix))) diff --git a/lisp/cedet/semantic/analyze/fcn.el b/lisp/cedet/semantic/analyze/fcn.el index 10d11c33ebb..d47e8976e58 100644 --- a/lisp/cedet/semantic/analyze/fcn.el +++ b/lisp/cedet/semantic/analyze/fcn.el @@ -1,4 +1,4 @@ -;;; semantic/analyze/fcn.el --- Analyzer support functions. +;;; semantic/analyze/fcn.el --- Analyzer support functions. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -55,7 +55,7 @@ Return the string representing the compound name.") (defun semantic-analyze-unsplit-name-default (namelist) "Concatenate the names in NAMELIST with a . between." - (mapconcat 'identity namelist ".")) + (mapconcat #'identity namelist ".")) ;;; SELECTING ;; diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el index a39ff6f6736..31cbb9e1173 100644 --- a/lisp/cedet/semantic/analyze/refs.el +++ b/lisp/cedet/semantic/analyze/refs.el @@ -1,4 +1,4 @@ -;;; semantic/analyze/refs.el --- Analysis of the references between tags. +;;; semantic/analyze/refs.el --- Analysis of the references between tags. -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -296,7 +296,7 @@ Only works for tags in the global namespace." (let* ((classmatch (semantic-tag-class tag)) (RES (semanticdb-find-tags-collector - (lambda (table tags) + (lambda (_table tags) (semantic-find-tags-by-class classmatch tags) ;; @todo - Add parent check also. ) diff --git a/lisp/cedet/semantic/bovine.el b/lisp/cedet/semantic/bovine.el index 3bc0e4dd618..b585e387fed 100644 --- a/lisp/cedet/semantic/bovine.el +++ b/lisp/cedet/semantic/bovine.el @@ -1,4 +1,4 @@ -;;; semantic/bovine.el --- LL Parser/Analyzer core. +;;; semantic/bovine.el --- LL Parser/Analyzer core -*- lexical-binding: t; -*- ;; Copyright (C) 1999-2004, 2006-2007, 2009-2021 Free Software ;; Foundation, Inc. @@ -54,6 +54,7 @@ Use this to detect infinite recursion during a parse.") "Create a lambda expression to return a list including RETURN-VAL. The return list is a lambda expression to be used in a bovine table." `(lambda (vals start end) + (ignore vals) (append ,@return-val (list start end)))) ;;; Semantic Bovination @@ -283,7 +284,7 @@ list of semantic tokens found." ;; Make it the default parser ;;;###autoload -(defalias 'semantic-parse-stream-default 'semantic-bovinate-stream) +(defalias 'semantic-parse-stream-default #'semantic-bovinate-stream) (provide 'semantic/bovine) diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index 4914ec9b124..e3df7b12ab6 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -1,4 +1,4 @@ -;;; semantic/bovine/grammar.el --- Bovine's input grammar mode +;;; semantic/bovine/grammar.el --- Bovine's input grammar mode -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. ;; @@ -243,7 +243,8 @@ QUOTEMODE is the mode in which quoted symbols are slurred." (insert "\n") (cond ((eq (car sexp) 'EXPAND) - (insert ",(lambda (vals start end)") + (insert ",(lambda (vals start end)" + "\n(ignore vals start end)") ;; The EXPAND macro definition is mandatory (bovine-grammar-expand-form (apply (cdr (assq 'EXPAND bovine--grammar-macros)) (cdr sexp)) @@ -520,7 +521,8 @@ Menu items are appended to the common grammar menu.") (goto-char (point-min)) (delete-region (point-min) (line-end-position)) (insert ";;; " packagename - " --- Generated parser support file") + " --- Generated parser support file " + "-*- lexical-binding:t -*-") (delete-trailing-whitespace) (re-search-forward ";;; \\(.*\\) ends here") (replace-match packagename nil nil nil 1))))) diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el index 59e9db9cc0a..d99b94f49eb 100644 --- a/lisp/cedet/semantic/db-file.el +++ b/lisp/cedet/semantic/db-file.el @@ -154,8 +154,6 @@ If DIRECTORY doesn't exist, create a new one." ;;; File IO -(declare-function inversion-test "inversion") - (defun semanticdb-load-database (filename) "Load the database FILENAME." (condition-case foo @@ -163,32 +161,19 @@ If DIRECTORY doesn't exist, create a new one." 'semanticdb-project-database-file)) (c (semanticdb-get-database-tables r)) (tv (oref r semantic-tag-version)) - (fv (oref r semanticdb-version)) - ) + (fv (oref r semanticdb-version))) ;; Restore the parent-db connection (while c (oset (car c) parent-db r) (setq c (cdr c))) (unless (and (equal semanticdb-file-version fv) (equal semantic-tag-version tv)) - ;; Try not to load inversion unless we need it: - (require 'inversion) - (if (not (inversion-test 'semanticdb-file fv)) - (when (inversion-test 'semantic-tag tv) - ;; Incompatible version. Flush tables. - (semanticdb-flush-database-tables r) - ;; Reset the version to new version. - (oset r semantic-tag-version semantic-tag-version) - ;; Warn user - (message "Semanticdb file is old. Starting over for %s" - filename)) - ;; Version is not ok. Flush whole system - (message "semanticdb file is old. Starting over for %s" - filename) - ;; This database is so old, we need to replace it. - ;; We also need to delete it from the instance tracker. - (delete-instance r) - (setq r nil))) + ;; Version is not ok. Flush whole system + (message "semanticdb file is old. Starting over for %s" filename) + ;; This database is so old, we need to replace it. + ;; We also need to delete it from the instance tracker. + (delete-instance r) + (setq r nil)) r) (error (message "Cache Error: [%s] %s, Restart" filename foo) diff --git a/lisp/cedet/semantic/ede-grammar.el b/lisp/cedet/semantic/ede-grammar.el index bd0795acbd6..64fc07fe1bb 100644 --- a/lisp/cedet/semantic/ede-grammar.el +++ b/lisp/cedet/semantic/ede-grammar.el @@ -162,10 +162,9 @@ Lays claim to all -by.el, and -wy.el files." "Insert variables needed by target THIS." (ede-proj-makefile-insert-loadpath-items (ede-proj-elisp-packages-to-loadpath - (list "eieio" "semantic" "inversion" "ede"))) + (list "eieio" "semantic" "ede"))) ;; eieio for object system needed in ede ;; semantic because it is - ;; Inversion for versioning system. ;; ede for project regeneration (ede-pmake-insert-variable-shared (concat (ede-pmake-varname this) "_SEMANTIC_GRAMMAR_EL") @@ -174,8 +173,7 @@ Lays claim to all -by.el, and -wy.el files." (with-current-buffer (find-file-noselect src) (concat (semantic-grammar-package) ".el"))) (oref this source) - " "))) - ) + " ")))) (cl-defmethod ede-proj-makefile-insert-rules :after ((this semantic-ede-proj-target-grammar)) "Insert rules needed by THIS target. diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el index f39cc093cc9..4594d7f6969 100644 --- a/lisp/cedet/semantic/edit.el +++ b/lisp/cedet/semantic/edit.el @@ -828,8 +828,7 @@ This function is for internal use by `semantic-edits-incremental-parser'." ;; Make it the default changes parser ;;;###autoload -(defalias 'semantic-parse-changes-default - 'semantic-edits-incremental-parser) +(defalias 'semantic-parse-changes-default #'semantic-edits-incremental-parser) ;;; Cache Splicing ;; diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grammar-wy.el index 12c9c047fc5..9a7f393072f 100644 --- a/lisp/cedet/semantic/grammar-wy.el +++ b/lisp/cedet/semantic/grammar-wy.el @@ -1,6 +1,6 @@ -;;; semantic/grammar-wy.el --- Generated parser support file +;;; semantic/grammar-wy.el --- Generated parser support file -*- lexical-binding:t -*- -;; Copyright (C) 2002-2004, 2009-2021 Free Software Foundation, Inc. +;; Copyright (C) 2002-2021 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -23,8 +23,9 @@ ;;; Code: -(require 'semantic) - +(require 'semantic/lex) +(eval-when-compile (require 'semantic/bovine)) + ;;; Prologue ;; (defvar semantic-grammar-lex-c-char-re) @@ -36,16 +37,20 @@ ;;; Declarations ;; +(eval-and-compile (defconst semantic-grammar-wy--expected-conflicts + nil + "The number of expected shift/reduce conflicts in this grammar.")) + (defconst semantic-grammar-wy--keyword-table (semantic-lex-make-keyword-table '(("%default-prec" . DEFAULT-PREC) ("%no-default-prec" . NO-DEFAULT-PREC) ("%keyword" . KEYWORD) - ("%expectedconflicts" . EXPECTEDCONFLICTS) ("%languagemode" . LANGUAGEMODE) ("%left" . LEFT) ("%nonassoc" . NONASSOC) ("%package" . PACKAGE) + ("%expectedconflicts" . EXPECTEDCONFLICTS) ("%provide" . PROVIDE) ("%prec" . PREC) ("%put" . PUT) @@ -111,239 +116,239 @@ (eval-when-compile (require 'semantic/wisent/comp)) (wisent-compile-grammar - '((DEFAULT-PREC NO-DEFAULT-PREC KEYWORD LANGUAGEMODE EXPECTEDCONFLICTS LEFT NONASSOC PACKAGE PROVIDE PREC PUT QUOTEMODE RIGHT SCOPESTART START TOKEN TYPE USE-MACROS STRING SYMBOL PERCENT_PERCENT CHARACTER PREFIXED_LIST SEXP PROLOGUE EPILOGUE PAREN_BLOCK BRACE_BLOCK LPAREN RPAREN LBRACE RBRACE COLON SEMI OR LT GT) + '((DEFAULT-PREC NO-DEFAULT-PREC KEYWORD LANGUAGEMODE LEFT NONASSOC PACKAGE EXPECTEDCONFLICTS PROVIDE PREC PUT QUOTEMODE RIGHT SCOPESTART START TOKEN TYPE USE-MACROS STRING SYMBOL PERCENT_PERCENT CHARACTER PREFIXED_LIST SEXP PROLOGUE EPILOGUE PAREN_BLOCK BRACE_BLOCK LPAREN RPAREN LBRACE RBRACE COLON SEMI OR LT GT) nil (grammar - ((prologue)) - ((epilogue)) - ((declaration)) - ((nonterminal)) - ((PERCENT_PERCENT))) + ((prologue)) + ((epilogue)) + ((declaration)) + ((nonterminal)) + ((PERCENT_PERCENT))) (prologue - ((PROLOGUE) - (wisent-raw-tag + ((PROLOGUE) + (wisent-raw-tag (semantic-tag-new-code "prologue" nil)))) (epilogue - ((EPILOGUE) - (wisent-raw-tag + ((EPILOGUE) + (wisent-raw-tag (semantic-tag-new-code "epilogue" nil)))) (declaration - ((decl) - (eval $1))) + ((decl) + (eval $1))) (decl - ((default_prec_decl)) - ((no_default_prec_decl)) - ((languagemode_decl)) - ((expectedconflicts_decl)) - ((package_decl)) - ((provide_decl)) - ((precedence_decl)) - ((put_decl)) - ((quotemode_decl)) - ((scopestart_decl)) - ((start_decl)) - ((keyword_decl)) - ((token_decl)) - ((type_decl)) - ((use_macros_decl))) + ((default_prec_decl)) + ((no_default_prec_decl)) + ((languagemode_decl)) + ((package_decl)) + ((expectedconflicts_decl)) + ((provide_decl)) + ((precedence_decl)) + ((put_decl)) + ((quotemode_decl)) + ((scopestart_decl)) + ((start_decl)) + ((keyword_decl)) + ((token_decl)) + ((type_decl)) + ((use_macros_decl))) (default_prec_decl - ((DEFAULT-PREC) + ((DEFAULT-PREC) `(wisent-raw-tag (semantic-tag "default-prec" 'assoc :value '("t"))))) (no_default_prec_decl - ((NO-DEFAULT-PREC) - `(wisent-raw-tag + ((NO-DEFAULT-PREC) + `(wisent-raw-tag (semantic-tag "default-prec" 'assoc :value - '("nil"))))) + '("nil"))))) (languagemode_decl - ((LANGUAGEMODE symbols) - `(wisent-raw-tag - (semantic-tag ',(car $2) - 'languagemode :rest ',(cdr $2))))) - (expectedconflicts_decl - ((EXPECTEDCONFLICTS symbols) - `(wisent-raw-tag + ((LANGUAGEMODE symbols) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'expectedconflicts :rest ',(cdr $2))))) + 'languagemode :rest ',(cdr $2))))) (package_decl - ((PACKAGE SYMBOL) - `(wisent-raw-tag + ((PACKAGE SYMBOL) + `(wisent-raw-tag (semantic-tag-new-package ',$2 nil)))) + (expectedconflicts_decl + ((EXPECTEDCONFLICTS symbols) + `(wisent-raw-tag + (semantic-tag ',(car $2) + 'expectedconflicts :rest ',(cdr $2))))) (provide_decl - ((PROVIDE SYMBOL) - `(wisent-raw-tag + ((PROVIDE SYMBOL) + `(wisent-raw-tag (semantic-tag ',$2 'provide)))) (precedence_decl - ((associativity token_type_opt items) - `(wisent-raw-tag + ((associativity token_type_opt items) + `(wisent-raw-tag (semantic-tag ',$1 'assoc :type ',$2 :value ',$3)))) (associativity - ((LEFT) - (progn "left")) - ((RIGHT) - (progn "right")) - ((NONASSOC) - (progn "nonassoc"))) + ((LEFT) + (progn "left")) + ((RIGHT) + (progn "right")) + ((NONASSOC) + (progn "nonassoc"))) (put_decl - ((PUT put_name put_value) - `(wisent-raw-tag + ((PUT put_name put_value) + `(wisent-raw-tag (semantic-tag ',$2 'put :value ',(list $3)))) - ((PUT put_name put_value_list) - `(wisent-raw-tag + ((PUT put_name put_value_list) + `(wisent-raw-tag (semantic-tag ',$2 'put :value ',$3))) - ((PUT put_name_list put_value) - `(wisent-raw-tag + ((PUT put_name_list put_value) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'put :rest ',(cdr $2) - :value ',(list $3)))) - ((PUT put_name_list put_value_list) - `(wisent-raw-tag + 'put :rest ',(cdr $2) + :value ',(list $3)))) + ((PUT put_name_list put_value_list) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'put :rest ',(cdr $2) - :value ',$3)))) + 'put :rest ',(cdr $2) + :value ',$3)))) (put_name_list - ((BRACE_BLOCK) - (mapcar 'semantic-tag-name - (semantic-parse-region + ((BRACE_BLOCK) + (mapcar 'semantic-tag-name + (semantic-parse-region (car $region1) (cdr $region1) 'put_names 1)))) (put_names - ((LBRACE) - nil) - ((RBRACE) - nil) - ((put_name) - (wisent-raw-tag + ((LBRACE) + nil) + ((RBRACE) + nil) + ((put_name) + (wisent-raw-tag (semantic-tag $1 'put-name)))) (put_name - ((SYMBOL)) - ((token_type))) + ((SYMBOL)) + ((token_type))) (put_value_list - ((BRACE_BLOCK) - (mapcar 'semantic-tag-code-detail - (semantic-parse-region + ((BRACE_BLOCK) + (mapcar 'semantic-tag-code-detail + (semantic-parse-region (car $region1) (cdr $region1) 'put_values 1)))) (put_values - ((LBRACE) - nil) - ((RBRACE) - nil) - ((put_value) - (wisent-raw-tag + ((LBRACE) + nil) + ((RBRACE) + nil) + ((put_value) + (wisent-raw-tag (semantic-tag-new-code "put-value" $1)))) (put_value - ((SYMBOL any_value) - (cons $1 $2))) + ((SYMBOL any_value) + (cons $1 $2))) (scopestart_decl - ((SCOPESTART SYMBOL) - `(wisent-raw-tag + ((SCOPESTART SYMBOL) + `(wisent-raw-tag (semantic-tag ',$2 'scopestart)))) (quotemode_decl - ((QUOTEMODE SYMBOL) - `(wisent-raw-tag + ((QUOTEMODE SYMBOL) + `(wisent-raw-tag (semantic-tag ',$2 'quotemode)))) (start_decl - ((START symbols) - `(wisent-raw-tag + ((START symbols) + `(wisent-raw-tag (semantic-tag ',(car $2) - 'start :rest ',(cdr $2))))) + 'start :rest ',(cdr $2))))) (keyword_decl - ((KEYWORD SYMBOL string_value) - `(wisent-raw-tag + ((KEYWORD SYMBOL string_value) + `(wisent-raw-tag (semantic-tag ',$2 'keyword :value ',$3)))) (token_decl - ((TOKEN token_type_opt SYMBOL string_value) - `(wisent-raw-tag + ((TOKEN token_type_opt SYMBOL string_value) + `(wisent-raw-tag (semantic-tag ',$3 ',(if $2 'token 'keyword) - :type ',$2 :value ',$4))) - ((TOKEN token_type_opt symbols) - `(wisent-raw-tag + :type ',$2 :value ',$4))) + ((TOKEN token_type_opt symbols) + `(wisent-raw-tag (semantic-tag ',(car $3) - 'token :type ',$2 :rest ',(cdr $3))))) + 'token :type ',$2 :rest ',(cdr $3))))) (token_type_opt - (nil) - ((token_type))) + (nil) + ((token_type))) (token_type - ((LT SYMBOL GT) - (progn $2))) + ((LT SYMBOL GT) + (progn $2))) (type_decl - ((TYPE token_type plist_opt) - `(wisent-raw-tag + ((TYPE token_type plist_opt) + `(wisent-raw-tag (semantic-tag ',$2 'type :value ',$3)))) (plist_opt - (nil) - ((plist))) + (nil) + ((plist))) (plist - ((plist put_value) - (append + ((plist put_value) + (append (list $2) $1)) - ((put_value) - (list $1))) + ((put_value) + (list $1))) (use_name_list - ((BRACE_BLOCK) - (mapcar 'semantic-tag-name - (semantic-parse-region + ((BRACE_BLOCK) + (mapcar 'semantic-tag-name + (semantic-parse-region (car $region1) (cdr $region1) 'use_names 1)))) (use_names - ((LBRACE) - nil) - ((RBRACE) - nil) - ((SYMBOL) - (wisent-raw-tag + ((LBRACE) + nil) + ((RBRACE) + nil) + ((SYMBOL) + (wisent-raw-tag (semantic-tag $1 'use-name)))) (use_macros_decl - ((USE-MACROS SYMBOL use_name_list) - `(wisent-raw-tag + ((USE-MACROS SYMBOL use_name_list) + `(wisent-raw-tag (semantic-tag "macro" 'macro :type ',$2 :value ',$3)))) (string_value - ((STRING) - (read $1))) + ((STRING) + (read $1))) (any_value - ((SYMBOL)) - ((STRING)) - ((PAREN_BLOCK)) - ((PREFIXED_LIST)) - ((SEXP))) + ((SYMBOL)) + ((STRING)) + ((PAREN_BLOCK)) + ((PREFIXED_LIST)) + ((SEXP))) (symbols - ((lifo_symbols) - (nreverse $1))) + ((lifo_symbols) + (nreverse $1))) (lifo_symbols - ((lifo_symbols SYMBOL) - (cons $2 $1)) - ((SYMBOL) - (list $1))) + ((lifo_symbols SYMBOL) + (cons $2 $1)) + ((SYMBOL) + (list $1))) (nonterminal - ((SYMBOL + ((SYMBOL (setq semantic-grammar-wy--nterm $1 semantic-grammar-wy--rindx 0) COLON rules SEMI) - (wisent-raw-tag + (wisent-raw-tag (semantic-tag $1 'nonterminal :children $4)))) (rules - ((lifo_rules) - (apply 'nconc - (nreverse $1)))) + ((lifo_rules) + (apply 'nconc + (nreverse $1)))) (lifo_rules - ((lifo_rules OR rule) - (cons $3 $1)) - ((rule) - (list $1))) + ((lifo_rules OR rule) + (cons $3 $1)) + ((rule) + (list $1))) (rule - ((rhs) - (let* + ((rhs) + (let* ((nterm semantic-grammar-wy--nterm) (rindx semantic-grammar-wy--rindx) (rhs $1) comps prec action elt) (setq semantic-grammar-wy--rindx - (1+ semantic-grammar-wy--rindx)) + (1+ semantic-grammar-wy--rindx)) (while rhs (setq elt (car rhs) @@ -359,10 +364,10 @@ (if (or action comps) (setq comps - (cons elt comps) - semantic-grammar-wy--rindx - (1+ semantic-grammar-wy--rindx)) - (setq action + (cons elt comps) + semantic-grammar-wy--rindx + (1+ semantic-grammar-wy--rindx)) + (setq action (car elt)))) (t (setq comps @@ -375,46 +380,46 @@ (if comps "group" "empty") :value comps :prec prec :expr action)))))) (rhs - (nil) - ((rhs item) - (cons $2 $1)) - ((rhs action) - (cons + (nil) + ((rhs item) + (cons $2 $1)) + ((rhs action) + (cons (list $2) $1)) - ((rhs PREC item) - (cons + ((rhs PREC item) + (cons (vector $3) $1))) (action - ((PAREN_BLOCK)) - ((PREFIXED_LIST)) - ((BRACE_BLOCK) - (format "(progn\n%s)" - (let + ((PAREN_BLOCK)) + ((PREFIXED_LIST)) + ((BRACE_BLOCK) + (format "(progn\n%s)" + (let ((s $1)) (if - (string-match "^{[\r\n\t ]*" s) + (string-match "^{[
\n ]*" s) (setq s (substring s - (match-end 0)))) + (match-end 0)))) (if - (string-match "[\r\n\t ]*}$" s) + (string-match "[
\n ]*}$" s) (setq s (substring s 0 - (match-beginning 0)))) + (match-beginning 0)))) s)))) (items - ((lifo_items) - (nreverse $1))) + ((lifo_items) + (nreverse $1))) (lifo_items - ((lifo_items item) - (cons $2 $1)) - ((item) - (list $1))) + ((lifo_items item) + (cons $2 $1)) + ((item) + (list $1))) (item - ((SYMBOL)) - ((CHARACTER)))) + ((SYMBOL)) + ((CHARACTER)))) '(grammar prologue epilogue declaration nonterminal rule put_names put_values use_names))) "Parser table.") @@ -423,25 +428,26 @@ (semantic-install-function-overrides '((semantic-parse-stream . wisent-parse-stream))) (setq semantic-parser-name "LALR" - semantic--parse-table semantic-grammar-wy--parse-table - semantic-debug-parser-source "grammar.wy" - semantic-flex-keywords-obarray semantic-grammar-wy--keyword-table - semantic-lex-types-obarray semantic-grammar-wy--token-table) + semantic--parse-table semantic-grammar-wy--parse-table + semantic-debug-parser-source "grammar.wy" + semantic-flex-keywords-obarray semantic-grammar-wy--keyword-table + semantic-lex-types-obarray semantic-grammar-wy--token-table) ;; Collect unmatched syntax lexical tokens (add-hook 'wisent-discarding-token-functions - 'wisent-collect-unmatched-syntax nil t)) + 'wisent-collect-unmatched-syntax nil t)) ;;; Analyzers ;; -(define-lex-block-type-analyzer semantic-grammar-wy--<block>-block-analyzer - "block analyzer for <block> tokens." - "\\s(\\|\\s)" - '((("(" LPAREN PAREN_BLOCK) - ("{" LBRACE BRACE_BLOCK)) - (")" RPAREN) - ("}" RBRACE)) - ) +(define-lex-regex-type-analyzer semantic-grammar-wy--<symbol>-regexp-analyzer + "regexp analyzer for <symbol> tokens." + ":?\\(\\sw\\|\\s_\\)+" + '((PERCENT_PERCENT . "\\`%%\\'")) + 'SYMBOL) + +(define-lex-keyword-type-analyzer semantic-grammar-wy--<keyword>-keyword-analyzer + "keyword analyzer for <keyword> tokens." + "\\(\\sw\\|\\s_\\)+") (define-lex-regex-type-analyzer semantic-grammar-wy--<char>-regexp-analyzer "regexp analyzer for <char> tokens." @@ -449,21 +455,19 @@ nil 'CHARACTER) -(define-lex-regex-type-analyzer semantic-grammar-wy--<symbol>-regexp-analyzer - "regexp analyzer for <symbol> tokens." - ":?\\(\\sw\\|\\s_\\)+" - '((PERCENT_PERCENT . "\\`%%\\'")) - 'SYMBOL) - (define-lex-sexp-type-analyzer semantic-grammar-wy--<qlist>-sexp-analyzer "sexp analyzer for <qlist> tokens." "\\s'\\s-*(" 'PREFIXED_LIST) -(define-lex-sexp-type-analyzer semantic-grammar-wy--<string>-sexp-analyzer - "sexp analyzer for <string> tokens." - "\\s\"" - 'STRING) +(define-lex-block-type-analyzer semantic-grammar-wy--<block>-block-analyzer + "block analyzer for <block> tokens." + "\\s(\\|\\s)" + '((("(" LPAREN PAREN_BLOCK) + ("{" LBRACE BRACE_BLOCK)) + (")" RPAREN) + ("}" RBRACE)) + ) (define-lex-string-type-analyzer semantic-grammar-wy--<punctuation>-string-analyzer "string analyzer for <punctuation> tokens." @@ -475,9 +479,10 @@ (COLON . ":")) 'punctuation) -(define-lex-keyword-type-analyzer semantic-grammar-wy--<keyword>-keyword-analyzer - "keyword analyzer for <keyword> tokens." - "\\(\\sw\\|\\s_\\)+") +(define-lex-sexp-type-analyzer semantic-grammar-wy--<string>-sexp-analyzer + "sexp analyzer for <string> tokens." + "\\s\"" + 'STRING) (define-lex-sexp-type-analyzer semantic-grammar-wy--<sexp>-sexp-analyzer "sexp analyzer for <sexp> tokens." @@ -493,4 +498,9 @@ (provide 'semantic/grammar-wy) +;; Local Variables: +;; version-control: never +;; no-update-autoloads: t +;; End: + ;;; semantic/grammar-wy.el ends here diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el index 5af4607abb8..0f997474ded 100644 --- a/lisp/cedet/semantic/idle.el +++ b/lisp/cedet/semantic/idle.el @@ -47,8 +47,6 @@ ;; For the semantic-find-tags-by-name macro. (eval-when-compile (require 'semantic/find)) -(defvar eldoc-last-message) -(declare-function eldoc-message "eldoc") (declare-function semantic-analyze-unsplit-name "semantic/analyze/fcn") (declare-function semantic-complete-analyze-inline-idle "semantic/complete") (declare-function semanticdb-deep-find-tags-by-name "semantic/db-find") @@ -730,8 +728,8 @@ specific to a major mode. For example, in jde mode: :group 'semantic :type 'hook) -(defun semantic-idle-summary-idle-function () - "Display a tag summary of the lexical token under the cursor. +(defun semantic--eldoc-info (_callback &rest _) + "Return the eldoc info for the current symbol. Call `semantic-idle-summary-current-symbol-info' for getting the current tag to display information." (or (eq major-mode 'emacs-lisp-mode) @@ -741,21 +739,7 @@ current tag to display information." ((semantic-tag-p found) (funcall semantic-idle-summary-function found nil t))))) - ;; Show the message with eldoc functions - (unless (and str (boundp 'eldoc-echo-area-use-multiline-p) - eldoc-echo-area-use-multiline-p) - (let ((w (1- (window-width (minibuffer-window))))) - (if (> (length str) w) - (setq str (substring str 0 w))))) - ;; I borrowed some bits from eldoc to shorten the - ;; message. - (when semantic-idle-truncate-long-summaries - (let ((ea-width (1- (window-width (minibuffer-window)))) - (strlen (length str))) - (when (> strlen ea-width) - (setq str (substring str 0 ea-width))))) - ;; Display it - (eldoc-message str)))) + str))) (define-minor-mode semantic-idle-summary-mode "Toggle Semantic Idle Summary mode. @@ -764,30 +748,16 @@ When this minor mode is enabled, the echo area displays a summary of the lexical token at point whenever Emacs is idle." :group 'semantic :group 'semantic-modes - (if semantic-idle-summary-mode - ;; Enable the mode - (progn - (unless (and (featurep 'semantic) (semantic-active-p)) - ;; Disable minor mode if semantic stuff not available - (setq semantic-idle-summary-mode nil) - (error "Buffer %s was not set up for parsing" - (buffer-name))) - (require 'eldoc) - (semantic-idle-scheduler-add 'semantic-idle-summary-idle-function) - (add-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)) - ;; Disable the mode - (semantic-idle-scheduler-remove 'semantic-idle-summary-idle-function) - (remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t))) - -(defun semantic-idle-summary-refresh-echo-area () - (and semantic-idle-summary-mode - eldoc-last-message - (if (and (not executing-kbd-macro) - (not (and (boundp 'edebug-active) edebug-active)) - (not cursor-in-echo-area) - (not (eq (selected-window) (minibuffer-window)))) - (eldoc-message eldoc-last-message) - (setq eldoc-last-message nil)))) + (remove-hook 'eldoc-documentation-functions #'semantic--eldoc-info t) + (when semantic-idle-summary-mode + ;; Enable the mode + (unless (and (featurep 'semantic) (semantic-active-p)) + ;; Disable minor mode if semantic stuff not available + (setq semantic-idle-summary-mode nil) + (error "Buffer %s was not set up for parsing" + (buffer-name))) + (add-hook 'eldoc-documentation-functions #'semantic--eldoc-info nil t) + (eldoc-mode 1))) (semantic-add-minor-mode 'semantic-idle-summary-mode "") @@ -1092,7 +1062,7 @@ be called." ;; mouse-3 pops up a context menu (define-key map [ header-line mouse-3 ] - 'semantic-idle-breadcrumbs--popup-menu) + #'semantic-idle-breadcrumbs--popup-menu) map) "Keymap for semantic idle breadcrumbs minor mode.") diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el index 3d7bce8657a..a99e2ab279b 100644 --- a/lisp/cedet/semantic/tag.el +++ b/lisp/cedet/semantic/tag.el @@ -229,6 +229,28 @@ See also the function `semantic-ctxt-current-mode'." (require 'semantic/ctxt) (semantic-ctxt-current-mode))))) +;; Is this function still necessary? +(defun semantic-tag-make-plist (args) + "Create a property list with ARGS. +Args is a property list of the form (KEY1 VALUE1 ... KEYN VALUEN). +Where KEY is a symbol, and VALUE is the value for that symbol. +The return value will be a new property list, with these KEY/VALUE +pairs eliminated: + + - KEY associated to nil VALUE. + - KEY associated to an empty string VALUE. + - KEY associated to a zero VALUE." + (let (plist key val) + (while args + (setq key (car args) + val (nth 1 args) + args (nthcdr 2 args)) + (or (member val '("" nil)) + (and (numberp val) (zerop val)) + (setq plist (cons key (cons val plist))))) + ;; It is not useful to reverse the new plist. + plist)) + (defsubst semantic--tag-attributes-cdr (tag) "Return the cons cell whose car is the ATTRIBUTES part of TAG. That function is for internal use only." @@ -441,28 +463,6 @@ class to store those methods." ;;; Tag creation ;; -;; Is this function still necessary? -(defun semantic-tag-make-plist (args) - "Create a property list with ARGS. -Args is a property list of the form (KEY1 VALUE1 ... KEYN VALUEN). -Where KEY is a symbol, and VALUE is the value for that symbol. -The return value will be a new property list, with these KEY/VALUE -pairs eliminated: - - - KEY associated to nil VALUE. - - KEY associated to an empty string VALUE. - - KEY associated to a zero VALUE." - (let (plist key val) - (while args - (setq key (car args) - val (nth 1 args) - args (nthcdr 2 args)) - (or (member val '("" nil)) - (and (numberp val) (zerop val)) - (setq plist (cons key (cons val plist))))) - ;; It is not useful to reverse the new plist. - plist)) - (defsubst semantic-tag (name class &rest attributes) "Create a generic semantic tag. NAME is a string representing the name of this tag. diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el index cfd4899186b..edc5c5c7029 100644 --- a/lisp/cedet/semantic/wisent/grammar.el +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -1,4 +1,4 @@ -;;; semantic/wisent/grammar.el --- Wisent's input grammar mode +;;; semantic/wisent/grammar.el --- Wisent's input grammar mode -*- lexical-binding: t; -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. ;; @@ -228,7 +228,7 @@ Keep order of declaration in the WY file without duplicates." Return the expanded expression." (if (or (atom expr) (semantic-grammar-quote-p (car expr))) expr ;; Just return atom or quoted expression. - (let* ((expr (mapcar 'wisent-grammar-expand-macros expr)) + (let* ((expr (mapcar #'wisent-grammar-expand-macros expr)) (macro (assq (car expr) wisent--grammar-macros))) (if macro ;; Expand Semantic built-in. (apply (cdr macro) (cdr expr)) @@ -514,7 +514,8 @@ Menu items are appended to the common grammar menu.") (goto-char (point-min)) (delete-region (point-min) (line-end-position)) (insert ";;; " packagename - " --- Generated parser support file") + " --- Generated parser support file " + "-*- lexical-binding:t -*-") (re-search-forward ";;; \\(.*\\) ends here") (replace-match packagename nil nil nil 1) (delete-trailing-whitespace)))))) diff --git a/lisp/cedet/srecode/args.el b/lisp/cedet/srecode/args.el index 24c5f22f2e7..79d2700c5d9 100644 --- a/lisp/cedet/srecode/args.el +++ b/lisp/cedet/srecode/args.el @@ -1,4 +1,4 @@ -;;; srecode/args.el --- Provide some simple template arguments +;;; srecode/args.el --- Provide some simple template arguments -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el index 7146b643836..36df1da9e33 100644 --- a/lisp/cedet/srecode/compile.el +++ b/lisp/cedet/srecode/compile.el @@ -1,4 +1,4 @@ -;;; srecode/compile --- Compilation of srecode template files. +;;; srecode/compile --- Compilation of srecode template files. -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc. @@ -499,7 +499,7 @@ PROPS are additional properties that might need to be passed to the inserter constructor." ;;(message "Compile: %s %S" name props) (if (not key) - (apply 'srecode-template-inserter-variable name props) + (apply #'make-instance 'srecode-template-inserter-variable name props) (let ((classes (eieio-class-children 'srecode-template-inserter)) (new nil)) ;; Loop over the various subclasses and @@ -510,7 +510,7 @@ to the inserter constructor." (when (and (not (class-abstract-p (car classes))) (equal (oref-default (car classes) key) key)) ;; Create the new class, and apply state. - (setq new (apply (car classes) name props)) + (setq new (apply #'make-instance (car classes) name props)) (srecode-inserter-apply-state new STATE) ) (setq classes (cdr classes))) diff --git a/lisp/cedet/srecode/cpp.el b/lisp/cedet/srecode/cpp.el index 1b9610f3f1b..3f66898c9cc 100644 --- a/lisp/cedet/srecode/cpp.el +++ b/lisp/cedet/srecode/cpp.el @@ -1,4 +1,4 @@ -;;; srecode/cpp.el --- C++ specific handlers for Semantic Recoder +;;; srecode/cpp.el --- C++ specific handlers for Semantic Recoder -*- lexical-binding: t; -*- ;; Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. @@ -44,7 +44,6 @@ A dictionary entry of the named PREFIX_NAMESPACE with the value NAMESPACE:: is created for each namespace unless the current buffer contains a using NAMESPACE; statement." - :group 'srecode-cpp :type '(repeat string)) ;;; :c ARGUMENT HANDLING diff --git a/lisp/cedet/srecode/ctxt.el b/lisp/cedet/srecode/ctxt.el index 20334f95838..c49237b94cf 100644 --- a/lisp/cedet/srecode/ctxt.el +++ b/lisp/cedet/srecode/ctxt.el @@ -1,4 +1,4 @@ -;;; srecode/ctxt.el --- Derive a context from the source buffer. +;;; srecode/ctxt.el --- Derive a context from the source buffer. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el index c1fe4b2c34e..5da045e17f1 100644 --- a/lisp/cedet/srecode/dictionary.el +++ b/lisp/cedet/srecode/dictionary.el @@ -1,4 +1,4 @@ -;;; srecode/dictionary.el --- Dictionary code for the semantic recoder. +;;; srecode/dictionary.el --- Dictionary code for the semantic recoder. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -443,8 +443,8 @@ The root dictionary is usually for a current or active insertion." ;; for use in converting the compound value into something insertable. (cl-defmethod srecode-compound-toString ((cp srecode-dictionary-compound-value) - function - dictionary) + _function + _dictionary) "Convert the compound dictionary value CP to a string. If FUNCTION is non-nil, then FUNCTION is somehow applied to an aspect of the compound value. The FUNCTION could be a fraction @@ -457,14 +457,15 @@ standard out is a buffer, and using `insert'." (eieio-object-name cp)) (cl-defmethod srecode-dump ((cp srecode-dictionary-compound-value) - &optional indent) + &optional _indent) "Display information about this compound value." (princ (eieio-object-name cp)) ) -(cl-defmethod srecode-compound-toString ((cp srecode-dictionary-compound-variable) - function - dictionary) +(cl-defmethod srecode-compound-toString + ((cp srecode-dictionary-compound-variable) + _function + dictionary) "Convert the compound dictionary variable value CP into a string. FUNCTION and DICTIONARY are as for the baseclass." (require 'srecode/insert) @@ -606,9 +607,9 @@ STATE is the current compiler state." (require 'srecode/find) (let* ((modesym major-mode) (start (current-time)) - (junk (or (progn (srecode-load-tables-for-mode modesym) - (srecode-get-mode-table modesym)) - (error "No table found for mode %S" modesym))) + (_ (or (progn (srecode-load-tables-for-mode modesym) + (srecode-get-mode-table modesym)) + (error "No table found for mode %S" modesym))) (dict (srecode-create-dictionary (current-buffer))) ) (message "Creating a dictionary took %.2f seconds." diff --git a/lisp/cedet/srecode/document.el b/lisp/cedet/srecode/document.el index 0d1a4c01d3c..270b80d9013 100644 --- a/lisp/cedet/srecode/document.el +++ b/lisp/cedet/srecode/document.el @@ -1,4 +1,4 @@ -;;; srecode/document.el --- Documentation (comment) generation +;;; srecode/document.el --- Documentation (comment) generation -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -88,7 +88,6 @@ versions of names. This is an alist with each element of the form: (MATCH . RESULT) MATCH is a regexp to match in the type field. RESULT is a string." - :group 'document :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) @@ -144,7 +143,6 @@ A string may end in a space, in which case, last-alist is searched to see how best to describe what can be returned. Doesn't always work correctly, but that is just because English doesn't always work correctly." - :group 'document :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) @@ -175,7 +173,6 @@ versions of names. This is an alist with each element of the form: (MATCH . RESULT) MATCH is a regexp to match in the type field. RESULT is a string." - :group 'document :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) @@ -192,7 +189,6 @@ This is an alist with each element of the form: (MATCH . RESULT) MATCH is a regexp to match in the type field. RESULT is a string." - :group 'document :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) @@ -213,7 +209,6 @@ This is an alist with each element of the form: MATCH is a regexp to match in the type field. RESULT is a string, which can contain %s, which is replaced with `match-string' 1." - :group 'document :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) @@ -233,7 +228,6 @@ MATCH is a regexp to match in the type field. RESULT is a string of text to use to describe MATCH. When one is encountered, document-insert-parameters will automatically place this comment after the parameter name." - :group 'document :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) @@ -258,7 +252,6 @@ This is an alist with each element of the form: (MATCH . RESULT) MATCH is a regexp to match in the type field. RESULT is a string." - :group 'document :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) @@ -716,7 +709,7 @@ allocating something based on its type." (setq al (cdr al))))) news)) -(defun srecode-document-parameter-comment (param &optional commentlist) +(defun srecode-document-parameter-comment (param &optional _commentlist) "Convert tag or string PARAM into a name,comment pair. Optional COMMENTLIST is list of previously existing comments to use instead in alist form. If the name doesn't appear in the list of diff --git a/lisp/cedet/srecode/el.el b/lisp/cedet/srecode/el.el index 7e9dd10fd42..974a4fac727 100644 --- a/lisp/cedet/srecode/el.el +++ b/lisp/cedet/srecode/el.el @@ -1,4 +1,4 @@ -;;; srecode/el.el --- Emacs Lisp specific arguments +;;; srecode/el.el --- Emacs Lisp specific arguments -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/srecode/expandproto.el b/lisp/cedet/srecode/expandproto.el index cdb29d16b71..a40d5aec24d 100644 --- a/lisp/cedet/srecode/expandproto.el +++ b/lisp/cedet/srecode/expandproto.el @@ -1,4 +1,4 @@ -;;; srecode/expandproto.el --- Expanding prototypes. +;;; srecode/expandproto.el --- Expanding prototypes. -*- lexical-binding: t; -*- ;; Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/srecode/extract.el b/lisp/cedet/srecode/extract.el index 625b854b776..9e6a98fd769 100644 --- a/lisp/cedet/srecode/extract.el +++ b/lisp/cedet/srecode/extract.el @@ -1,4 +1,4 @@ -;;; srecode/extract.el --- Extract content from previously inserted macro. +;;; srecode/extract.el --- Extract content from previously inserted macro. -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -139,24 +139,24 @@ Uses STATE to maintain the current extraction state." ;;; Inserter Base Extractors ;; -(cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter)) +(cl-defmethod srecode-inserter-do-extract-p ((_ins srecode-template-inserter)) "Return non-nil if this inserter can extract values." nil) -(cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter) - start end dict state) +(cl-defmethod srecode-inserter-extract ((_ins srecode-template-inserter) + _start _end _dict _state) "Extract text from START/END and store in DICT. Return nil as this inserter will extract nothing." nil) ;;; Variable extractor is simple and can extract later. ;; -(cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-variable)) +(cl-defmethod srecode-inserter-do-extract-p ((_ins srecode-template-inserter-variable)) "Return non-nil if this inserter can extract values." 'later) (cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-variable) - start end vdict state) + start end vdict _state) "Extract text from START/END and store in VDICT. Return t if something was extracted. Return nil if this inserter doesn't need to extract anything." @@ -168,12 +168,12 @@ Return nil if this inserter doesn't need to extract anything." ;;; Section Inserter ;; -(cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-section-start)) +(cl-defmethod srecode-inserter-do-extract-p ((_ins srecode-template-inserter-section-start)) "Return non-nil if this inserter can extract values." 'now) (cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-section-start) - start end indict state) + _start _end indict state) "Extract text from START/END and store in INDICT. Return the starting location of the first plain-text match. Return nil if nothing was extracted." @@ -201,12 +201,12 @@ Return nil if nothing was extracted." ;;; Include Extractor must extract now. ;; -(cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-include)) +(cl-defmethod srecode-inserter-do-extract-p ((_ins srecode-template-inserter-include)) "Return non-nil if this inserter can extract values." 'now) (cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-include) - start end dict state) + start _end dict state) "Extract text from START/END and store in DICT. Return the starting location of the first plain-text match. Return nil if nothing was extracted." diff --git a/lisp/cedet/srecode/fields.el b/lisp/cedet/srecode/fields.el index 71613bcc2a3..e65e3194320 100644 --- a/lisp/cedet/srecode/fields.el +++ b/lisp/cedet/srecode/fields.el @@ -1,4 +1,4 @@ -;;; srecode/fields.el --- Handling type-in fields in a buffer. +;;; srecode/fields.el --- Handling type-in fields in a buffer. -*- lexical-binding: t; -*- ;; ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. ;; @@ -193,7 +193,7 @@ If SET-TO is a string, then replace the text of OLAID with SET-TO." "Manage a buffer region in which fields exist.") (cl-defmethod initialize-instance ((ir srecode-template-inserted-region) - &rest args) + &rest _args) "Initialize IR, capturing the active fields, and creating the overlay." ;; Fill in the fields (oset ir fields srecode-field-archive) @@ -221,7 +221,7 @@ If SET-TO is a string, then replace the text of OLAID with SET-TO." (oset ir active-region ir) ;; Setup the post command hook. - (add-hook 'post-command-hook 'srecode-field-post-command t t) + (add-hook 'post-command-hook #'srecode-field-post-command t t) ) (cl-defmethod srecode-delete ((ir srecode-template-inserted-region)) @@ -229,12 +229,11 @@ If SET-TO is a string, then replace the text of OLAID with SET-TO." ;; Clear us out of the baseclass. (oset ir active-region nil) ;; Clear our fields. - (mapc 'srecode-delete (oref ir fields)) + (mapc #'srecode-delete (oref ir fields)) ;; Call to our base (cl-call-next-method) ;; Clear our hook. - (remove-hook 'post-command-hook 'srecode-field-post-command t) - ) + (remove-hook 'post-command-hook #'srecode-field-post-command t)) (defsubst srecode-active-template-region () "Return the active region for template fields." @@ -246,7 +245,7 @@ If SET-TO is a string, then replace the text of OLAID with SET-TO." ) (if (not ar) ;; Find a bug and fix it. - (remove-hook 'post-command-hook 'srecode-field-post-command t) + (remove-hook 'post-command-hook #'srecode-field-post-command t) (if (srecode-point-in-region-p ar) nil ;; Keep going ;; We moved out of the template. Cancel the edits. @@ -277,16 +276,16 @@ Try to use this to provide useful completion when available.") (defvar srecode-field-keymap (let ((km (make-sparse-keymap))) - (define-key km "\C-i" 'srecode-field-next) - (define-key km "\M-\C-i" 'srecode-field-prev) - (define-key km "\C-e" 'srecode-field-end) - (define-key km "\C-a" 'srecode-field-start) - (define-key km "\M-m" 'srecode-field-start) - (define-key km "\C-c\C-c" 'srecode-field-exit-ask) + (define-key km "\C-i" #'srecode-field-next) + (define-key km "\M-\C-i" #'srecode-field-prev) + (define-key km "\C-e" #'srecode-field-end) + (define-key km "\C-a" #'srecode-field-start) + (define-key km "\M-m" #'srecode-field-start) + (define-key km "\C-c\C-c" #'srecode-field-exit-ask) km) "Keymap applied to field overlays.") -(cl-defmethod initialize-instance ((field srecode-field) &optional args) +(cl-defmethod initialize-instance ((field srecode-field) &optional _args) "Initialize FIELD, being sure it archived." (add-to-list 'srecode-field-archive field t) (cl-call-next-method) @@ -327,7 +326,7 @@ Try to use this to provide useful completion when available.") (defvar srecode-field-replication-max-size 100 "Maximum size of a field before canceling replication.") -(defun srecode-field-mod-hook (ol after start end &optional pre-len) +(defun srecode-field-mod-hook (ol after _start _end &optional _pre-len) "Modification hook for the field overlay. OL is the overlay. AFTER is non-nil if it is called after the change. @@ -374,7 +373,7 @@ AFTER is non-nil if it is called after the change. START and END are the bounds of the change. PRE-LEN is used in the after mode for the length of the changed text." (when after - (let* ((field (overlay-get ol 'srecode)) + (let* (;; (field (overlay-get ol 'srecode)) ) (move-overlay ol (overlay-start ol) end) (srecode-field-mod-hook ol after start end pre-len)) diff --git a/lisp/cedet/srecode/filters.el b/lisp/cedet/srecode/filters.el index 4a996cf6f12..b76ce2c94bf 100644 --- a/lisp/cedet/srecode/filters.el +++ b/lisp/cedet/srecode/filters.el @@ -1,4 +1,4 @@ -;;; srecode/filters.el --- Filters for use in template variables. +;;; srecode/filters.el --- Filters for use in template variables. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/srecode/find.el b/lisp/cedet/srecode/find.el index aec73dce5a5..1c208d0f328 100644 --- a/lisp/cedet/srecode/find.el +++ b/lisp/cedet/srecode/find.el @@ -1,4 +1,4 @@ -;;;; srecode/find.el --- Tools for finding templates in the database. +;;;; srecode/find.el --- Tools for finding templates in the database. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -58,17 +58,14 @@ See `srecode-get-maps' for more. APPNAME is the name of an application. In this case, all template files for that application will be loaded." (let ((files - (if appname - (apply 'append - (mapcar + (apply #'append + (mapcar + (if appname (lambda (map) (srecode-map-entries-for-app-and-mode map appname mmode)) - (srecode-get-maps))) - (apply 'append - (mapcar (lambda (map) - (srecode-map-entries-for-mode map mmode)) - (srecode-get-maps))))) + (srecode-map-entries-for-mode map mmode))) + (srecode-get-maps)))) ) ;; Don't recurse if we are already the 'default state. (when (not (eq mmode 'default)) @@ -112,8 +109,8 @@ If TAB is nil, then always return t." ;; Find a given template based on name, and features of the current ;; buffer. (cl-defmethod srecode-template-get-table ((tab srecode-template-table) - template-name &optional - context application) + template-name &optional + context _application) "Find in the template in table TAB, the template with TEMPLATE-NAME. Optional argument CONTEXT specifies that the template should part of a particular context. @@ -218,7 +215,7 @@ tables that do not belong to an application will be searched." (defvar srecode-read-template-name-history nil "History for completing reads for template names.") -(defun srecode-user-template-p (template) +(defun srecode-user-template-p (_template) "Non-nil if TEMPLATE is intended for user insertion. Templates not matching this predicate are used for code generation or other internal purposes." @@ -264,7 +261,7 @@ with `srecode-calculate-context'." ;; the prefix for the completing read (concat (nth 0 ctxt) ":")))) -(defun srecode-read-template-name (prompt &optional initial hist default) +(defun srecode-read-template-name (prompt &optional initial hist _default) "Completing read for Semantic Recoder template names. PROMPT is used to query for the name of the template desired. INITIAL is the initial string to use. diff --git a/lisp/cedet/srecode/getset.el b/lisp/cedet/srecode/getset.el index 1e4888655f9..ce4c818c709 100644 --- a/lisp/cedet/srecode/getset.el +++ b/lisp/cedet/srecode/getset.el @@ -1,4 +1,4 @@ -;;; srecode/getset.el --- Package for inserting new get/set methods. +;;; srecode/getset.el --- Package for inserting new get/set methods. -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -33,6 +33,8 @@ (defvar srecode-insert-getset-fully-automatic-flag nil "Non-nil means accept choices srecode comes up with without asking.") +(defvar srecode-semantic-selected-tag) + ;;;###autoload (defun srecode-insert-getset (&optional class-in field-in) "Insert get/set methods for the current class. diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el index 768d48a7c5b..0f0a80ee299 100644 --- a/lisp/cedet/srecode/java.el +++ b/lisp/cedet/srecode/java.el @@ -1,4 +1,4 @@ -;;; srecode/java.el --- Srecode Java support +;;; srecode/java.el --- Srecode Java support -*- lexical-binding: t; -*- ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el index a94db0bb8d9..254b15e6e04 100644 --- a/lisp/cedet/srecode/map.el +++ b/lisp/cedet/srecode/map.el @@ -1,4 +1,4 @@ -;;; srecode/map.el --- Manage a template file map +;;; srecode/map.el --- Manage a template file map -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -245,7 +245,7 @@ Optional argument RESET forces a reset of the current map." (princ "\n") )) -(defun srecode-map-file-still-valid-p (filename map) +(defun srecode-map-file-still-valid-p (filename _map) "Return t if FILENAME should be in MAP still." (let ((valid nil)) (and (file-exists-p filename) @@ -407,7 +407,7 @@ Return non-nil if the map changed." "Global load path for SRecode template files." :group 'srecode :type '(repeat file) - :set 'srecode-map-load-path-set) + :set #'srecode-map-load-path-set) (provide 'srecode/map) diff --git a/lisp/cedet/srecode/mode.el b/lisp/cedet/srecode/mode.el index 159dc7a999b..022a5db8f2b 100644 --- a/lisp/cedet/srecode/mode.el +++ b/lisp/cedet/srecode/mode.el @@ -1,4 +1,4 @@ -;;; srecode/mode.el --- Minor mode for managing and using SRecode templates +;;; srecode/mode.el --- Minor mode for managing and using SRecode templates -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -54,14 +54,14 @@ (defvar srecode-prefix-map (let ((km (make-sparse-keymap))) ;; Basic template codes - (define-key km "/" 'srecode-insert) - (define-key km [insert] 'srecode-insert) - (define-key km "." 'srecode-insert-again) - (define-key km "E" 'srecode-edit) + (define-key km "/" #'srecode-insert) + (define-key km [insert] #'srecode-insert) + (define-key km "." #'srecode-insert-again) + (define-key km "E" #'srecode-edit) ;; Template indirect binding (let ((k ?a)) (while (<= k ?z) - (define-key km (format "%c" k) 'srecode-bind-insert) + (define-key km (format "%c" k) #'srecode-bind-insert) (setq k (1+ k)))) km) "Keymap used behind the srecode prefix key in srecode minor mode.") @@ -141,16 +141,17 @@ non-nil if the minor mode is enabled. ;; this mode first. (if srecode-minor-mode (if (not (apply - 'append + #'append (mapcar (lambda (map) (srecode-map-entries-for-mode map major-mode)) (srecode-get-maps)))) (setq srecode-minor-mode nil) ;; Else, we have success, do stuff - (add-hook 'cedet-m3-menu-do-hooks 'srecode-m3-items nil t) - ) - (remove-hook 'cedet-m3-menu-do-hooks 'srecode-m3-items t) - ) + ;; FIXME: Where are `cedet-m3-menu-do-hooks' nor `srecode-m3-items'? + (when (fboundp 'srecode-m3-items) + (add-hook 'cedet-m3-menu-do-hooks #'srecode-m3-items nil t))) + (when (fboundp 'srecode-m3-items) + (remove-hook 'cedet-m3-menu-do-hooks #'srecode-m3-items t))) ;; Run hooks if we are turning this on. (when srecode-minor-mode (run-hooks 'srecode-minor-mode-hook)) @@ -170,7 +171,7 @@ non-nil if the minor mode is enabled. ;;; Menu Filters ;; -(defun srecode-minor-mode-templates-menu (menu-def) +(defun srecode-minor-mode-templates-menu (_menu-def) "Create a menu item of cascading filters active for this mode. MENU-DEF is the menu to bind this into." ;; Doing this SEGVs Emacs on windows. @@ -246,7 +247,7 @@ MENU-DEF is the menu to bind this into." (defvar srecode-minor-mode-generators nil "List of code generators to be displayed in the srecoder menu.") -(defun srecode-minor-mode-generate-menu (menu-def) +(defun srecode-minor-mode-generate-menu (_menu-def) "Create a menu item of cascading filters active for this mode. MENU-DEF is the menu to bind this into." ;; Doing this SEGVs Emacs on windows. diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el index bbe1e5e469c..71579158494 100644 --- a/lisp/cedet/srecode/srt-mode.el +++ b/lisp/cedet/srecode/srt-mode.el @@ -1,4 +1,4 @@ -;;; srecode/srt-mode.el --- Major mode for writing screcode macros +;;; srecode/srt-mode.el --- Major mode for writing screcode macros -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc. @@ -181,9 +181,9 @@ we can tell font lock about them.") (defvar srecode-template-mode-map (let ((km (make-sparse-keymap))) - (define-key km "\C-c\C-c" 'srecode-compile-templates) - (define-key km "\C-c\C-m" 'srecode-macro-help) - (define-key km "/" 'srecode-self-insert-complete-end-macro) + (define-key km "\C-c\C-c" #'srecode-compile-templates) + (define-key km "\C-c\C-m" #'srecode-macro-help) + (define-key km "/" #'srecode-self-insert-complete-end-macro) km) "Keymap used in srecode mode.") @@ -205,7 +205,7 @@ we can tell font lock about them.") ((?_ . "w") (?- . "w"))))) ;;;###autoload -(defalias 'srt-mode 'srecode-template-mode) +(defalias 'srt-mode #'srecode-template-mode) ;;; Template Commands ;; @@ -436,7 +436,7 @@ Moves to the end of one named section." (when point (goto-char (point))) (let* ((tag (semantic-current-tag)) (args (semantic-tag-function-arguments tag)) - (argsym (mapcar 'intern args)) + (argsym (mapcar #'intern args)) (argvars nil) ;; Create a temporary dictionary in which the ;; arguments can be resolved so we can extract @@ -475,7 +475,7 @@ section or ? for an ask variable." (ee (regexp-quote (srecode-template-get-escape-end))) (start (point)) (macrostart nil) - (raw nil) + ;; (raw nil) ) (when (and tag (semantic-tag-of-class-p tag 'function) (srecode-in-macro-p point) @@ -627,7 +627,7 @@ section or ? for an ask variable." context-return))) (define-mode-local-override semantic-analyze-possible-completions - srecode-template-mode (context &rest flags) + srecode-template-mode (context &rest _flags) "Return a list of possible completions based on NONTEXT." (with-current-buffer (oref context buffer) (let* ((prefix (car (last (oref context prefix)))) diff --git a/lisp/cedet/srecode/srt.el b/lisp/cedet/srecode/srt.el index e222997708b..161b5105b51 100644 --- a/lisp/cedet/srecode/srt.el +++ b/lisp/cedet/srecode/srt.el @@ -1,4 +1,4 @@ -;;; srecode/srt.el --- argument handlers for SRT files +;;; srecode/srt.el --- argument handlers for SRT files -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -43,7 +43,7 @@ DEFAULT is the default if RET is hit." (currfcn (semantic-current-tag)) ) (srecode-resolve-argument-list - (mapcar 'read + (mapcar #'read (semantic-tag-get-attribute currfcn :arguments)) newdict) @@ -56,7 +56,7 @@ DEFAULT is the default if RET is hit." (defvar srecode-read-major-mode-history nil "History for `srecode-read-variable-name'.") -(defun srecode-read-major-mode-name (prompt &optional initial hist default) +(defun srecode-read-major-mode-name (prompt &optional initial hist _default) "Read in the name of a desired `major-mode'. PROMPT is the prompt to use. INITIAL is the initial string. @@ -64,7 +64,7 @@ HIST is the history value, otherwise `srecode-read-variable-name-history' is used. DEFAULT is the default if RET is hit." (completing-read prompt obarray - (lambda (s) (string-match "-mode$" (symbol-name s))) + (lambda (s) (string-match "-mode\\'" (symbol-name s))) nil initial (or hist 'srecode-read-major-mode-history)) ) diff --git a/lisp/cedet/srecode/table.el b/lisp/cedet/srecode/table.el index 60a466f89d9..7ce5cc73b61 100644 --- a/lisp/cedet/srecode/table.el +++ b/lisp/cedet/srecode/table.el @@ -1,4 +1,4 @@ -;;; srecode/table.el --- Tables of Semantic Recoders +;;; srecode/table.el --- Tables of Semantic Recoders -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. @@ -169,7 +169,7 @@ calculate all inherited templates from parent modes." :modetables nil :tables nil))) ;; Save this new mode table in that mode's variable. - (eval `(setq-mode-local ,mode srecode-table ,new)) + (eval `(setq-mode-local ,mode srecode-table ,new) t) new)))) @@ -184,7 +184,7 @@ INIT are the initialization parameters for the new template table." (let* ((mt (srecode-make-mode-table mode)) (old (srecode-mode-table-find mt file)) (attr (file-attributes file)) - (new (apply 'srecode-template-table + (new (apply #'srecode-template-table (file-name-nondirectory file) :file file :filesize (file-attribute-size attr) diff --git a/lisp/cedet/srecode/template.el b/lisp/cedet/srecode/template.el index e9e5115128f..4f7eaffeb47 100644 --- a/lisp/cedet/srecode/template.el +++ b/lisp/cedet/srecode/template.el @@ -1,4 +1,4 @@ -;;; srecode/template.el --- SRecoder template language parser support. +;;; srecode/template.el --- SRecoder template language parser support. -*- lexical-binding: t; -*- ;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc. diff --git a/lisp/cedet/srecode/texi.el b/lisp/cedet/srecode/texi.el index 892ae4e2e31..1312a55a898 100644 --- a/lisp/cedet/srecode/texi.el +++ b/lisp/cedet/srecode/texi.el @@ -1,4 +1,4 @@ -;;; srecode/texi.el --- Srecode texinfo support. +;;; srecode/texi.el --- Srecode texinfo support. -*- lexical-binding: t; -*- ;; Copyright (C) 2008-2021 Free Software Foundation, Inc. @@ -224,7 +224,7 @@ Takes a few very generic guesses as to what the formatting is." ;; Return our modified doc string. docstring)) -(defun srecode-texi-massage-to-texinfo (tag buffer string) +(defun srecode-texi-massage-to-texinfo (_tag buffer string) "Massage TAG's documentation from BUFFER as STRING. This is to take advantage of TeXinfo's markup symbols." (save-excursion |