diff options
| author | Stefan Monnier | 2015-05-08 13:28:57 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-05-08 13:28:57 -0400 |
| commit | e13e72a27962acc93e7d86afba1ed15363c5229e (patch) | |
| tree | 0d2163f7f3c748264a636e12e4753a471df1a65b /lisp/cedet/srecode | |
| parent | 91739fe21cd0c17472110b1af07df529d95a8f3b (diff) | |
| download | emacs-e13e72a27962acc93e7d86afba1ed15363c5229e.tar.gz emacs-e13e72a27962acc93e7d86afba1ed15363c5229e.zip | |
CEDET (srecode-pop, srecode-peek): Don't use `subclass'
* lisp/cedet/srecode/insert.el (srecode-pop, srecode-peek): Don't use
`subclass' since they're never called with a class.
(srecode-insert-method, srecode-insert-subtemplate): Avoid obsolete
srecode-dictionary-child-p.
Diffstat (limited to 'lisp/cedet/srecode')
| -rw-r--r-- | lisp/cedet/srecode/insert.el | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el index 0c13ee51e34..426e0783982 100644 --- a/lisp/cedet/srecode/insert.el +++ b/lisp/cedet/srecode/insert.el | |||
| @@ -264,13 +264,12 @@ Optional argument TEMP is the template that is getting its arguments resolved." | |||
| 264 | "Push the srecoder template ST onto the active stack." | 264 | "Push the srecoder template ST onto the active stack." |
| 265 | (oset st active (cons st (oref st active)))) | 265 | (oset st active (cons st (oref st active)))) |
| 266 | 266 | ||
| 267 | (cl-defmethod srecode-pop ((st (subclass srecode-template))) | 267 | (cl-defmethod srecode-pop ((st srecode-template)) |
| 268 | "Pop the srecoder template ST onto the active stack. | 268 | "Pop the srecoder template ST onto the active stack." |
| 269 | ST can be a class, or an object." | ||
| 270 | (oset st active (cdr (oref st active)))) | 269 | (oset st active (cdr (oref st active)))) |
| 271 | 270 | ||
| 272 | (cl-defmethod srecode-peek ((st (subclass srecode-template))) | 271 | (cl-defmethod srecode-peek ((st srecode-template)) |
| 273 | "Fetch the topmost active template record. ST can be a class." | 272 | "Fetch the topmost active template record." |
| 274 | (car (oref st active))) | 273 | (car (oref st active))) |
| 275 | 274 | ||
| 276 | (cl-defmethod srecode-insert-method ((st srecode-template) dictionary) | 275 | (cl-defmethod srecode-insert-method ((st srecode-template) dictionary) |
| @@ -363,7 +362,7 @@ occur in your template.") | |||
| 363 | ((stringp i) | 362 | ((stringp i) |
| 364 | (princ i)))))) | 363 | (princ i)))))) |
| 365 | 364 | ||
| 366 | (cl-defmethod srecode-dump ((ins srecode-template-inserter-newline) indent) | 365 | (cl-defmethod srecode-dump ((ins srecode-template-inserter-newline) _indent) |
| 367 | "Dump the state of the SRecode template inserter INS." | 366 | "Dump the state of the SRecode template inserter INS." |
| 368 | (cl-call-next-method) | 367 | (cl-call-next-method) |
| 369 | (when (oref ins hard) | 368 | (when (oref ins hard) |
| @@ -425,8 +424,8 @@ Specify the :blank argument to enable this inserter.") | |||
| 425 | ) | 424 | ) |
| 426 | "Allow comments within template coding. This inserts nothing.") | 425 | "Allow comments within template coding. This inserts nothing.") |
| 427 | 426 | ||
| 428 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-comment)) | 427 | (cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-comment)) |
| 429 | escape-start escape-end) | 428 | escape-start escape-end) |
| 430 | "Insert an example using inserter INS. | 429 | "Insert an example using inserter INS. |
| 431 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 430 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| 432 | (princ " ") | 431 | (princ " ") |
| @@ -436,8 +435,8 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 436 | (terpri) | 435 | (terpri) |
| 437 | ) | 436 | ) |
| 438 | 437 | ||
| 439 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-comment) | 438 | (cl-defmethod srecode-insert-method ((_sti srecode-template-inserter-comment) |
| 440 | dictionary) | 439 | _dictionary) |
| 441 | "Don't insert anything for comment macros in STI." | 440 | "Don't insert anything for comment macros in STI." |
| 442 | nil) | 441 | nil) |
| 443 | 442 | ||
| @@ -491,7 +490,7 @@ If SECONDNAME is nil, return VALUE." | |||
| 491 | (setq val (srecode-insert-variable-secondname-handler | 490 | (setq val (srecode-insert-variable-secondname-handler |
| 492 | sti dictionary val fcnpart))) | 491 | sti dictionary val fcnpart))) |
| 493 | ;; Compound data value | 492 | ;; Compound data value |
| 494 | ((srecode-dictionary-compound-value-child-p val) | 493 | ((cl-typep val 'srecode-dictionary-compound-value) |
| 495 | ;; Force FCN to be a symbol | 494 | ;; Force FCN to be a symbol |
| 496 | (when fcnpart (setq fcnpart (read fcnpart))) | 495 | (when fcnpart (setq fcnpart (read fcnpart))) |
| 497 | ;; Convert compound value to a string with the fcn. | 496 | ;; Convert compound value to a string with the fcn. |
| @@ -502,7 +501,7 @@ If SECONDNAME is nil, return VALUE." | |||
| 502 | (setq do-princ nil))) | 501 | (setq do-princ nil))) |
| 503 | 502 | ||
| 504 | ;; Dictionaries... not allowed in this style | 503 | ;; Dictionaries... not allowed in this style |
| 505 | ((srecode-dictionary-child-p val) | 504 | ((cl-typep val 'srecode-dictionary) |
| 506 | (srecode-insert-report-error | 505 | (srecode-insert-report-error |
| 507 | dictionary | 506 | dictionary |
| 508 | "Macro %s cannot insert a dictionary - use section macros instead" | 507 | "Macro %s cannot insert a dictionary - use section macros instead" |
| @@ -661,7 +660,7 @@ Use DICTIONARY to resolve values." | |||
| 661 | ;; across multiple locations. | 660 | ;; across multiple locations. |
| 662 | compound-value)) | 661 | compound-value)) |
| 663 | 662 | ||
| 664 | (cl-defmethod srecode-dump ((ins srecode-template-inserter-ask) indent) | 663 | (cl-defmethod srecode-dump ((ins srecode-template-inserter-ask) _indent) |
| 665 | "Dump the state of the SRecode template inserter INS." | 664 | "Dump the state of the SRecode template inserter INS." |
| 666 | (cl-call-next-method) | 665 | (cl-call-next-method) |
| 667 | (princ " : \"") | 666 | (princ " : \"") |
| @@ -682,7 +681,7 @@ to 10 characters, with spaces added to the left. Use `right' for adding | |||
| 682 | spaces to the right.") | 681 | spaces to the right.") |
| 683 | 682 | ||
| 684 | (cl-defmethod srecode-insert-variable-secondname-handler | 683 | (cl-defmethod srecode-insert-variable-secondname-handler |
| 685 | ((sti srecode-template-inserter-width) dictionary value width) | 684 | ((_sti srecode-template-inserter-width) dictionary value width) |
| 686 | "For VALUE handle WIDTH behaviors for this variable inserter. | 685 | "For VALUE handle WIDTH behaviors for this variable inserter. |
| 687 | Return the result as a string. | 686 | Return the result as a string. |
| 688 | By default, treat as a function name." | 687 | By default, treat as a function name." |
| @@ -714,8 +713,8 @@ By default, treat as a function name." | |||
| 714 | (concat padchars value) | 713 | (concat padchars value) |
| 715 | (concat value padchars)))))) | 714 | (concat value padchars)))))) |
| 716 | 715 | ||
| 717 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-width)) | 716 | (cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-width)) |
| 718 | escape-start escape-end) | 717 | escape-start escape-end) |
| 719 | "Insert an example using inserter INS. | 718 | "Insert an example using inserter INS. |
| 720 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 719 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| 721 | (princ " ") | 720 | (princ " ") |
| @@ -750,8 +749,8 @@ The cursor is placed at the ^ macro after insertion. | |||
| 750 | Some inserter macros, such as `srecode-template-inserter-include-wrap' | 749 | Some inserter macros, such as `srecode-template-inserter-include-wrap' |
| 751 | will place text at the ^ macro from the included macro.") | 750 | will place text at the ^ macro from the included macro.") |
| 752 | 751 | ||
| 753 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-point)) | 752 | (cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-point)) |
| 754 | escape-start escape-end) | 753 | escape-start escape-end) |
| 755 | "Insert an example using inserter INS. | 754 | "Insert an example using inserter INS. |
| 756 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 755 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| 757 | (princ " ") | 756 | (princ " ") |
| @@ -787,8 +786,8 @@ generalized marker will do something else. See | |||
| 787 | "Wrap a section of a template under the control of a macro." | 786 | "Wrap a section of a template under the control of a macro." |
| 788 | :abstract t) | 787 | :abstract t) |
| 789 | 788 | ||
| 790 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-subtemplate)) | 789 | (cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-subtemplate)) |
| 791 | escape-start escape-end) | 790 | escape-start escape-end) |
| 792 | "Insert an example using inserter INS. | 791 | "Insert an example using inserter INS. |
| 793 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 792 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| 794 | (cl-call-next-method) | 793 | (cl-call-next-method) |
| @@ -805,7 +804,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 805 | dict slot) | 804 | dict slot) |
| 806 | "Insert a subtemplate for the inserter STI with dictionary DICT." | 805 | "Insert a subtemplate for the inserter STI with dictionary DICT." |
| 807 | ;; Make sure that only dictionaries are used. | 806 | ;; Make sure that only dictionaries are used. |
| 808 | (unless (srecode-dictionary-child-p dict) | 807 | (unless (cl-typep dict 'srecode-dictionary) |
| 809 | (srecode-insert-report-error | 808 | (srecode-insert-report-error |
| 810 | dict | 809 | dict |
| 811 | "Only section dictionaries allowed for `%s'" | 810 | "Only section dictionaries allowed for `%s'" |
| @@ -889,8 +888,8 @@ Return the remains of INPUT." | |||
| 889 | "All template segments between the section-start and section-end | 888 | "All template segments between the section-start and section-end |
| 890 | are treated specially.") | 889 | are treated specially.") |
| 891 | 890 | ||
| 892 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-section-end) | 891 | (cl-defmethod srecode-insert-method ((_sti srecode-template-inserter-section-end) |
| 893 | dictionary) | 892 | _dictionary) |
| 894 | "Insert the STI inserter." | 893 | "Insert the STI inserter." |
| 895 | ) | 894 | ) |
| 896 | 895 | ||
| @@ -912,7 +911,7 @@ are treated specially.") | |||
| 912 | The included template will have additional dictionary entries from the subdictionary | 911 | The included template will have additional dictionary entries from the subdictionary |
| 913 | stored specified by this macro.") | 912 | stored specified by this macro.") |
| 914 | 913 | ||
| 915 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-include)) | 914 | (cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-include)) |
| 916 | escape-start escape-end) | 915 | escape-start escape-end) |
| 917 | "Insert an example using inserter INS. | 916 | "Insert an example using inserter INS. |
| 918 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 917 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| @@ -1017,7 +1016,7 @@ stored specified by this macro. If the included macro includes a ^ macro, | |||
| 1017 | then the text between this macro and the end macro will be inserted at | 1016 | then the text between this macro and the end macro will be inserted at |
| 1018 | the ^ macro.") | 1017 | the ^ macro.") |
| 1019 | 1018 | ||
| 1020 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-include-wrap)) | 1019 | (cl-defmethod srecode-inserter-prin-example ((_ins (subclass srecode-template-inserter-include-wrap)) |
| 1021 | escape-start escape-end) | 1020 | escape-start escape-end) |
| 1022 | "Insert an example using inserter INS. | 1021 | "Insert an example using inserter INS. |
| 1023 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 1022 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |