* lisp/cedet/srecode/*.el: Use lexical-binding
* lisp/cedet/srecode/compile.el (srecode-compile-inserter): Use `make-instance` instead of the class name-as-function. * lisp/cedet/srecode/fields.el (srecode-field-behind-hook): Remove unused var `field`. * lisp/cedet/srecode/find.el (srecode-load-tables-for-mode): Simplify. * lisp/cedet/srecode/getset.el (srecode-semantic-selected-tag): Declare var. * lisp/cedet/srecode/mode.el (srecode-minor-mode): Mark references to non-existing `srecode-m3-items` function. * lisp/cedet/srecode/srt-mode.el (srecode-parse-this-macro): Remove unused var `raw`.
This commit is contained in:
parent
533c659b6c
commit
0f85f2c0e5
23 changed files with 97 additions and 106 deletions
|
@ -283,7 +283,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)
|
||||
|
||||
|
|
|
@ -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
|
||||
;;
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)
|
||||
(make-instance 'srecode-template-inserter-variable name props)
|
||||
(let ((classes (eieio-class-children 'srecode-template-inserter))
|
||||
(new nil))
|
||||
;; Loop over the various subclasses and
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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))))
|
||||
|
|
|
@ -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))
|
||||
)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue