summaryrefslogtreecommitdiff
path: root/lisp/cedet/srecode
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet/srecode')
-rw-r--r--lisp/cedet/srecode/args.el60
-rw-r--r--lisp/cedet/srecode/compile.el38
-rw-r--r--lisp/cedet/srecode/cpp.el4
-rw-r--r--lisp/cedet/srecode/ctxt.el2
-rw-r--r--lisp/cedet/srecode/dictionary.el43
-rw-r--r--lisp/cedet/srecode/document.el6
-rw-r--r--lisp/cedet/srecode/el.el4
-rw-r--r--lisp/cedet/srecode/expandproto.el2
-rw-r--r--lisp/cedet/srecode/extract.el26
-rw-r--r--lisp/cedet/srecode/fields.el47
-rw-r--r--lisp/cedet/srecode/filters.el2
-rw-r--r--lisp/cedet/srecode/find.el12
-rw-r--r--lisp/cedet/srecode/getset.el2
-rw-r--r--lisp/cedet/srecode/insert.el138
-rw-r--r--lisp/cedet/srecode/java.el11
-rw-r--r--lisp/cedet/srecode/map.el26
-rw-r--r--lisp/cedet/srecode/mode.el2
-rw-r--r--lisp/cedet/srecode/semantic.el4
-rw-r--r--lisp/cedet/srecode/srt-mode.el11
-rw-r--r--lisp/cedet/srecode/srt-wy.el306
-rw-r--r--lisp/cedet/srecode/srt.el2
-rw-r--r--lisp/cedet/srecode/table.el9
-rw-r--r--lisp/cedet/srecode/template.el2
-rw-r--r--lisp/cedet/srecode/texi.el14
24 files changed, 234 insertions, 539 deletions
diff --git a/lisp/cedet/srecode/args.el b/lisp/cedet/srecode/args.el
index 6bc78295fa7..2cb2396092a 100644
--- a/lisp/cedet/srecode/args.el
+++ b/lisp/cedet/srecode/args.el
@@ -1,6 +1,6 @@
;;; srecode/args.el --- Provide some simple template arguments
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -101,35 +101,35 @@ do not contain any text from preceding or following text."
(defun srecode-semantic-handle-:time (dict)
"Add macros into the dictionary DICT based on the current :time."
;; DATE Values
- (srecode-dictionary-set-value
- dict "YEAR" (format-time-string "%Y" (current-time)))
- (srecode-dictionary-set-value
- dict "MONTHNAME" (format-time-string "%B" (current-time)))
- (srecode-dictionary-set-value
- dict "MONTH" (format-time-string "%m" (current-time)))
- (srecode-dictionary-set-value
- dict "DAY" (format-time-string "%d" (current-time)))
- (srecode-dictionary-set-value
- dict "WEEKDAY" (format-time-string "%a" (current-time)))
- ;; Time Values
- (srecode-dictionary-set-value
- dict "HOUR" (format-time-string "%H" (current-time)))
- (srecode-dictionary-set-value
- dict "HOUR12" (format-time-string "%l" (current-time)))
- (srecode-dictionary-set-value
- dict "AMPM" (format-time-string "%p" (current-time)))
- (srecode-dictionary-set-value
- dict "MINUTE" (format-time-string "%M" (current-time)))
- (srecode-dictionary-set-value
- dict "SECOND" (format-time-string "%S" (current-time)))
- (srecode-dictionary-set-value
- dict "TIMEZONE" (format-time-string "%Z" (current-time)))
- ;; Convenience pre-packed date/time
- (srecode-dictionary-set-value
- dict "DATE" (format-time-string "%D" (current-time)))
- (srecode-dictionary-set-value
- dict "TIME" (format-time-string "%X" (current-time)))
- )
+ (let ((now (current-time)))
+ (srecode-dictionary-set-value
+ dict "YEAR" (format-time-string "%Y" now))
+ (srecode-dictionary-set-value
+ dict "MONTHNAME" (format-time-string "%B" now))
+ (srecode-dictionary-set-value
+ dict "MONTH" (format-time-string "%m" now))
+ (srecode-dictionary-set-value
+ dict "DAY" (format-time-string "%d" now))
+ (srecode-dictionary-set-value
+ dict "WEEKDAY" (format-time-string "%a" now))
+ ;; Time Values
+ (srecode-dictionary-set-value
+ dict "HOUR" (format-time-string "%H" now))
+ (srecode-dictionary-set-value
+ dict "HOUR12" (format-time-string "%l" now))
+ (srecode-dictionary-set-value
+ dict "AMPM" (format-time-string "%p" now))
+ (srecode-dictionary-set-value
+ dict "MINUTE" (format-time-string "%M" now))
+ (srecode-dictionary-set-value
+ dict "SECOND" (format-time-string "%S" now))
+ (srecode-dictionary-set-value
+ dict "TIMEZONE" (format-time-string "%Z" now))
+ ;; Convenience pre-packed date/time
+ (srecode-dictionary-set-value
+ dict "DATE" (format-time-string "%D" now))
+ (srecode-dictionary-set-value
+ dict "TIME" (format-time-string "%X" now))))
;;; :file ARGUMENT HANDLING
;;
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 542fd49f8e5..c6b3b53f24d 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -1,6 +1,6 @@
;;; srecode/compile --- Compilation of srecode template files.
-;; Copyright (C) 2005, 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: codegeneration
@@ -34,6 +34,7 @@
(eval-when-compile (require 'cl))
(require 'semantic)
(require 'eieio)
+(require 'cl-generic)
(require 'eieio-base)
(require 'srecode/table)
(require 'srecode/dictionary)
@@ -74,7 +75,7 @@ any incoming dictionaries values.")
:initform nil
:documentation
"During template insertion, this is the stack of active templates.
-The top-most template is the 'active' template. Use the accessor methods
+The top-most template is the `active' template. Use the accessor methods
for push, pop, and peek for the active template.")
(table :initarg :table
:documentation
@@ -87,10 +88,10 @@ for push, pop, and peek for the active template.")
Useful if something goes wrong in SRecode, and the active template
stack is broken."
(interactive)
- (if (oref srecode-template active)
+ (if (oref-default 'srecode-template active)
(when (y-or-n-p (format "%d active templates. Flush? "
- (length (oref srecode-template active))))
- (oset-default srecode-template active nil))
+ (length (oref-default 'srecode-template active))))
+ (oset-default 'srecode-template active nil))
(message "No active templates to flush."))
)
@@ -115,23 +116,23 @@ additional static argument data."))
Plain text strings are not handled via this baseclass."
:abstract t)
-(defmethod srecode-parse-input ((ins srecode-template-inserter)
- tag input STATE)
+(cl-defmethod srecode-parse-input ((_ins srecode-template-inserter)
+ _tag input _STATE)
"For the template inserter INS, parse INPUT.
Shorten input only by the amount needed.
Return the remains of INPUT.
STATE is the current compilation state."
input)
-(defmethod srecode-match-end ((ins srecode-template-inserter) name)
+(cl-defmethod srecode-match-end ((_ins srecode-template-inserter) _name)
"For the template inserter INS, do I end a section called NAME?"
nil)
-(defmethod srecode-inserter-apply-state ((ins srecode-template-inserter) STATE)
+(cl-defmethod srecode-inserter-apply-state ((_ins srecode-template-inserter) _STATE)
"For the template inserter INS, apply information from STATE."
nil)
-(defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter)
+(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter))
escape-start escape-end)
"Insert an example using inserter INS.
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
@@ -158,7 +159,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
)
"Current state of the compile.")
-(defmethod srecode-compile-add-prompt ((state srecode-compile-state)
+(cl-defmethod srecode-compile-add-prompt ((state srecode-compile-state)
prompttag)
"Add PROMPTTAG to the current list of prompts."
(with-slots (prompts) state
@@ -289,7 +290,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
)
;; Continue
(setq tags (cdr tags)))
-
+
;; MSG - Before install since nreverse whacks our list.
(when (called-interactively-p 'interactive)
(message "%d templates compiled for %s"
@@ -414,7 +415,7 @@ If END-NAME is specified, and the input string"
(match-end 0)))
(namestart (match-end 0))
(junk (string-match regexend what namestart))
- end tail name key)
+ end tail name)
;; Add string to compiled output
(when (> (length prefix) 0)
(setq comp (cons prefix comp)))
@@ -452,8 +453,7 @@ If END-NAME is specified, and the input string"
(semantic-tag-name tag)))
)
;; Add string to compiled output
- (setq name (substring what namestart end)
- key nil)
+ (setq name (substring what namestart end))
;; Trim WHAT back.
(setq what (substring what tail))
;; Get the inserter
@@ -514,7 +514,7 @@ to the inserter constructor."
;;(message "Compile: %s %S" name props)
(if (not key)
(apply 'srecode-template-inserter-variable name props)
- (let ((classes (eieio-class-children srecode-template-inserter))
+ (let ((classes (eieio-class-children 'srecode-template-inserter))
(new nil))
;; Loop over the various subclasses and
;; create the correct inserter.
@@ -522,7 +522,7 @@ to the inserter constructor."
(setq classes (append classes (eieio-class-children (car classes))))
;; Do we have a match?
(when (and (not (class-abstract-p (car classes)))
- (equal (oref (car classes) key) key))
+ (equal (oref-default (car classes) key) key))
;; Create the new class, and apply state.
(setq new (apply (car classes) name props))
(srecode-inserter-apply-state new STATE)
@@ -595,7 +595,7 @@ A list of defined variables VARS provides a variable table."
;; Dump out information about the current srecoder compiled templates.
;;
-(defmethod srecode-dump ((tmp srecode-template))
+(cl-defmethod srecode-dump ((tmp srecode-template))
"Dump the contents of the SRecode template tmp."
(princ "== Template \"")
(princ (eieio-object-name-string tmp))
@@ -641,7 +641,7 @@ Argument INDENT specifies the indentation level for the list."
(princ "\n"))))
)
-(defmethod srecode-dump ((ins srecode-template-inserter) indent)
+(cl-defmethod srecode-dump ((ins srecode-template-inserter) _indent)
"Dump the state of the SRecode template inserter INS."
(princ "INS: \"")
(princ (eieio-object-name-string ins))
diff --git a/lisp/cedet/srecode/cpp.el b/lisp/cedet/srecode/cpp.el
index fd500b6d9a3..e77e05c40b9 100644
--- a/lisp/cedet/srecode/cpp.el
+++ b/lisp/cedet/srecode/cpp.el
@@ -1,6 +1,6 @@
;;; srecode/cpp.el --- C++ specific handlers for Semantic Recoder
-;; Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
;; Jan Moringen <scymtym@users.sourceforge.net>
@@ -84,7 +84,7 @@ HEADER - Shown section if in a header file."
;;;###autoload
(defun srecode-semantic-handle-:cpp (dict)
"Add macros into the dictionary DICT based on the current c file.
-Calls `srecode-semantic-handle-:c.
+Calls `srecode-semantic-handle-:c'.
Also adds the following:
- nothing -"
(srecode-semantic-handle-:c dict)
diff --git a/lisp/cedet/srecode/ctxt.el b/lisp/cedet/srecode/ctxt.el
index 0b15e733364..56433183c2b 100644
--- a/lisp/cedet/srecode/ctxt.el
+++ b/lisp/cedet/srecode/ctxt.el
@@ -1,6 +1,6 @@
;;; srecode/ctxt.el --- Derive a context from the source buffer.
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el
index bbc791f09d8..b95d45ebc86 100644
--- a/lisp/cedet/srecode/dictionary.el
+++ b/lisp/cedet/srecode/dictionary.el
@@ -1,6 +1,6 @@
;;; srecode/dictionary.el --- Dictionary code for the semantic recoder.
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -30,6 +30,7 @@
(eval-when-compile (require 'cl))
(require 'eieio)
+(require 'cl-generic)
(require 'srecode)
(require 'srecode/table)
(eval-when-compile (require 'semantic))
@@ -103,7 +104,7 @@ set NAME \"str\" macro \"OTHERNAME\"
with appending various parts together in a list.")
-(defmethod initialize-instance ((this srecode-dictionary-compound-variable)
+(cl-defmethod initialize-instance ((this srecode-dictionary-compound-variable)
&optional fields)
"Initialize the compound variable THIS.
Makes sure that :value is compiled."
@@ -120,7 +121,7 @@ Makes sure that :value is compiled."
;;(when (not state)
;; (error "Cannot create compound variable outside of sectiondictionary"))
- (call-next-method this (nreverse newfields))
+ (cl-call-next-method this (nreverse newfields))
(when (not (slot-boundp this 'compiled))
(let ((val (oref this :value))
(comp nil))
@@ -194,8 +195,8 @@ associated with a buffer or parent."
initfrombuff t)))
;; Create the new dictionary object.
- (let ((dict (srecode-dictionary
- major-mode
+ (let ((dict (make-instance
+ 'srecode-dictionary
:buffer buffer
:parent parent
:namehash (make-hash-table :test 'equal
@@ -215,7 +216,7 @@ associated with a buffer or parent."
))
dict))))
-(defmethod srecode-dictionary-add-template-table ((dict srecode-dictionary)
+(cl-defmethod srecode-dictionary-add-template-table ((dict srecode-dictionary)
tpl)
"Insert into DICT the variables found in table TPL.
TPL is an object representing a compiled template file."
@@ -235,7 +236,7 @@ TPL is an object representing a compiled template file."
(setq tabs (cdr tabs))))))
-(defmethod srecode-dictionary-set-value ((dict srecode-dictionary)
+(cl-defmethod srecode-dictionary-set-value ((dict srecode-dictionary)
name value)
"In dictionary DICT, set NAME to have VALUE."
;; Validate inputs
@@ -247,7 +248,7 @@ TPL is an object representing a compiled template file."
(puthash name value namehash))
)
-(defmethod srecode-dictionary-add-section-dictionary ((dict srecode-dictionary)
+(cl-defmethod srecode-dictionary-add-section-dictionary ((dict srecode-dictionary)
name &optional show-only force)
"In dictionary DICT, add a section dictionary for section macro NAME.
Return the new dictionary.
@@ -299,7 +300,7 @@ inserted dictionaries."
;; Return the new sub-dictionary.
new))
-(defmethod srecode-dictionary-show-section ((dict srecode-dictionary) name)
+(cl-defmethod srecode-dictionary-show-section ((dict srecode-dictionary) name)
"In dictionary DICT, indicate that the section NAME should be exposed."
;; Validate inputs
(unless (stringp name)
@@ -310,7 +311,7 @@ inserted dictionaries."
(srecode-dictionary-add-section-dictionary dict name t)
nil)
-(defmethod srecode-dictionary-hide-section ((dict srecode-dictionary) name)
+(cl-defmethod srecode-dictionary-hide-section ((dict srecode-dictionary) name)
"In dictionary DICT, indicate that the section NAME should be hidden."
;; We need to find the has value, and then delete it.
;; Validate inputs
@@ -322,7 +323,7 @@ inserted dictionaries."
(remhash name namehash))
nil)
-(defmethod srecode-dictionary-add-entries ((dict srecode-dictionary)
+(cl-defmethod srecode-dictionary-add-entries ((dict srecode-dictionary)
entries &optional state)
"Add ENTRIES to DICT.
@@ -373,7 +374,7 @@ values but STATE is nil."
(setq entries (nthcdr 2 entries)))
dict)
-(defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict
+(cl-defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict
&optional force)
"Merge into DICT the dictionary entries from OTHERDICT.
Unless the optional argument FORCE is non-nil, values in DICT are
@@ -405,7 +406,7 @@ OTHERDICT."
(srecode-dictionary-set-value dict key entry)))))
(oref otherdict namehash))))
-(defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary)
+(cl-defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary)
name &optional non-recursive)
"Return information about DICT's value for NAME.
DICT is a dictionary, and NAME is a string that is treated as the
@@ -416,7 +417,7 @@ searched for NAME if it is not found in DICT. This recursive
lookup can be disabled by the optional argument NON-RECURSIVE.
This function derives values for some special NAMEs, such as
-'FIRST' and 'LAST'."
+`FIRST' and `LAST'."
(if (not (slot-boundp dict 'namehash))
nil
;; Get the value of this name from the dictionary or its parent
@@ -429,7 +430,7 @@ This function derives values for some special NAMEs, such as
(srecode-dictionary-lookup-name parent name)))))
)
-(defmethod srecode-root-dictionary ((dict srecode-dictionary))
+(cl-defmethod srecode-root-dictionary ((dict srecode-dictionary))
"For dictionary DICT, return the root dictionary.
The root dictionary is usually for a current or active insertion."
(let ((ans dict))
@@ -442,7 +443,7 @@ The root dictionary is usually for a current or active insertion."
;; Compound values must provide at least the toString method
;; for use in converting the compound value into something insertable.
-(defmethod srecode-compound-toString ((cp srecode-dictionary-compound-value)
+(cl-defmethod srecode-compound-toString ((cp srecode-dictionary-compound-value)
function
dictionary)
"Convert the compound dictionary value CP to a string.
@@ -456,13 +457,13 @@ the value itself using `princ', or by detecting if the current
standard out is a buffer, and using `insert'."
(eieio-object-name cp))
-(defmethod srecode-dump ((cp srecode-dictionary-compound-value)
+(cl-defmethod srecode-dump ((cp srecode-dictionary-compound-value)
&optional indent)
"Display information about this compound value."
(princ (eieio-object-name cp))
)
-(defmethod srecode-compound-toString ((cp srecode-dictionary-compound-variable)
+(cl-defmethod srecode-compound-toString ((cp srecode-dictionary-compound-variable)
function
dictionary)
"Convert the compound dictionary variable value CP into a string.
@@ -471,7 +472,7 @@ FUNCTION and DICTIONARY are as for the baseclass."
(srecode-insert-code-stream (oref cp compiled) dictionary))
-(defmethod srecode-dump ((cp srecode-dictionary-compound-variable)
+(cl-defmethod srecode-dump ((cp srecode-dictionary-compound-variable)
&optional indent)
"Display information about this compound value."
(require 'srecode/compile)
@@ -501,7 +502,7 @@ Compound values allow a field to be stored in the dictionary for when
it is referenced a second time. This compound value can then be
inserted with a new editable field.")
-(defmethod srecode-compound-toString((cp srecode-field-value)
+(cl-defmethod srecode-compound-toString((cp srecode-field-value)
function
dictionary)
"Convert this field into an insertable string."
@@ -639,7 +640,7 @@ STATE is the current compiler state."
(srecode-dump dict))
))))
-(defmethod srecode-dump ((dict srecode-dictionary) &optional indent)
+(cl-defmethod srecode-dump ((dict srecode-dictionary) &optional indent)
"Dump a dictionary."
(if (not indent) (setq indent 0))
(maphash (lambda (key entry)
diff --git a/lisp/cedet/srecode/document.el b/lisp/cedet/srecode/document.el
index 902eb6433b9..f0fe498cbba 100644
--- a/lisp/cedet/srecode/document.el
+++ b/lisp/cedet/srecode/document.el
@@ -1,6 +1,6 @@
;;; srecode/document.el --- Documentation (comment) generation
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -395,7 +395,7 @@ It is assumed that the comment occurs just in front of FCN-IN."
(beginning-of-line)
(forward-char -1)
- (let ((lextok (semantic-documentation-comment-preceeding-tag fcn-in 'lex))
+ (let ((lextok (semantic-documentation-comment-preceding-tag fcn-in 'lex))
(doctext
(srecode-document-function-name-comment fcn-in))
)
@@ -655,7 +655,7 @@ If there is only one tag in the region, complain."
"Create documentation for the function defined in TAG.
If we can identify a verb in the list followed by some
name part then check the return value to see if we can use that to
-finish off the sentence. That is, any function with 'alloc' in it will be
+finish off the sentence. That is, any function with `alloc' in it will be
allocating something based on its type."
(let ((al srecode-document-autocomment-return-first-alist)
(dropit nil)
diff --git a/lisp/cedet/srecode/el.el b/lisp/cedet/srecode/el.el
index cc6ee7298a7..7e91a612638 100644
--- a/lisp/cedet/srecode/el.el
+++ b/lisp/cedet/srecode/el.el
@@ -1,6 +1,6 @@
;;; srecode/el.el --- Emacs Lisp specific arguments
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -50,7 +50,7 @@ Adds the following:
(defun srecode-semantic-handle-:el-custom (dict)
"Add macros into the dictionary DICT based on the current Emacs Lisp file.
Adds the following:
- GROUP - The 'defgroup' name we guess you want for variables.
+ GROUP - The `defgroup' name we guess you want for variables.
FACEGROUP - The `defgroup' name you might want for faces."
(require 'semantic/db-find)
(let ((groups (semanticdb-strip-find-results
diff --git a/lisp/cedet/srecode/expandproto.el b/lisp/cedet/srecode/expandproto.el
index ddc4bebc7ad..205d207edda 100644
--- a/lisp/cedet/srecode/expandproto.el
+++ b/lisp/cedet/srecode/expandproto.el
@@ -1,6 +1,6 @@
;;; srecode/expandproto.el --- Expanding prototypes.
-;; Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/cedet/srecode/extract.el b/lisp/cedet/srecode/extract.el
index 8ac379d12f4..027ae0c25dd 100644
--- a/lisp/cedet/srecode/extract.el
+++ b/lisp/cedet/srecode/extract.el
@@ -1,6 +1,6 @@
;;; srecode/extract.el --- Extract content from previously inserted macro.
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -55,16 +55,16 @@
)
"The current extraction state.")
-(defmethod srecode-extract-state-set ((st srecode-extract-state) ins dict)
+(cl-defmethod srecode-extract-state-set ((st srecode-extract-state) ins dict)
"Set onto the extract state ST a new inserter INS and dictionary DICT."
(oset st lastinserter ins)
(oset st lastdict dict))
-(defmethod srecode-extract-state-set-anchor ((st srecode-extract-state))
+(cl-defmethod srecode-extract-state-set-anchor ((st srecode-extract-state))
"Reset the anchor point on extract state ST."
(oset st anchor (point)))
-(defmethod srecode-extract-state-extract ((st srecode-extract-state)
+(cl-defmethod srecode-extract-state-extract ((st srecode-extract-state)
endpoint)
"Perform an extraction on the extract state ST with ENDPOINT.
If there was no waiting inserter, do nothing."
@@ -94,7 +94,7 @@ the dictionary entries were for that block of text."
(srecode-extract-method template dict state)
dict))))
-(defmethod srecode-extract-method ((st srecode-template) dictionary
+(cl-defmethod srecode-extract-method ((st srecode-template) dictionary
state)
"Extract template ST and store extracted text in DICTIONARY.
Optional STARTRETURN is a symbol in which the start of the first
@@ -139,11 +139,11 @@ Uses STATE to maintain the current extraction state."
;;; Inserter Base Extractors
;;
-(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)
-(defmethod srecode-inserter-extract ((ins srecode-template-inserter)
+(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."
@@ -151,11 +151,11 @@ Return nil as this inserter will extract nothing."
;;; Variable extractor is simple and can extract later.
;;
-(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)
-(defmethod srecode-inserter-extract ((ins srecode-template-inserter-variable)
+(cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-variable)
start end vdict state)
"Extract text from START/END and store in VDICT.
Return t if something was extracted.
@@ -169,11 +169,11 @@ Return nil if this inserter doesn't need to extract anything."
;;; Section Inserter
;;
-(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)
-(defmethod srecode-inserter-extract ((ins srecode-template-inserter-section-start)
+(cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-section-start)
start end indict state)
"Extract text from START/END and store in INDICT.
Return the starting location of the first plain-text match.
@@ -203,11 +203,11 @@ Return nil if nothing was extracted."
;;; Include Extractor must extract now.
;;
-(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)
-(defmethod srecode-inserter-extract ((ins srecode-template-inserter-include)
+(cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-include)
start end dict state)
"Extract text from START/END and store in DICT.
Return the starting location of the first plain-text match.
diff --git a/lisp/cedet/srecode/fields.el b/lisp/cedet/srecode/fields.el
index ea856f3a394..dd38b65d7bf 100644
--- a/lisp/cedet/srecode/fields.el
+++ b/lisp/cedet/srecode/fields.el
@@ -1,6 +1,6 @@
;;; srecode/fields.el --- Handling type-in fields in a buffer.
;;
-;; Copyright (C) 2009-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;;
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -39,6 +39,7 @@
;; Keep this library independent of SRecode proper.
(require 'eieio)
+(require 'cl-generic)
;;; Code:
(defvar srecode-field-archive nil
@@ -74,7 +75,7 @@ The overlay will crossreference this object.")
"An object that gets automatically bound to an overlay.
Has virtual :start and :end initializers.")
-(defmethod initialize-instance ((olaid srecode-overlaid) &optional args)
+(cl-defmethod initialize-instance ((olaid srecode-overlaid) &optional args)
"Initialize OLAID, being sure it archived."
;; Extract :start and :end from the olaid list.
(let ((newargs nil)
@@ -107,11 +108,11 @@ Has virtual :start and :end initializers.")
(overlay-put olay 'srecode-init-only t)
(oset olaid overlay olay)
- (call-next-method olaid (nreverse newargs))
+ (cl-call-next-method olaid (nreverse newargs))
))
-(defmethod srecode-overlaid-activate ((olaid srecode-overlaid))
+(cl-defmethod srecode-overlaid-activate ((olaid srecode-overlaid))
"Activate the overlaid area."
(let* ((ola (oref olaid overlay))
(start (overlay-start ola))
@@ -128,23 +129,23 @@ Has virtual :start and :end initializers.")
))
-(defmethod srecode-delete ((olaid srecode-overlaid))
+(cl-defmethod srecode-delete ((olaid srecode-overlaid))
"Delete the overlay from OLAID."
(delete-overlay (oref olaid overlay))
(slot-makeunbound olaid 'overlay)
)
-(defmethod srecode-empty-region-p ((olaid srecode-overlaid))
+(cl-defmethod srecode-empty-region-p ((olaid srecode-overlaid))
"Return non-nil if the region covered by OLAID is of length 0."
(= 0 (srecode-region-size olaid)))
-(defmethod srecode-region-size ((olaid srecode-overlaid))
+(cl-defmethod srecode-region-size ((olaid srecode-overlaid))
"Return the length of region covered by OLAID."
(let ((start (overlay-start (oref olaid overlay)))
(end (overlay-end (oref olaid overlay))))
(- end start)))
-(defmethod srecode-point-in-region-p ((olaid srecode-overlaid))
+(cl-defmethod srecode-point-in-region-p ((olaid srecode-overlaid))
"Return non-nil if point is in the region of OLAID."
(let ((start (overlay-start (oref olaid overlay)))
(end (overlay-end (oref olaid overlay))))
@@ -161,7 +162,7 @@ Has virtual :start and :end initializers.")
(setq ol (cdr ol)))
(car (nreverse ret))))
-(defmethod srecode-overlaid-text ((olaid srecode-overlaid) &optional set-to)
+(cl-defmethod srecode-overlaid-text ((olaid srecode-overlaid) &optional set-to)
"Return the text under OLAID.
If SET-TO is a string, then replace the text of OLAID wit SET-TO."
(let* ((ol (oref olaid overlay))
@@ -191,7 +192,7 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO."
)
"Manage a buffer region in which fields exist.")
-(defmethod initialize-instance ((ir srecode-template-inserted-region)
+(cl-defmethod initialize-instance ((ir srecode-template-inserted-region)
&rest args)
"Initialize IR, capturing the active fields, and creating the overlay."
;; Fill in the fields
@@ -199,10 +200,10 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO."
(setq srecode-field-archive nil)
;; Initialize myself first.
- (call-next-method)
+ (cl-call-next-method)
)
-(defmethod srecode-overlaid-activate ((ir srecode-template-inserted-region))
+(cl-defmethod srecode-overlaid-activate ((ir srecode-template-inserted-region))
"Activate the template area for IR."
;; Activate all our fields
@@ -210,7 +211,7 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO."
(srecode-overlaid-activate F))
;; Activate our overlay.
- (call-next-method)
+ (cl-call-next-method)
;; Position the cursor at the first field
(let ((first (car (oref ir fields))))
@@ -223,21 +224,21 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO."
(add-hook 'post-command-hook 'srecode-field-post-command t t)
)
-(defmethod srecode-delete ((ir srecode-template-inserted-region))
+(cl-defmethod srecode-delete ((ir srecode-template-inserted-region))
"Call into our base, but also clear out the fields."
;; Clear us out of the baseclass.
(oset ir active-region nil)
;; Clear our fields.
(mapc 'srecode-delete (oref ir fields))
;; Call to our base
- (call-next-method)
+ (cl-call-next-method)
;; Clear our hook.
(remove-hook 'post-command-hook 'srecode-field-post-command t)
)
(defsubst srecode-active-template-region ()
"Return the active region for template fields."
- (oref srecode-template-inserted-region active-region))
+ (oref-default 'srecode-template-inserted-region active-region))
(defun srecode-field-post-command ()
"Srecode field handler in the post command hook."
@@ -285,15 +286,15 @@ Try to use this to provide useful completion when available.")
km)
"Keymap applied to field overlays.")
-(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)
- (call-next-method)
+ (cl-call-next-method)
)
-(defmethod srecode-overlaid-activate ((field srecode-field))
+(cl-defmethod srecode-overlaid-activate ((field srecode-field))
"Activate the FIELD area."
- (call-next-method)
+ (cl-call-next-method)
(let* ((ol (oref field overlay))
(end nil)
@@ -314,13 +315,13 @@ Try to use this to provide useful completion when available.")
)
)
-(defmethod srecode-delete ((olaid srecode-field))
+(cl-defmethod srecode-delete ((olaid srecode-field))
"Delete our secondary overlay."
;; Remove our spare overlay
(delete-overlay (oref olaid tail))
(slot-makeunbound olaid 'tail)
;; Do our baseclass work.
- (call-next-method)
+ (cl-call-next-method)
)
(defvar srecode-field-replication-max-size 100
@@ -379,7 +380,7 @@ PRE-LEN is used in the after mode for the length of the changed text."
(srecode-field-mod-hook ol after start end pre-len))
))
-(defmethod srecode-field-goto ((field srecode-field))
+(cl-defmethod srecode-field-goto ((field srecode-field))
"Goto the FIELD."
(goto-char (overlay-start (oref field overlay))))
diff --git a/lisp/cedet/srecode/filters.el b/lisp/cedet/srecode/filters.el
index bdc7c42fa09..dc296dccf92 100644
--- a/lisp/cedet/srecode/filters.el
+++ b/lisp/cedet/srecode/filters.el
@@ -1,6 +1,6 @@
;;; srecode/filters.el --- Filters for use in template variables.
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/cedet/srecode/find.el b/lisp/cedet/srecode/find.el
index 6384913192d..092f739df7d 100644
--- a/lisp/cedet/srecode/find.el
+++ b/lisp/cedet/srecode/find.el
@@ -1,6 +1,6 @@
;;;; srecode/find.el --- Tools for finding templates in the database.
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -96,7 +96,7 @@ all template files for that application will be loaded."
;;
;; Find if a template table has a project set, and if so, is the
;; current buffer in that project.
-(defmethod srecode-template-table-in-project-p ((tab srecode-template-table))
+(cl-defmethod srecode-template-table-in-project-p ((tab srecode-template-table))
"Return non-nil if the table TAB can be used in the current project.
If TAB has a :project set, check that the directories match.
If TAB is nil, then always return t."
@@ -113,7 +113,7 @@ If TAB is nil, then always return t."
;;
;; Find a given template based on name, and features of the current
;; buffer.
-(defmethod srecode-template-get-table ((tab srecode-template-table)
+(cl-defmethod srecode-template-get-table ((tab srecode-template-table)
template-name &optional
context application)
"Find in the template in table TAB, the template with TEMPLATE-NAME.
@@ -129,7 +129,7 @@ The APPLICATION argument is unused."
;; No context, perhaps a merged name?
(gethash template-name (oref tab namehash)))))
-(defmethod srecode-template-get-table ((tab srecode-mode-table)
+(cl-defmethod srecode-template-get-table ((tab srecode-mode-table)
template-name &optional
context application)
"Find in the template in mode table TAB, the template with TEMPLATE-NAME.
@@ -157,7 +157,7 @@ tables that do not belong to an application will be searched."
;;
;; Find a given template based on a key binding.
;;
-(defmethod srecode-template-get-table-for-binding
+(cl-defmethod srecode-template-get-table-for-binding
((tab srecode-template-table) binding &optional context)
"Find in the template name in table TAB, the template with BINDING.
Optional argument CONTEXT specifies that the template should part
@@ -190,7 +190,7 @@ of a particular context."
(maphash hashfcn (oref tab namehash)))
keyout)))
-(defmethod srecode-template-get-table-for-binding
+(cl-defmethod srecode-template-get-table-for-binding
((tab srecode-mode-table) binding &optional context application)
"Find in the template name in mode table TAB, the template with BINDING.
Optional argument CONTEXT specifies a context a particular template
diff --git a/lisp/cedet/srecode/getset.el b/lisp/cedet/srecode/getset.el
index 617212759a1..07255af2bfe 100644
--- a/lisp/cedet/srecode/getset.el
+++ b/lisp/cedet/srecode/getset.el
@@ -1,6 +1,6 @@
;;; srecode/getset.el --- Package for inserting new get/set methods.
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index 0d647bb56c5..2ff3060ac51 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -1,6 +1,6 @@
;;; srecode/insert.el --- Insert srecode templates to an output stream.
-;; Copyright (C) 2005, 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
@@ -35,7 +35,6 @@
(require 'srecode/args)
(require 'srecode/filters)
-(defvar srecode-template-inserter-point)
(declare-function srecode-overlaid-activate "srecode/fields")
(declare-function srecode-template-inserted-region "srecode/fields")
@@ -46,9 +45,9 @@
Only the ASK style inserter will query the user for a value.
Dictionary value references that ask begin with the ? character.
Possible values are:
- 'ask - Prompt in the minibuffer as the value is inserted.
- 'field - Use the dictionary macro name as the inserted value,
- and place a field there. Matched fields change together.
+ `ask' - Prompt in the minibuffer as the value is inserted.
+ `field' - Use the dictionary macro name as the inserted value,
+ and place a field there. Matched fields change together.
NOTE: The field feature does not yet work with XEmacs."
:group 'srecode
@@ -145,7 +144,7 @@ has set everything up already."
)
(set-buffer standard-output)
(setq end-mark (point-marker))
- (goto-char (oref srecode-template-inserter-point point)))
+ (goto-char (oref-default 'srecode-template-inserter-point point)))
(oset-default 'srecode-template-inserter-point point eieio-unbound)
;; Return the end-mark.
@@ -211,13 +210,13 @@ insertions."
(propertize " (most recent at bottom)" 'face '(:slant italic))
":\n")
(data-debug-insert-stuff-list
- (reverse (oref srecode-template active)) "> ")
+ (reverse (oref-default 'srecode-template active)) "> ")
;; Show the current dictionary.
(insert (propertize "Dictionary" 'face '(:weight bold)) "\n")
(data-debug-insert-thing dictionary "" "> ")
;; Show the error message.
(insert (propertize "Error" 'face '(:weight bold)) "\n")
- (insert (apply #'format format args))
+ (insert (apply #'format-message format args))
(pop-to-buffer (current-buffer))))
(defun srecode-insert-report-error (dictionary format &rest args)
@@ -260,20 +259,19 @@ Optional argument TEMP is the template that is getting its arguments resolved."
;; Code managing the top-level insert method and the current
;; insertion stack.
;;
-(defmethod srecode-push ((st srecode-template))
+(cl-defmethod srecode-push ((st srecode-template))
"Push the srecoder template ST onto the active stack."
(oset st active (cons st (oref st active))))
-(defmethod srecode-pop :STATIC ((st srecode-template))
- "Pop the srecoder template ST onto the active stack.
-ST can be a class, or an object."
+(cl-defmethod srecode-pop ((st srecode-template))
+ "Pop the srecoder template ST onto the active stack."
(oset st active (cdr (oref st active))))
-(defmethod srecode-peek :STATIC ((st srecode-template))
- "Fetch the topmost active template record. ST can be a class."
+(cl-defmethod srecode-peek ((st srecode-template))
+ "Fetch the topmost active template record."
(car (oref st active)))
-(defmethod srecode-insert-method ((st srecode-template) dictionary)
+(cl-defmethod srecode-insert-method ((st srecode-template) dictionary)
"Insert the srecoder template ST."
;; Merge any template entries into the input dictionary.
;; This may happen twice since some templates arguments need
@@ -324,7 +322,7 @@ by themselves.")
Specify the :indent argument to enable automatic indentation when newlines
occur in your template.")
-(defmethod srecode-insert-method ((sti srecode-template-inserter-newline)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-newline)
dictionary)
"Insert the STI inserter."
;; To be safe, indent the previous line since the template will
@@ -363,9 +361,9 @@ occur in your template.")
((stringp i)
(princ i))))))
-(defmethod srecode-dump ((ins srecode-template-inserter-newline) indent)
+(cl-defmethod srecode-dump ((ins srecode-template-inserter-newline) _indent)
"Dump the state of the SRecode template inserter INS."
- (call-next-method)
+ (cl-call-next-method)
(when (oref ins hard)
(princ " : hard")
))
@@ -379,16 +377,16 @@ Can't be blank, or it might be used by regular variable insertion.")
(where :initform 'begin
:initarg :where
:documentation
- "This should be 'begin or 'end, indicating where to insert a CR.
-When set to 'begin, it will insert a CR if we are not at 'bol'.
-When set to 'end it will insert a CR if we are not at 'eol'.")
+ "This should be `begin' or `end', indicating where to insert a CR.
+When `begin', insert a CR if not at 'bol'.
+When `end', insert a CR if not at 'eol'.")
;; @TODO - Add slot and control for the number of blank
;; lines before and after point.
)
"Insert a newline before and after a template, and possibly do indenting.
Specify the :blank argument to enable this inserter.")
-(defmethod srecode-insert-method ((sti srecode-template-inserter-blank)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-blank)
dictionary)
"Make sure there is no text before or after point."
(let ((i (srecode-dictionary-lookup-name dictionary "INDENT"))
@@ -396,7 +394,7 @@ Specify the :blank argument to enable this inserter.")
(pm (point-marker)))
(when (and inbuff
;; Don't do this if we are not the active template.
- (= (length (oref srecode-template active)) 1))
+ (= (length (oref-default 'srecode-template active)) 1))
(when (and (eq i t) inbuff (not (eq (oref sti where) 'begin)))
(indent-according-to-mode)
@@ -425,8 +423,8 @@ Specify the :blank argument to enable this inserter.")
)
"Allow comments within template coding. This inserts nothing.")
-(defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-comment)
- escape-start escape-end)
+(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-comment))
+ escape-start escape-end)
"Insert an example using inserter INS.
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(princ " ")
@@ -436,8 +434,8 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(terpri)
)
-(defmethod srecode-insert-method ((sti srecode-template-inserter-comment)
- dictionary)
+(cl-defmethod srecode-insert-method ((_sti srecode-template-inserter-comment)
+ _dictionary)
"Don't insert anything for comment macros in STI."
nil)
@@ -453,7 +451,7 @@ If there is no entry, insert nothing.")
(defvar srecode-inserter-variable-current-dictionary nil
"The active dictionary when calling a variable filter.")
-(defmethod srecode-insert-variable-secondname-handler
+(cl-defmethod srecode-insert-variable-secondname-handler
((sti srecode-template-inserter-variable) dictionary value secondname)
"For VALUE handle SECONDNAME behaviors for this variable inserter.
Return the result as a string.
@@ -471,7 +469,7 @@ If SECONDNAME is nil, return VALUE."
(object-print sti) secondname)))
value))
-(defmethod srecode-insert-method ((sti srecode-template-inserter-variable)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-variable)
dictionary)
"Insert the STI inserter."
;; Convert the name into a name/fcn pair
@@ -491,7 +489,7 @@ If SECONDNAME is nil, return VALUE."
(setq val (srecode-insert-variable-secondname-handler
sti dictionary val fcnpart)))
;; Compound data value
- ((srecode-dictionary-compound-value-child-p val)
+ ((cl-typep val 'srecode-dictionary-compound-value)
;; Force FCN to be a symbol
(when fcnpart (setq fcnpart (read fcnpart)))
;; Convert compound value to a string with the fcn.
@@ -502,7 +500,7 @@ If SECONDNAME is nil, return VALUE."
(setq do-princ nil)))
;; Dictionaries... not allowed in this style
- ((srecode-dictionary-child-p val)
+ ((cl-typep val 'srecode-dictionary)
(srecode-insert-report-error
dictionary
"Macro %s cannot insert a dictionary - use section macros instead"
@@ -541,7 +539,7 @@ If there is no entry, prompt the user for the value to use.
The prompt text used is derived from the previous PROMPT command in the
template file.")
-(defmethod srecode-inserter-apply-state
+(cl-defmethod srecode-inserter-apply-state
((ins srecode-template-inserter-ask) STATE)
"For the template inserter INS, apply information from STATE.
Loop over the prompts to see if we have a match."
@@ -561,14 +559,14 @@ Loop over the prompts to see if we have a match."
(setq prompts (cdr prompts)))
))
-(defmethod srecode-insert-method ((sti srecode-template-inserter-ask)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-ask)
dictionary)
"Insert the STI inserter."
(let ((val (srecode-dictionary-lookup-name
dictionary (oref sti :object-name))))
(if val
;; Does some extra work. Oh well.
- (call-next-method)
+ (cl-call-next-method)
;; How is our -ask value determined?
(if srecode-insert-with-fields-in-progress
@@ -585,9 +583,9 @@ Loop over the prompts to see if we have a match."
;; Now that this value is safely stowed in the dictionary,
;; we can do what regular inserters do.
- (call-next-method))))
+ (cl-call-next-method))))
-(defmethod srecode-insert-ask-default ((sti srecode-template-inserter-ask)
+(cl-defmethod srecode-insert-ask-default ((sti srecode-template-inserter-ask)
dictionary)
"Derive the default value for an askable inserter STI.
DICTIONARY is used to derive some values."
@@ -612,7 +610,7 @@ DICTIONARY is used to derive some values."
dictionary
"Unknown default for prompt: %S" defaultfcn)))))
-(defmethod srecode-insert-method-ask ((sti srecode-template-inserter-ask)
+(cl-defmethod srecode-insert-method-ask ((sti srecode-template-inserter-ask)
dictionary)
"Do the \"asking\" for the template inserter STI.
Use DICTIONARY to resolve values."
@@ -646,7 +644,7 @@ Use DICTIONARY to resolve values."
val)
)
-(defmethod srecode-insert-method-field ((sti srecode-template-inserter-ask)
+(cl-defmethod srecode-insert-method-field ((sti srecode-template-inserter-ask)
dictionary)
"Create an editable field for the template inserter STI.
Use DICTIONARY to resolve values."
@@ -661,9 +659,9 @@ Use DICTIONARY to resolve values."
;; across multiple locations.
compound-value))
-(defmethod srecode-dump ((ins srecode-template-inserter-ask) indent)
+(cl-defmethod srecode-dump ((ins srecode-template-inserter-ask) _indent)
"Dump the state of the SRecode template inserter INS."
- (call-next-method)
+ (cl-call-next-method)
(princ " : \"")
(princ (oref ins prompt))
(princ "\"")
@@ -681,8 +679,8 @@ Thus a specification of `10:left' will insert the value of A
to 10 characters, with spaces added to the left. Use `right' for adding
spaces to the right.")
-(defmethod srecode-insert-variable-secondname-handler
- ((sti srecode-template-inserter-width) dictionary value width)
+(cl-defmethod srecode-insert-variable-secondname-handler
+ ((_sti srecode-template-inserter-width) dictionary value width)
"For VALUE handle WIDTH behaviors for this variable inserter.
Return the result as a string.
By default, treat as a function name."
@@ -714,8 +712,8 @@ By default, treat as a function name."
(concat padchars value)
(concat value padchars))))))
-(defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-width)
- escape-start escape-end)
+(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-width))
+ escape-start escape-end)
"Insert an example using inserter INS.
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(princ " ")
@@ -750,8 +748,8 @@ The cursor is placed at the ^ macro after insertion.
Some inserter macros, such as `srecode-template-inserter-include-wrap'
will place text at the ^ macro from the included macro.")
-(defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-point)
- escape-start escape-end)
+(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-point))
+ escape-start escape-end)
"Insert an example using inserter INS.
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(princ " ")
@@ -761,10 +759,10 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(terpri)
)
-(defmethod srecode-insert-method ((sti srecode-template-inserter-point)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-point)
dictionary)
"Insert the STI inserter.
-Save point in the class allocated 'point' slot.
+Save point in the class allocated `point' slot.
If `srecode-template-inserter-point-override' non-nil then this
generalized marker will do something else. See
`srecode-template-inserter-include-wrap' as an example."
@@ -773,7 +771,7 @@ generalized marker will do something else. See
;; valid. Compare this to the actual template nesting depth and
;; maybe use the override function which is stored in the cdr.
(if (and srecode-template-inserter-point-override
- (<= (length (oref srecode-template active))
+ (<= (length (oref-default 'srecode-template active))
(car srecode-template-inserter-point-override)))
;; Disable the old override while we do this.
(let ((over (cdr srecode-template-inserter-point-override))
@@ -787,11 +785,11 @@ generalized marker will do something else. See
"Wrap a section of a template under the control of a macro."
:abstract t)
-(defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-subtemplate)
- escape-start escape-end)
+(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-subtemplate))
+ escape-start escape-end)
"Insert an example using inserter INS.
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
- (call-next-method)
+ (cl-call-next-method)
(princ " Template Text to control")
(terpri)
(princ " ")
@@ -801,11 +799,11 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(terpri)
)
-(defmethod srecode-insert-subtemplate ((sti srecode-template-inserter-subtemplate)
+(cl-defmethod srecode-insert-subtemplate ((sti srecode-template-inserter-subtemplate)
dict slot)
"Insert a subtemplate for the inserter STI with dictionary DICT."
;; Make sure that only dictionaries are used.
- (unless (srecode-dictionary-child-p dict)
+ (unless (cl-typep dict 'srecode-dictionary)
(srecode-insert-report-error
dict
"Only section dictionaries allowed for `%s'"
@@ -814,7 +812,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
;; Output the code from the sub-template.
(srecode-insert-method (slot-value sti slot) dict))
-(defmethod srecode-insert-method-helper ((sti srecode-template-inserter-subtemplate)
+(cl-defmethod srecode-insert-method-helper ((sti srecode-template-inserter-subtemplate)
dictionary slot)
"Do the work for inserting the STI inserter.
Loops over the embedded CODE which was saved here during compilation.
@@ -837,7 +835,7 @@ The template to insert is stored in SLOT."
(srecode-insert-subtemplate sti (car dicts) slot)
(setq dicts (cdr dicts)))))
-(defmethod srecode-insert-method ((sti srecode-template-inserter-subtemplate)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-subtemplate)
dictionary)
"Insert the STI inserter.
Calls back to `srecode-insert-method-helper' for this class."
@@ -858,7 +856,7 @@ The dictionary saved at the named dictionary entry will be
applied to the text between the section start and the
`srecode-template-inserter-section-end' macro.")
-(defmethod srecode-parse-input ((ins srecode-template-inserter-section-start)
+(cl-defmethod srecode-parse-input ((ins srecode-template-inserter-section-start)
tag input STATE)
"For the section inserter INS, parse INPUT.
Shorten input until the END token is found.
@@ -872,9 +870,9 @@ Return the remains of INPUT."
:code (cdr out)))
(car out)))
-(defmethod srecode-dump ((ins srecode-template-inserter-section-start) indent)
+(cl-defmethod srecode-dump ((ins srecode-template-inserter-section-start) indent)
"Dump the state of the SRecode template inserter INS."
- (call-next-method)
+ (cl-call-next-method)
(princ "\n")
(srecode-dump-code-list (oref (oref ins template) code)
(concat indent " "))
@@ -889,12 +887,12 @@ Return the remains of INPUT."
"All template segments between the section-start and section-end
are treated specially.")
-(defmethod srecode-insert-method ((sti srecode-template-inserter-section-end)
- dictionary)
+(cl-defmethod srecode-insert-method ((_sti srecode-template-inserter-section-end)
+ _dictionary)
"Insert the STI inserter."
)
-(defmethod srecode-match-end ((ins srecode-template-inserter-section-end) name)
+(cl-defmethod srecode-match-end ((ins srecode-template-inserter-section-end) name)
"For the template inserter INS, do I end a section called NAME?"
(string= name (oref ins :object-name)))
@@ -912,7 +910,7 @@ are treated specially.")
The included template will have additional dictionary entries from the subdictionary
stored specified by this macro.")
-(defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-include)
+(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-include))
escape-start escape-end)
"Insert an example using inserter INS.
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
@@ -923,7 +921,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(terpri)
)
-(defmethod srecode-insert-include-lookup ((sti srecode-template-inserter-include)
+(cl-defmethod srecode-insert-include-lookup ((sti srecode-template-inserter-include)
dictionary)
"For the template inserter STI, lookup the template to include.
Finds the template with this macro function part and stores it in
@@ -943,7 +941,7 @@ this template instance."
;; Calculate and store the discovered template
(let ((tmpl (srecode-template-get-table (srecode-table)
templatenamepart))
- (active (oref srecode-template active))
+ (active (oref-default 'srecode-template active))
ctxt)
(when (not tmpl)
;; If it isn't just available, scan back through
@@ -981,7 +979,7 @@ this template instance."
"No template \"%s\" found for include macro `%s'"
templatenamepart (oref sti :object-name)))))
-(defmethod srecode-insert-method ((sti srecode-template-inserter-include)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-include)
dictionary)
"Insert the STI inserter.
Finds the template with this macro function part, and inserts it
@@ -1017,7 +1015,7 @@ stored specified by this macro. If the included macro includes a ^ macro,
then the text between this macro and the end macro will be inserted at
the ^ macro.")
-(defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-include-wrap)
+(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-include-wrap))
escape-start escape-end)
"Insert an example using inserter INS.
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
@@ -1035,7 +1033,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
(terpri)
)
-(defmethod srecode-insert-method ((sti srecode-template-inserter-include-wrap)
+(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-include-wrap)
dictionary)
"Insert the template STI.
This will first insert the include part via inheritance, then
@@ -1053,7 +1051,7 @@ template where a ^ inserter occurs."
(lexical-let ((inserter1 sti))
(cons
;; DEPTH
- (+ (length (oref srecode-template active)) 1)
+ (+ (length (oref-default 'srecode-template active)) 1)
;; FUNCTION
(lambda (dict)
(let ((srecode-template-inserter-point-override nil))
@@ -1067,7 +1065,7 @@ template where a ^ inserter occurs."
inserter1 dict 'template))))))))
;; Do a regular insertion for an include, but with our override in
;; place.
- (call-next-method)))
+ (cl-call-next-method)))
(provide 'srecode/insert)
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el
index 1b8922c2746..d812df1c935 100644
--- a/lisp/cedet/srecode/java.el
+++ b/lisp/cedet/srecode/java.el
@@ -1,6 +1,6 @@
;;; srecode/java.el --- Srecode Java support
-;; Copyright (C) 2009-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -40,16 +40,15 @@ FILENAME_AS_CLASS - file converted to a Java class name."
(fnox (file-name-sans-extension fsym))
(dir (file-name-directory (buffer-file-name)))
(fpak fsym)
+ (proj (ede-current-project))
+ (pths (ede-source-paths proj 'java-mode))
)
(while (string-match "\\.\\| " fpak)
(setq fpak (replace-match "_" t t fpak)))
;; We can extract package from:
;; 1) a java EDE project source paths,
- (cond ((ede-current-project)
- (let* ((proj (ede-current-project))
- (pths (ede-source-paths proj 'java-mode))
- (pth)
- (res))
+ (cond ((and proj pths)
+ (let* ((pth) (res))
(while (and (not res)
(setq pth (expand-file-name (car pths))))
(when (string-match pth dir)
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el
index 1dd9ba4cf47..71ed835e4ff 100644
--- a/lisp/cedet/srecode/map.el
+++ b/lisp/cedet/srecode/map.el
@@ -1,6 +1,6 @@
;;; srecode/map.el --- Manage a template file map
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -67,11 +67,11 @@ Each app keys to an alist of files and modes (as above.)")
)
"A map of srecode templates.")
-(defmethod srecode-map-entry-for-file ((map srecode-map) file)
+(cl-defmethod srecode-map-entry-for-file ((map srecode-map) file)
"Return the entry in MAP for FILE."
(assoc file (oref map files)))
-(defmethod srecode-map-entries-for-mode ((map srecode-map) mode)
+(cl-defmethod srecode-map-entries-for-mode ((map srecode-map) mode)
"Return the entries in MAP for major MODE."
(let ((ans nil))
(dolist (f (oref map files))
@@ -79,12 +79,12 @@ Each app keys to an alist of files and modes (as above.)")
(setq ans (cons f ans))))
ans))
-(defmethod srecode-map-entry-for-app ((map srecode-map) app)
- "Return the entry in MAP for APP'lication."
+(cl-defmethod srecode-map-entry-for-app ((map srecode-map) app)
+ "Return the entry in MAP for APP."
(assoc app (oref map apps))
)
-(defmethod srecode-map-entries-for-app-and-mode ((map srecode-map) app mode)
+(cl-defmethod srecode-map-entries-for-app-and-mode ((map srecode-map) app mode)
"Return the entries in MAP for major MODE."
(let ((ans nil)
(appentry (srecode-map-entry-for-app map app)))
@@ -93,7 +93,7 @@ Each app keys to an alist of files and modes (as above.)")
(setq ans (cons f ans))))
ans))
-(defmethod srecode-map-entry-for-file-anywhere ((map srecode-map) file)
+(cl-defmethod srecode-map-entry-for-file-anywhere ((map srecode-map) file)
"Search in all entry points in MAP for FILE.
Return a list ( APP . FILE-ASSOC ) where APP is nil
in the global map."
@@ -112,13 +112,13 @@ in the global map."
;; Other?
))
-(defmethod srecode-map-delete-file-entry ((map srecode-map) file)
+(cl-defmethod srecode-map-delete-file-entry ((map srecode-map) file)
"Update MAP to exclude FILE from the file list."
(let ((entry (srecode-map-entry-for-file map file)))
(when entry
(object-remove-from-list map 'files entry))))
-(defmethod srecode-map-update-file-entry ((map srecode-map) file mode)
+(cl-defmethod srecode-map-update-file-entry ((map srecode-map) file mode)
"Update a MAP entry for FILE to be used with MODE.
Return non-nil if the MAP was changed."
(let ((entry (srecode-map-entry-for-file map file))
@@ -136,14 +136,14 @@ Return non-nil if the MAP was changed."
))
dirty))
-(defmethod srecode-map-delete-file-entry-from-app ((map srecode-map) file app)
- "Delete from MAP the FILE entry within the APP'lication."
+(cl-defmethod srecode-map-delete-file-entry-from-app ((map srecode-map) file app)
+ "Delete from MAP the FILE entry within the APP."
(let* ((appe (srecode-map-entry-for-app map app))
(fentry (assoc file (cdr appe))))
(setcdr appe (delete fentry (cdr appe))))
)
-(defmethod srecode-map-update-app-file-entry ((map srecode-map) file mode app)
+(cl-defmethod srecode-map-update-app-file-entry ((map srecode-map) file mode app)
"Update the MAP entry for FILE to be used with MODE within APP.
Return non-nil if the map was changed."
(let* ((appentry (srecode-map-entry-for-app map app))
@@ -298,7 +298,7 @@ if that file is NEW, otherwise assume the mode has not changed."
(when (not srecode-current-map)
(condition-case nil
(setq srecode-current-map
- (eieio-persistent-read srecode-map-save-file srecode-map))
+ (eieio-persistent-read srecode-map-save-file 'srecode-map))
(error
;; There was an error loading the old map. Create a new one.
(setq srecode-current-map
diff --git a/lisp/cedet/srecode/mode.el b/lisp/cedet/srecode/mode.el
index e8e1c78198e..a6daff8be56 100644
--- a/lisp/cedet/srecode/mode.el
+++ b/lisp/cedet/srecode/mode.el
@@ -1,6 +1,6 @@
;;; srecode/mode.el --- Minor mode for managing and using SRecode templates
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/cedet/srecode/semantic.el b/lisp/cedet/srecode/semantic.el
index c8b44c68d5d..0ea2ab4a5ff 100644
--- a/lisp/cedet/srecode/semantic.el
+++ b/lisp/cedet/srecode/semantic.el
@@ -1,6 +1,6 @@
;;; srecode/semantic.el --- Semantic specific extensions to SRecode.
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -55,7 +55,7 @@
"Wrap up a collection of semantic tag information.
This class will be used to derive dictionary values.")
-(defmethod srecode-compound-toString((cp srecode-semantic-tag)
+(cl-defmethod srecode-compound-toString((cp srecode-semantic-tag)
function
dictionary)
"Convert the compound dictionary value CP to a string.
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index 2f43dc3872b..7fc35410b48 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -1,6 +1,6 @@
;;; srecode/srt-mode.el --- Major mode for writing screcode macros
-;; Copyright (C) 2005, 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2015 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
@@ -188,6 +188,7 @@ we can tell font lock about them.")
;;;###autoload
(define-derived-mode srecode-template-mode fundamental-mode "SRecode"
+ ;; FIXME: Shouldn't it derive from prog-mode?
"Major-mode for writing SRecode macros."
(set (make-local-variable 'comment-start) ";;")
(set (make-local-variable 'comment-end) "")
@@ -232,7 +233,7 @@ we can tell font lock about them.")
"Provide help for working with macros in a template."
(interactive)
(let* ((root 'srecode-template-inserter)
- (chl (eieio--class-children (class-v root)))
+ (chl (eieio-class-children root))
(ess (srecode-template-get-escape-start))
(ees (srecode-template-get-escape-end))
)
@@ -248,7 +249,7 @@ we can tell font lock about them.")
(showexample t)
)
(setq chl (cdr chl))
- (setq chl (append (eieio--class-children (class-v C)) chl))
+ (setq chl (append (eieio-class-children C) chl))
(catch 'skip
(when (eq C 'srecode-template-inserter-section-end)
@@ -257,9 +258,9 @@ we can tell font lock about them.")
(when (class-abstract-p C)
(throw 'skip nil))
- (princ "`")
+ (princ (substitute-command-keys "`"))
(princ name)
- (princ "'")
+ (princ (substitute-command-keys "'"))
(when (slot-exists-p C 'key)
(when key
(princ " - Character Key: ")
diff --git a/lisp/cedet/srecode/srt-wy.el b/lisp/cedet/srecode/srt-wy.el
deleted file mode 100644
index 450f57d943c..00000000000
--- a/lisp/cedet/srecode/srt-wy.el
+++ /dev/null
@@ -1,306 +0,0 @@
-;;; srecode/srt-wy.el --- Generated parser support file
-
-;; Copyright (C) 2005, 2007-2013 Free Software Foundation, Inc.
-
-;; 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 <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This file was generated from admin/grammars/srecode-template.wy.
-
-;;; Code:
-
-(require 'semantic/lex)
-(eval-when-compile (require 'semantic/bovine))
-
-;;; Prologue
-;;
-
-;;; Declarations
-;;
-(defconst srecode-template-wy--keyword-table
- (semantic-lex-make-keyword-table
- '(("set" . SET)
- ("show" . SHOW)
- ("macro" . MACRO)
- ("context" . CONTEXT)
- ("template" . TEMPLATE)
- ("sectiondictionary" . SECTIONDICTIONARY)
- ("section" . SECTION)
- ("end" . END)
- ("prompt" . PROMPT)
- ("default" . DEFAULT)
- ("defaultmacro" . DEFAULTMACRO)
- ("read" . READ)
- ("bind" . BIND))
- '(("bind" summary "bind \"<letter>\"")
- ("read" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("defaultmacro" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("default" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("prompt" summary "prompt <symbol> \"Describe Symbol: \" [default[macro] <lispsym>|\"valuetext\"] [read <lispsym>]")
- ("end" summary "section ... end")
- ("section" summary "section <name>\\n <dictionary entries>\\n end")
- ("sectiondictionary" summary "sectiondictionary <name>\\n <dictionary entries>")
- ("template" summary "template <name>\\n <template definition>")
- ("context" summary "context <name>")
- ("macro" summary "... macro \"string\" ...")
- ("show" summary "show <name> ; to show a section")
- ("set" summary "set <name> <value>")))
- "Table of language keywords.")
-
-(defconst srecode-template-wy--token-table
- (semantic-lex-make-type-table
- '(("number"
- (number))
- ("string"
- (string))
- ("symbol"
- (symbol))
- ("property"
- (property))
- ("separator"
- (TEMPLATE_BLOCK . "^----"))
- ("newline"
- (newline)))
- '(("number" :declared t)
- ("string" :declared t)
- ("symbol" :declared t)
- ("property" syntax ":\\(\\w\\|\\s_\\)*")
- ("property" :declared t)
- ("newline" :declared t)
- ("punctuation" syntax "\\s.+")
- ("punctuation" :declared t)
- ("keyword" :declared t)))
- "Table of lexical tokens.")
-
-(defconst srecode-template-wy--parse-table
- (progn
- (eval-when-compile
- (require 'semantic/wisent/comp))
- (wisent-compile-grammar
- '((SET SHOW MACRO CONTEXT TEMPLATE SECTIONDICTIONARY SECTION END PROMPT DEFAULT DEFAULTMACRO READ BIND newline TEMPLATE_BLOCK property symbol string number)
- nil
- (template_file
- ((newline)
- nil)
- ((context))
- ((prompt))
- ((variable))
- ((template)))
- (context
- ((CONTEXT symbol newline)
- (wisent-raw-tag
- (semantic-tag $2 'context))))
- (prompt
- ((PROMPT symbol string opt-default-fcn opt-read-fcn newline)
- (wisent-raw-tag
- (semantic-tag $2 'prompt :text
- (read $3)
- :default $4 :read $5))))
- (opt-default-fcn
- ((DEFAULT symbol)
- (progn
- (read $2)))
- ((DEFAULT string)
- (progn
- (read $2)))
- ((DEFAULTMACRO string)
- (progn
- (cons 'macro
- (read $2))))
- (nil nil))
- (opt-read-fcn
- ((READ symbol)
- (progn
- (read $2)))
- (nil nil))
- (variable
- ((SET symbol insertable-string-list newline)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil $3)))
- ((SET symbol number newline)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil
- (list $3))))
- ((SHOW symbol newline)
- (wisent-raw-tag
- (semantic-tag-new-variable $2 nil t))))
- (insertable-string-list
- ((insertable-string)
- (list $1))
- ((insertable-string-list insertable-string)
- (append $1
- (list $2))))
- (insertable-string
- ((string)
- (read $1))
- ((MACRO string)
- (cons 'macro
- (read $2))))
- (template
- ((TEMPLATE templatename opt-dynamic-arguments newline opt-string section-dictionary-list TEMPLATE_BLOCK newline opt-bind)
- (wisent-raw-tag
- (semantic-tag-new-function $2 nil $3 :documentation $5 :code $7 :dictionaries $6 :binding $9))))
- (templatename
- ((symbol))
- ((PROMPT))
- ((CONTEXT))
- ((TEMPLATE))
- ((DEFAULT))
- ((MACRO))
- ((DEFAULTMACRO))
- ((READ))
- ((SET)))
- (opt-dynamic-arguments
- ((property opt-dynamic-arguments)
- (cons $1 $2))
- (nil nil))
- (opt-string
- ((string newline)
- (read $1))
- (nil nil))
- (section-dictionary-list
- (nil nil)
- ((section-dictionary-list flat-section-dictionary)
- (append $1
- (list $2)))
- ((section-dictionary-list section-dictionary)
- (append $1
- (list $2))))
- (flat-section-dictionary
- ((SECTIONDICTIONARY string newline flat-dictionary-entry-list)
- (cons
- (read $2)
- $4)))
- (flat-dictionary-entry-list
- (nil nil)
- ((flat-dictionary-entry-list flat-dictionary-entry)
- (append $1 $2)))
- (flat-dictionary-entry
- ((variable)
- (wisent-cook-tag $1)))
- (section-dictionary
- ((SECTION string newline dictionary-entry-list END newline)
- (cons
- (read $2)
- $4)))
- (dictionary-entry-list
- (nil nil)
- ((dictionary-entry-list dictionary-entry)
- (append $1 $2)))
- (dictionary-entry
- ((variable)
- (wisent-cook-tag $1))
- ((section-dictionary)
- (list $1)))
- (opt-bind
- ((BIND string newline)
- (read $2))
- (nil nil)))
- '(template_file)))
- "Parser table.")
-
-(defun srecode-template-wy--install-parser ()
- "Setup the Semantic Parser."
- (semantic-install-function-overrides
- '((parse-stream . wisent-parse-stream)))
- (setq semantic-parser-name "LALR"
- semantic--parse-table srecode-template-wy--parse-table
- semantic-debug-parser-source "srecode-template.wy"
- semantic-flex-keywords-obarray srecode-template-wy--keyword-table
- semantic-lex-types-obarray srecode-template-wy--token-table)
- ;; Collect unmatched syntax lexical tokens
- (semantic-make-local-hook 'wisent-discarding-token-functions)
- (add-hook 'wisent-discarding-token-functions
- 'wisent-collect-unmatched-syntax nil t))
-
-
-;;; Analyzers
-;;
-(define-lex-regex-type-analyzer srecode-template-wy--<property>-regexp-analyzer
- "regexp analyzer for <property> tokens."
- ":\\(\\w\\|\\s_\\)*"
- nil
- 'property)
-
-(define-lex-regex-type-analyzer srecode-template-wy--<symbol>-regexp-analyzer
- "regexp analyzer for <symbol> tokens."
- "\\(\\sw\\|\\s_\\)+"
- nil
- 'symbol)
-
-(define-lex-regex-type-analyzer srecode-template-wy--<number>-regexp-analyzer
- "regexp analyzer for <number> tokens."
- semantic-lex-number-expression
- nil
- 'number)
-
-(define-lex-string-type-analyzer srecode-template-wy--<punctuation>-string-analyzer
- "string analyzer for <punctuation> tokens."
- "\\s.+"
- nil
- 'punctuation)
-
-(define-lex-sexp-type-analyzer srecode-template-wy--<string>-sexp-analyzer
- "sexp analyzer for <string> tokens."
- "\\s\""
- 'string)
-
-(define-lex-keyword-type-analyzer srecode-template-wy--<keyword>-keyword-analyzer
- "keyword analyzer for <keyword> tokens."
- "\\(\\sw\\|\\s_\\)+")
-
-
-;;; Epilogue
-;;
-(define-lex-simple-regex-analyzer srecode-template-property-analyzer
- "Detect and create a dynamic argument properties."
- ":\\(\\w\\|\\s_\\)*" 'property 0)
-
-(define-lex-regex-analyzer srecode-template-separator-block
- "Detect and create a template quote block."
- "^----\n"
- (semantic-lex-push-token
- (semantic-lex-token
- 'TEMPLATE_BLOCK
- (match-end 0)
- (semantic-lex-unterminated-syntax-protection 'TEMPLATE_BLOCK
- (goto-char (match-end 0))
- (re-search-forward "^----$")
- (match-beginning 0))))
- (setq semantic-lex-end-point (point)))
-
-
-(define-lex wisent-srecode-template-lexer
- "Lexical analyzer that handles SRecode Template buffers.
-It ignores whitespace, newlines and comments."
- semantic-lex-newline
- semantic-lex-ignore-whitespace
- semantic-lex-ignore-newline
- semantic-lex-ignore-comments
- srecode-template-separator-block
- srecode-template-wy--<keyword>-keyword-analyzer
- srecode-template-property-analyzer
- srecode-template-wy--<number>-regexp-analyzer
- srecode-template-wy--<symbol>-regexp-analyzer
- srecode-template-wy--<string>-sexp-analyzer
- srecode-template-wy--<punctuation>-string-analyzer
- semantic-lex-default-action
- )
-
-(provide 'srecode/srt-wy)
-
-;;; srecode/srt-wy.el ends here
diff --git a/lisp/cedet/srecode/srt.el b/lisp/cedet/srecode/srt.el
index 1fad31dafd6..f369e45a834 100644
--- a/lisp/cedet/srecode/srt.el
+++ b/lisp/cedet/srecode/srt.el
@@ -1,6 +1,6 @@
;;; srecode/srt.el --- argument handlers for SRT files
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/cedet/srecode/table.el b/lisp/cedet/srecode/table.el
index 26163bd1e51..a2baa7b231f 100644
--- a/lisp/cedet/srecode/table.el
+++ b/lisp/cedet/srecode/table.el
@@ -1,6 +1,6 @@
;;; srecode/table.el --- Tables of Semantic Recoders
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -26,6 +26,7 @@
;;
(require 'eieio)
+(require 'cl-generic)
(require 'eieio-base)
(require 'mode-local)
(require 'srecode)
@@ -172,7 +173,7 @@ calculate all inherited templates from parent modes."
new))))
-(defmethod srecode-mode-table-find ((mt srecode-mode-table) file)
+(cl-defmethod srecode-mode-table-find ((mt srecode-mode-table) file)
"Look in the mode table MT for a template table from FILE.
Return nil if there was none."
(object-assoc file 'file (oref mt modetables)))
@@ -235,7 +236,7 @@ Use PREDICATE is the same as for the `sort' function."
(srecode-dump tmp))
)))
-(defmethod srecode-dump ((tab srecode-mode-table))
+(cl-defmethod srecode-dump ((tab srecode-mode-table))
"Dump the contents of the SRecode mode table TAB."
(princ "MODE TABLE FOR ")
(princ (oref tab :major-mode))
@@ -248,7 +249,7 @@ Use PREDICATE is the same as for the `sort' function."
(setq subtab (cdr subtab)))
))
-(defmethod srecode-dump ((tab srecode-template-table))
+(cl-defmethod srecode-dump ((tab srecode-template-table))
"Dump the contents of the SRecode template table TAB."
(princ "Template Table for ")
(princ (eieio-object-name-string tab))
diff --git a/lisp/cedet/srecode/template.el b/lisp/cedet/srecode/template.el
index e3241a2ef40..3a7c45e9e06 100644
--- a/lisp/cedet/srecode/template.el
+++ b/lisp/cedet/srecode/template.el
@@ -1,6 +1,6 @@
;;; srecode/template.el --- SRecoder template language parser support.
-;; Copyright (C) 2005, 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2015 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
diff --git a/lisp/cedet/srecode/texi.el b/lisp/cedet/srecode/texi.el
index 9130c6ff863..38bdc9a2f72 100644
--- a/lisp/cedet/srecode/texi.el
+++ b/lisp/cedet/srecode/texi.el
@@ -1,6 +1,6 @@
;;; srecode/texi.el --- Srecode texinfo support.
-;; Copyright (C) 2008-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
@@ -241,11 +241,11 @@ This is to take advantage of TeXinfo's markup symbols."
For instances where CLASS is the class being referenced, do not Xref
that class.
- `function' => @dfn{function}
- `variable' => @code{variable}
- `class' => @code{class} @xref{class}
- `unknown' => @code{unknown}
- \"text\" => ``text''
+ function => @dfn{function}
+ variable => @code{variable}
+ class => @code{class} @xref{class}
+ unknown => @code{unknown}
+ \"text\" => \\=`\\=`text\\='\\='
'quoteme => @code{quoteme}
non-nil => non-@code{nil}
t => @code{t}
@@ -253,7 +253,7 @@ that class.
[ stuff ] => @code{[ stuff ]}
Key => @kbd{Key} (key is C\\-h, M\\-h, SPC, RET, TAB and the like)
... => @dots{}"
- (while (string-match "`\\([-a-zA-Z0-9<>.]+\\)'" string)
+ (while (string-match "[`‘]\\([-a-zA-Z0-9<>.]+\\)['’]" string)
(let* ((vs (substring string (match-beginning 1) (match-end 1)))
(v (intern-soft vs)))
(setq string