aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cedet/srecode
diff options
context:
space:
mode:
authorJan D2015-05-17 16:46:34 +0200
committerJan D2015-05-17 16:46:34 +0200
commit6445ee0fb751ae2c1dfef900d44721b3d952812f (patch)
treed43006cb93d9ea7b00ea02aabcd5577c41ff827f /lisp/cedet/srecode
parentf92ac2e82ed199d6f25d2a59508e08addb1150ac (diff)
parentc9c4708ed47b18987940a71b98eb9873150d2b95 (diff)
downloademacs-6445ee0fb751ae2c1dfef900d44721b3d952812f.tar.gz
emacs-6445ee0fb751ae2c1dfef900d44721b3d952812f.zip
Merge branch 'master' into cairo
Diffstat (limited to 'lisp/cedet/srecode')
-rw-r--r--lisp/cedet/srecode/compile.el17
-rw-r--r--lisp/cedet/srecode/dictionary.el4
-rw-r--r--lisp/cedet/srecode/insert.el52
3 files changed, 35 insertions, 38 deletions
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index c93a6f72a9a..a8d6a5008bb 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -116,19 +116,19 @@ additional static argument data."))
116Plain text strings are not handled via this baseclass." 116Plain text strings are not handled via this baseclass."
117 :abstract t) 117 :abstract t)
118 118
119(cl-defmethod srecode-parse-input ((ins srecode-template-inserter) 119(cl-defmethod srecode-parse-input ((_ins srecode-template-inserter)
120 tag input STATE) 120 _tag input _STATE)
121 "For the template inserter INS, parse INPUT. 121 "For the template inserter INS, parse INPUT.
122Shorten input only by the amount needed. 122Shorten input only by the amount needed.
123Return the remains of INPUT. 123Return the remains of INPUT.
124STATE is the current compilation state." 124STATE is the current compilation state."
125 input) 125 input)
126 126
127(cl-defmethod srecode-match-end ((ins srecode-template-inserter) name) 127(cl-defmethod srecode-match-end ((_ins srecode-template-inserter) _name)
128 "For the template inserter INS, do I end a section called NAME?" 128 "For the template inserter INS, do I end a section called NAME?"
129 nil) 129 nil)
130 130
131(cl-defmethod srecode-inserter-apply-state ((ins srecode-template-inserter) STATE) 131(cl-defmethod srecode-inserter-apply-state ((_ins srecode-template-inserter) _STATE)
132 "For the template inserter INS, apply information from STATE." 132 "For the template inserter INS, apply information from STATE."
133 nil) 133 nil)
134 134
@@ -415,7 +415,7 @@ If END-NAME is specified, and the input string"
415 (match-end 0))) 415 (match-end 0)))
416 (namestart (match-end 0)) 416 (namestart (match-end 0))
417 (junk (string-match regexend what namestart)) 417 (junk (string-match regexend what namestart))
418 end tail name key) 418 end tail name)
419 ;; Add string to compiled output 419 ;; Add string to compiled output
420 (when (> (length prefix) 0) 420 (when (> (length prefix) 0)
421 (setq comp (cons prefix comp))) 421 (setq comp (cons prefix comp)))
@@ -453,8 +453,7 @@ If END-NAME is specified, and the input string"
453 (semantic-tag-name tag))) 453 (semantic-tag-name tag)))
454 ) 454 )
455 ;; Add string to compiled output 455 ;; Add string to compiled output
456 (setq name (substring what namestart end) 456 (setq name (substring what namestart end))
457 key nil)
458 ;; Trim WHAT back. 457 ;; Trim WHAT back.
459 (setq what (substring what tail)) 458 (setq what (substring what tail))
460 ;; Get the inserter 459 ;; Get the inserter
@@ -523,7 +522,7 @@ to the inserter constructor."
523 (setq classes (append classes (eieio-class-children (car classes)))) 522 (setq classes (append classes (eieio-class-children (car classes))))
524 ;; Do we have a match? 523 ;; Do we have a match?
525 (when (and (not (class-abstract-p (car classes))) 524 (when (and (not (class-abstract-p (car classes)))
526 (equal (oref (car classes) key) key)) 525 (equal (oref-default (car classes) key) key))
527 ;; Create the new class, and apply state. 526 ;; Create the new class, and apply state.
528 (setq new (apply (car classes) name props)) 527 (setq new (apply (car classes) name props))
529 (srecode-inserter-apply-state new STATE) 528 (srecode-inserter-apply-state new STATE)
@@ -642,7 +641,7 @@ Argument INDENT specifies the indentation level for the list."
642 (princ "\n")))) 641 (princ "\n"))))
643 ) 642 )
644 643
645(cl-defmethod srecode-dump ((ins srecode-template-inserter) indent) 644(cl-defmethod srecode-dump ((ins srecode-template-inserter) _indent)
646 "Dump the state of the SRecode template inserter INS." 645 "Dump the state of the SRecode template inserter INS."
647 (princ "INS: \"") 646 (princ "INS: \"")
648 (princ (eieio-object-name-string ins)) 647 (princ (eieio-object-name-string ins))
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el
index 97d3310a2ae..27e730f9d6a 100644
--- a/lisp/cedet/srecode/dictionary.el
+++ b/lisp/cedet/srecode/dictionary.el
@@ -195,8 +195,8 @@ associated with a buffer or parent."
195 initfrombuff t))) 195 initfrombuff t)))
196 196
197 ;; Create the new dictionary object. 197 ;; Create the new dictionary object.
198 (let ((dict (srecode-dictionary 198 (let ((dict (make-instance
199 major-mode 199 'srecode-dictionary
200 :buffer buffer 200 :buffer buffer
201 :parent parent 201 :parent parent
202 :namehash (make-hash-table :test 'equal 202 :namehash (make-hash-table :test 'equal
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index 0c13ee51e34..c2a70fe030f 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -35,7 +35,6 @@
35(require 'srecode/args) 35(require 'srecode/args)
36(require 'srecode/filters) 36(require 'srecode/filters)
37 37
38(defvar srecode-template-inserter-point)
39(declare-function srecode-overlaid-activate "srecode/fields") 38(declare-function srecode-overlaid-activate "srecode/fields")
40(declare-function srecode-template-inserted-region "srecode/fields") 39(declare-function srecode-template-inserted-region "srecode/fields")
41 40
@@ -145,7 +144,7 @@ has set everything up already."
145 ) 144 )
146 (set-buffer standard-output) 145 (set-buffer standard-output)
147 (setq end-mark (point-marker)) 146 (setq end-mark (point-marker))
148 (goto-char (oref srecode-template-inserter-point point))) 147 (goto-char (oref-default 'srecode-template-inserter-point point)))
149 (oset-default 'srecode-template-inserter-point point eieio-unbound) 148 (oset-default 'srecode-template-inserter-point point eieio-unbound)
150 149
151 ;; Return the end-mark. 150 ;; Return the end-mark.
@@ -264,13 +263,12 @@ Optional argument TEMP is the template that is getting its arguments resolved."
264 "Push the srecoder template ST onto the active stack." 263 "Push the srecoder template ST onto the active stack."
265 (oset st active (cons st (oref st active)))) 264 (oset st active (cons st (oref st active))))
266 265
267(cl-defmethod srecode-pop ((st (subclass srecode-template))) 266(cl-defmethod srecode-pop ((st srecode-template))
268 "Pop the srecoder template ST onto the active stack. 267 "Pop the srecoder template ST onto the active stack."
269ST can be a class, or an object."
270 (oset st active (cdr (oref st active)))) 268 (oset st active (cdr (oref st active))))
271 269
272(cl-defmethod srecode-peek ((st (subclass srecode-template))) 270(cl-defmethod srecode-peek ((st srecode-template))
273 "Fetch the topmost active template record. ST can be a class." 271 "Fetch the topmost active template record."
274 (car (oref st active))) 272 (car (oref st active)))
275 273
276(cl-defmethod srecode-insert-method ((st srecode-template) dictionary) 274(cl-defmethod srecode-insert-method ((st srecode-template) dictionary)
@@ -363,7 +361,7 @@ occur in your template.")
363 ((stringp i) 361 ((stringp i)
364 (princ i)))))) 362 (princ i))))))
365 363
366(cl-defmethod srecode-dump ((ins srecode-template-inserter-newline) indent) 364(cl-defmethod srecode-dump ((ins srecode-template-inserter-newline) _indent)
367 "Dump the state of the SRecode template inserter INS." 365 "Dump the state of the SRecode template inserter INS."
368 (cl-call-next-method) 366 (cl-call-next-method)
369 (when (oref ins hard) 367 (when (oref ins hard)
@@ -425,8 +423,8 @@ Specify the :blank argument to enable this inserter.")
425 ) 423 )
426 "Allow comments within template coding. This inserts nothing.") 424 "Allow comments within template coding. This inserts nothing.")
427 425
428(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-comment)) 426(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-comment))
429 escape-start escape-end) 427 escape-start escape-end)
430 "Insert an example using inserter INS. 428 "Insert an example using inserter INS.
431Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." 429Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
432 (princ " ") 430 (princ " ")
@@ -436,8 +434,8 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
436 (terpri) 434 (terpri)
437 ) 435 )
438 436
439(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-comment) 437(cl-defmethod srecode-insert-method ((_sti srecode-template-inserter-comment)
440 dictionary) 438 _dictionary)
441 "Don't insert anything for comment macros in STI." 439 "Don't insert anything for comment macros in STI."
442 nil) 440 nil)
443 441
@@ -491,7 +489,7 @@ If SECONDNAME is nil, return VALUE."
491 (setq val (srecode-insert-variable-secondname-handler 489 (setq val (srecode-insert-variable-secondname-handler
492 sti dictionary val fcnpart))) 490 sti dictionary val fcnpart)))
493 ;; Compound data value 491 ;; Compound data value
494 ((srecode-dictionary-compound-value-child-p val) 492 ((cl-typep val 'srecode-dictionary-compound-value)
495 ;; Force FCN to be a symbol 493 ;; Force FCN to be a symbol
496 (when fcnpart (setq fcnpart (read fcnpart))) 494 (when fcnpart (setq fcnpart (read fcnpart)))
497 ;; Convert compound value to a string with the fcn. 495 ;; Convert compound value to a string with the fcn.
@@ -502,7 +500,7 @@ If SECONDNAME is nil, return VALUE."
502 (setq do-princ nil))) 500 (setq do-princ nil)))
503 501
504 ;; Dictionaries... not allowed in this style 502 ;; Dictionaries... not allowed in this style
505 ((srecode-dictionary-child-p val) 503 ((cl-typep val 'srecode-dictionary)
506 (srecode-insert-report-error 504 (srecode-insert-report-error
507 dictionary 505 dictionary
508 "Macro %s cannot insert a dictionary - use section macros instead" 506 "Macro %s cannot insert a dictionary - use section macros instead"
@@ -661,7 +659,7 @@ Use DICTIONARY to resolve values."
661 ;; across multiple locations. 659 ;; across multiple locations.
662 compound-value)) 660 compound-value))
663 661
664(cl-defmethod srecode-dump ((ins srecode-template-inserter-ask) indent) 662(cl-defmethod srecode-dump ((ins srecode-template-inserter-ask) _indent)
665 "Dump the state of the SRecode template inserter INS." 663 "Dump the state of the SRecode template inserter INS."
666 (cl-call-next-method) 664 (cl-call-next-method)
667 (princ " : \"") 665 (princ " : \"")
@@ -682,7 +680,7 @@ to 10 characters, with spaces added to the left. Use `right' for adding
682spaces to the right.") 680spaces to the right.")
683 681
684(cl-defmethod srecode-insert-variable-secondname-handler 682(cl-defmethod srecode-insert-variable-secondname-handler
685 ((sti srecode-template-inserter-width) dictionary value width) 683 ((_sti srecode-template-inserter-width) dictionary value width)
686 "For VALUE handle WIDTH behaviors for this variable inserter. 684 "For VALUE handle WIDTH behaviors for this variable inserter.
687Return the result as a string. 685Return the result as a string.
688By default, treat as a function name." 686By default, treat as a function name."
@@ -714,8 +712,8 @@ By default, treat as a function name."
714 (concat padchars value) 712 (concat padchars value)
715 (concat value padchars)))))) 713 (concat value padchars))))))
716 714
717(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-width)) 715(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-width))
718 escape-start escape-end) 716 escape-start escape-end)
719 "Insert an example using inserter INS. 717 "Insert an example using inserter INS.
720Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." 718Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
721 (princ " ") 719 (princ " ")
@@ -750,8 +748,8 @@ The cursor is placed at the ^ macro after insertion.
750Some inserter macros, such as `srecode-template-inserter-include-wrap' 748Some inserter macros, such as `srecode-template-inserter-include-wrap'
751will place text at the ^ macro from the included macro.") 749will place text at the ^ macro from the included macro.")
752 750
753(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-point)) 751(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-point))
754 escape-start escape-end) 752 escape-start escape-end)
755 "Insert an example using inserter INS. 753 "Insert an example using inserter INS.
756Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." 754Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
757 (princ " ") 755 (princ " ")
@@ -787,8 +785,8 @@ generalized marker will do something else. See
787 "Wrap a section of a template under the control of a macro." 785 "Wrap a section of a template under the control of a macro."
788 :abstract t) 786 :abstract t)
789 787
790(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-subtemplate)) 788(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-subtemplate))
791 escape-start escape-end) 789 escape-start escape-end)
792 "Insert an example using inserter INS. 790 "Insert an example using inserter INS.
793Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." 791Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
794 (cl-call-next-method) 792 (cl-call-next-method)
@@ -805,7 +803,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
805 dict slot) 803 dict slot)
806 "Insert a subtemplate for the inserter STI with dictionary DICT." 804 "Insert a subtemplate for the inserter STI with dictionary DICT."
807 ;; Make sure that only dictionaries are used. 805 ;; Make sure that only dictionaries are used.
808 (unless (srecode-dictionary-child-p dict) 806 (unless (cl-typep dict 'srecode-dictionary)
809 (srecode-insert-report-error 807 (srecode-insert-report-error
810 dict 808 dict
811 "Only section dictionaries allowed for `%s'" 809 "Only section dictionaries allowed for `%s'"
@@ -889,8 +887,8 @@ Return the remains of INPUT."
889 "All template segments between the section-start and section-end 887 "All template segments between the section-start and section-end
890are treated specially.") 888are treated specially.")
891 889
892(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-section-end) 890(cl-defmethod srecode-insert-method ((_sti srecode-template-inserter-section-end)
893 dictionary) 891 _dictionary)
894 "Insert the STI inserter." 892 "Insert the STI inserter."
895 ) 893 )
896 894
@@ -912,7 +910,7 @@ are treated specially.")
912The included template will have additional dictionary entries from the subdictionary 910The included template will have additional dictionary entries from the subdictionary
913stored specified by this macro.") 911stored specified by this macro.")
914 912
915(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-include)) 913(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-include))
916 escape-start escape-end) 914 escape-start escape-end)
917 "Insert an example using inserter INS. 915 "Insert an example using inserter INS.
918Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." 916Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
@@ -1017,7 +1015,7 @@ stored specified by this macro. If the included macro includes a ^ macro,
1017then the text between this macro and the end macro will be inserted at 1015then the text between this macro and the end macro will be inserted at
1018the ^ macro.") 1016the ^ macro.")
1019 1017
1020(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-include-wrap)) 1018(cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-include-wrap))
1021 escape-start escape-end) 1019 escape-start escape-end)
1022 "Insert an example using inserter INS. 1020 "Insert an example using inserter INS.
1023Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." 1021Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."