aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cedet/srecode/insert.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet/srecode/insert.el')
-rw-r--r--lisp/cedet/srecode/insert.el52
1 files changed, 25 insertions, 27 deletions
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."