diff options
| author | Stefan Monnier | 2015-02-04 13:49:49 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2015-02-04 13:49:49 -0500 |
| commit | 73b17f7c2b723a0ad4ea04cf1a5a8be5bbdf6121 (patch) | |
| tree | fc2ee663521960bf1c102bb98a72f31903e5110b /lisp/cedet/srecode | |
| parent | 102a21d68976ab9dc85304e0bc47b7562d3cf93f (diff) | |
| download | emacs-73b17f7c2b723a0ad4ea04cf1a5a8be5bbdf6121.tar.gz emacs-73b17f7c2b723a0ad4ea04cf1a5a8be5bbdf6121.zip | |
* lisp/cedet: Use cl-generic instead of EIEIO's defgeneric/defmethod
* lisp/cedet/**/*.el: Mechanically replace all calls to defmethod/defgeneric
by calls to cl-defmethod/cl-defgeneric.
* lisp/cedet/srecode/table.el:
* lisp/cedet/srecode/fields.el:
* lisp/cedet/srecode/dictionary.el:
* lisp/cedet/srecode/compile.el:
* lisp/cedet/semantic/debug.el:
* lisp/cedet/semantic/db-ref.el:
* lisp/cedet/ede/base.el:
* lisp/cedet/ede/auto.el:
* lisp/cedet/ede.el: Require `cl-generic'.
Diffstat (limited to 'lisp/cedet/srecode')
| -rw-r--r-- | lisp/cedet/srecode/compile.el | 15 | ||||
| -rw-r--r-- | lisp/cedet/srecode/dictionary.el | 35 | ||||
| -rw-r--r-- | lisp/cedet/srecode/extract.el | 24 | ||||
| -rw-r--r-- | lisp/cedet/srecode/fields.el | 43 | ||||
| -rw-r--r-- | lisp/cedet/srecode/find.el | 10 | ||||
| -rw-r--r-- | lisp/cedet/srecode/insert.el | 82 | ||||
| -rw-r--r-- | lisp/cedet/srecode/map.el | 18 | ||||
| -rw-r--r-- | lisp/cedet/srecode/semantic.el | 2 | ||||
| -rw-r--r-- | lisp/cedet/srecode/table.el | 7 |
9 files changed, 120 insertions, 116 deletions
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el index 782121ef5b5..c93a6f72a9a 100644 --- a/lisp/cedet/srecode/compile.el +++ b/lisp/cedet/srecode/compile.el | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | (eval-when-compile (require 'cl)) | 34 | (eval-when-compile (require 'cl)) |
| 35 | (require 'semantic) | 35 | (require 'semantic) |
| 36 | (require 'eieio) | 36 | (require 'eieio) |
| 37 | (require 'cl-generic) | ||
| 37 | (require 'eieio-base) | 38 | (require 'eieio-base) |
| 38 | (require 'srecode/table) | 39 | (require 'srecode/table) |
| 39 | (require 'srecode/dictionary) | 40 | (require 'srecode/dictionary) |
| @@ -115,7 +116,7 @@ additional static argument data.")) | |||
| 115 | Plain text strings are not handled via this baseclass." | 116 | Plain text strings are not handled via this baseclass." |
| 116 | :abstract t) | 117 | :abstract t) |
| 117 | 118 | ||
| 118 | (defmethod srecode-parse-input ((ins srecode-template-inserter) | 119 | (cl-defmethod srecode-parse-input ((ins srecode-template-inserter) |
| 119 | tag input STATE) | 120 | tag input STATE) |
| 120 | "For the template inserter INS, parse INPUT. | 121 | "For the template inserter INS, parse INPUT. |
| 121 | Shorten input only by the amount needed. | 122 | Shorten input only by the amount needed. |
| @@ -123,15 +124,15 @@ Return the remains of INPUT. | |||
| 123 | STATE is the current compilation state." | 124 | STATE is the current compilation state." |
| 124 | input) | 125 | input) |
| 125 | 126 | ||
| 126 | (defmethod srecode-match-end ((ins srecode-template-inserter) name) | 127 | (cl-defmethod srecode-match-end ((ins srecode-template-inserter) name) |
| 127 | "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?" |
| 128 | nil) | 129 | nil) |
| 129 | 130 | ||
| 130 | (defmethod srecode-inserter-apply-state ((ins srecode-template-inserter) STATE) | 131 | (cl-defmethod srecode-inserter-apply-state ((ins srecode-template-inserter) STATE) |
| 131 | "For the template inserter INS, apply information from STATE." | 132 | "For the template inserter INS, apply information from STATE." |
| 132 | nil) | 133 | nil) |
| 133 | 134 | ||
| 134 | (defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter) | 135 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter)) |
| 135 | escape-start escape-end) | 136 | escape-start escape-end) |
| 136 | "Insert an example using inserter INS. | 137 | "Insert an example using inserter INS. |
| 137 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 138 | 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." | |||
| 158 | ) | 159 | ) |
| 159 | "Current state of the compile.") | 160 | "Current state of the compile.") |
| 160 | 161 | ||
| 161 | (defmethod srecode-compile-add-prompt ((state srecode-compile-state) | 162 | (cl-defmethod srecode-compile-add-prompt ((state srecode-compile-state) |
| 162 | prompttag) | 163 | prompttag) |
| 163 | "Add PROMPTTAG to the current list of prompts." | 164 | "Add PROMPTTAG to the current list of prompts." |
| 164 | (with-slots (prompts) state | 165 | (with-slots (prompts) state |
| @@ -595,7 +596,7 @@ A list of defined variables VARS provides a variable table." | |||
| 595 | ;; Dump out information about the current srecoder compiled templates. | 596 | ;; Dump out information about the current srecoder compiled templates. |
| 596 | ;; | 597 | ;; |
| 597 | 598 | ||
| 598 | (defmethod srecode-dump ((tmp srecode-template)) | 599 | (cl-defmethod srecode-dump ((tmp srecode-template)) |
| 599 | "Dump the contents of the SRecode template tmp." | 600 | "Dump the contents of the SRecode template tmp." |
| 600 | (princ "== Template \"") | 601 | (princ "== Template \"") |
| 601 | (princ (eieio-object-name-string tmp)) | 602 | (princ (eieio-object-name-string tmp)) |
| @@ -641,7 +642,7 @@ Argument INDENT specifies the indentation level for the list." | |||
| 641 | (princ "\n")))) | 642 | (princ "\n")))) |
| 642 | ) | 643 | ) |
| 643 | 644 | ||
| 644 | (defmethod srecode-dump ((ins srecode-template-inserter) indent) | 645 | (cl-defmethod srecode-dump ((ins srecode-template-inserter) indent) |
| 645 | "Dump the state of the SRecode template inserter INS." | 646 | "Dump the state of the SRecode template inserter INS." |
| 646 | (princ "INS: \"") | 647 | (princ "INS: \"") |
| 647 | (princ (eieio-object-name-string ins)) | 648 | (princ (eieio-object-name-string ins)) |
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el index 9b471eb102d..97d3310a2ae 100644 --- a/lisp/cedet/srecode/dictionary.el +++ b/lisp/cedet/srecode/dictionary.el | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | (eval-when-compile (require 'cl)) | 31 | (eval-when-compile (require 'cl)) |
| 32 | (require 'eieio) | 32 | (require 'eieio) |
| 33 | (require 'cl-generic) | ||
| 33 | (require 'srecode) | 34 | (require 'srecode) |
| 34 | (require 'srecode/table) | 35 | (require 'srecode/table) |
| 35 | (eval-when-compile (require 'semantic)) | 36 | (eval-when-compile (require 'semantic)) |
| @@ -103,7 +104,7 @@ set NAME \"str\" macro \"OTHERNAME\" | |||
| 103 | 104 | ||
| 104 | with appending various parts together in a list.") | 105 | with appending various parts together in a list.") |
| 105 | 106 | ||
| 106 | (defmethod initialize-instance ((this srecode-dictionary-compound-variable) | 107 | (cl-defmethod initialize-instance ((this srecode-dictionary-compound-variable) |
| 107 | &optional fields) | 108 | &optional fields) |
| 108 | "Initialize the compound variable THIS. | 109 | "Initialize the compound variable THIS. |
| 109 | Makes sure that :value is compiled." | 110 | Makes sure that :value is compiled." |
| @@ -120,7 +121,7 @@ Makes sure that :value is compiled." | |||
| 120 | ;;(when (not state) | 121 | ;;(when (not state) |
| 121 | ;; (error "Cannot create compound variable outside of sectiondictionary")) | 122 | ;; (error "Cannot create compound variable outside of sectiondictionary")) |
| 122 | 123 | ||
| 123 | (call-next-method this (nreverse newfields)) | 124 | (cl-call-next-method this (nreverse newfields)) |
| 124 | (when (not (slot-boundp this 'compiled)) | 125 | (when (not (slot-boundp this 'compiled)) |
| 125 | (let ((val (oref this :value)) | 126 | (let ((val (oref this :value)) |
| 126 | (comp nil)) | 127 | (comp nil)) |
| @@ -215,7 +216,7 @@ associated with a buffer or parent." | |||
| 215 | )) | 216 | )) |
| 216 | dict)))) | 217 | dict)))) |
| 217 | 218 | ||
| 218 | (defmethod srecode-dictionary-add-template-table ((dict srecode-dictionary) | 219 | (cl-defmethod srecode-dictionary-add-template-table ((dict srecode-dictionary) |
| 219 | tpl) | 220 | tpl) |
| 220 | "Insert into DICT the variables found in table TPL. | 221 | "Insert into DICT the variables found in table TPL. |
| 221 | TPL is an object representing a compiled template file." | 222 | TPL is an object representing a compiled template file." |
| @@ -235,7 +236,7 @@ TPL is an object representing a compiled template file." | |||
| 235 | (setq tabs (cdr tabs)))))) | 236 | (setq tabs (cdr tabs)))))) |
| 236 | 237 | ||
| 237 | 238 | ||
| 238 | (defmethod srecode-dictionary-set-value ((dict srecode-dictionary) | 239 | (cl-defmethod srecode-dictionary-set-value ((dict srecode-dictionary) |
| 239 | name value) | 240 | name value) |
| 240 | "In dictionary DICT, set NAME to have VALUE." | 241 | "In dictionary DICT, set NAME to have VALUE." |
| 241 | ;; Validate inputs | 242 | ;; Validate inputs |
| @@ -247,7 +248,7 @@ TPL is an object representing a compiled template file." | |||
| 247 | (puthash name value namehash)) | 248 | (puthash name value namehash)) |
| 248 | ) | 249 | ) |
| 249 | 250 | ||
| 250 | (defmethod srecode-dictionary-add-section-dictionary ((dict srecode-dictionary) | 251 | (cl-defmethod srecode-dictionary-add-section-dictionary ((dict srecode-dictionary) |
| 251 | name &optional show-only force) | 252 | name &optional show-only force) |
| 252 | "In dictionary DICT, add a section dictionary for section macro NAME. | 253 | "In dictionary DICT, add a section dictionary for section macro NAME. |
| 253 | Return the new dictionary. | 254 | Return the new dictionary. |
| @@ -299,7 +300,7 @@ inserted dictionaries." | |||
| 299 | ;; Return the new sub-dictionary. | 300 | ;; Return the new sub-dictionary. |
| 300 | new)) | 301 | new)) |
| 301 | 302 | ||
| 302 | (defmethod srecode-dictionary-show-section ((dict srecode-dictionary) name) | 303 | (cl-defmethod srecode-dictionary-show-section ((dict srecode-dictionary) name) |
| 303 | "In dictionary DICT, indicate that the section NAME should be exposed." | 304 | "In dictionary DICT, indicate that the section NAME should be exposed." |
| 304 | ;; Validate inputs | 305 | ;; Validate inputs |
| 305 | (unless (stringp name) | 306 | (unless (stringp name) |
| @@ -310,7 +311,7 @@ inserted dictionaries." | |||
| 310 | (srecode-dictionary-add-section-dictionary dict name t) | 311 | (srecode-dictionary-add-section-dictionary dict name t) |
| 311 | nil) | 312 | nil) |
| 312 | 313 | ||
| 313 | (defmethod srecode-dictionary-hide-section ((dict srecode-dictionary) name) | 314 | (cl-defmethod srecode-dictionary-hide-section ((dict srecode-dictionary) name) |
| 314 | "In dictionary DICT, indicate that the section NAME should be hidden." | 315 | "In dictionary DICT, indicate that the section NAME should be hidden." |
| 315 | ;; We need to find the has value, and then delete it. | 316 | ;; We need to find the has value, and then delete it. |
| 316 | ;; Validate inputs | 317 | ;; Validate inputs |
| @@ -322,7 +323,7 @@ inserted dictionaries." | |||
| 322 | (remhash name namehash)) | 323 | (remhash name namehash)) |
| 323 | nil) | 324 | nil) |
| 324 | 325 | ||
| 325 | (defmethod srecode-dictionary-add-entries ((dict srecode-dictionary) | 326 | (cl-defmethod srecode-dictionary-add-entries ((dict srecode-dictionary) |
| 326 | entries &optional state) | 327 | entries &optional state) |
| 327 | "Add ENTRIES to DICT. | 328 | "Add ENTRIES to DICT. |
| 328 | 329 | ||
| @@ -373,7 +374,7 @@ values but STATE is nil." | |||
| 373 | (setq entries (nthcdr 2 entries))) | 374 | (setq entries (nthcdr 2 entries))) |
| 374 | dict) | 375 | dict) |
| 375 | 376 | ||
| 376 | (defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict | 377 | (cl-defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict |
| 377 | &optional force) | 378 | &optional force) |
| 378 | "Merge into DICT the dictionary entries from OTHERDICT. | 379 | "Merge into DICT the dictionary entries from OTHERDICT. |
| 379 | Unless the optional argument FORCE is non-nil, values in DICT are | 380 | Unless the optional argument FORCE is non-nil, values in DICT are |
| @@ -405,7 +406,7 @@ OTHERDICT." | |||
| 405 | (srecode-dictionary-set-value dict key entry))))) | 406 | (srecode-dictionary-set-value dict key entry))))) |
| 406 | (oref otherdict namehash)))) | 407 | (oref otherdict namehash)))) |
| 407 | 408 | ||
| 408 | (defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary) | 409 | (cl-defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary) |
| 409 | name &optional non-recursive) | 410 | name &optional non-recursive) |
| 410 | "Return information about DICT's value for NAME. | 411 | "Return information about DICT's value for NAME. |
| 411 | DICT is a dictionary, and NAME is a string that is treated as the | 412 | DICT is a dictionary, and NAME is a string that is treated as the |
| @@ -429,7 +430,7 @@ This function derives values for some special NAMEs, such as | |||
| 429 | (srecode-dictionary-lookup-name parent name))))) | 430 | (srecode-dictionary-lookup-name parent name))))) |
| 430 | ) | 431 | ) |
| 431 | 432 | ||
| 432 | (defmethod srecode-root-dictionary ((dict srecode-dictionary)) | 433 | (cl-defmethod srecode-root-dictionary ((dict srecode-dictionary)) |
| 433 | "For dictionary DICT, return the root dictionary. | 434 | "For dictionary DICT, return the root dictionary. |
| 434 | The root dictionary is usually for a current or active insertion." | 435 | The root dictionary is usually for a current or active insertion." |
| 435 | (let ((ans dict)) | 436 | (let ((ans dict)) |
| @@ -442,7 +443,7 @@ The root dictionary is usually for a current or active insertion." | |||
| 442 | ;; Compound values must provide at least the toString method | 443 | ;; Compound values must provide at least the toString method |
| 443 | ;; for use in converting the compound value into something insertable. | 444 | ;; for use in converting the compound value into something insertable. |
| 444 | 445 | ||
| 445 | (defmethod srecode-compound-toString ((cp srecode-dictionary-compound-value) | 446 | (cl-defmethod srecode-compound-toString ((cp srecode-dictionary-compound-value) |
| 446 | function | 447 | function |
| 447 | dictionary) | 448 | dictionary) |
| 448 | "Convert the compound dictionary value CP to a string. | 449 | "Convert the compound dictionary value CP to a string. |
| @@ -456,13 +457,13 @@ the value itself using `princ', or by detecting if the current | |||
| 456 | standard out is a buffer, and using `insert'." | 457 | standard out is a buffer, and using `insert'." |
| 457 | (eieio-object-name cp)) | 458 | (eieio-object-name cp)) |
| 458 | 459 | ||
| 459 | (defmethod srecode-dump ((cp srecode-dictionary-compound-value) | 460 | (cl-defmethod srecode-dump ((cp srecode-dictionary-compound-value) |
| 460 | &optional indent) | 461 | &optional indent) |
| 461 | "Display information about this compound value." | 462 | "Display information about this compound value." |
| 462 | (princ (eieio-object-name cp)) | 463 | (princ (eieio-object-name cp)) |
| 463 | ) | 464 | ) |
| 464 | 465 | ||
| 465 | (defmethod srecode-compound-toString ((cp srecode-dictionary-compound-variable) | 466 | (cl-defmethod srecode-compound-toString ((cp srecode-dictionary-compound-variable) |
| 466 | function | 467 | function |
| 467 | dictionary) | 468 | dictionary) |
| 468 | "Convert the compound dictionary variable value CP into a string. | 469 | "Convert the compound dictionary variable value CP into a string. |
| @@ -471,7 +472,7 @@ FUNCTION and DICTIONARY are as for the baseclass." | |||
| 471 | (srecode-insert-code-stream (oref cp compiled) dictionary)) | 472 | (srecode-insert-code-stream (oref cp compiled) dictionary)) |
| 472 | 473 | ||
| 473 | 474 | ||
| 474 | (defmethod srecode-dump ((cp srecode-dictionary-compound-variable) | 475 | (cl-defmethod srecode-dump ((cp srecode-dictionary-compound-variable) |
| 475 | &optional indent) | 476 | &optional indent) |
| 476 | "Display information about this compound value." | 477 | "Display information about this compound value." |
| 477 | (require 'srecode/compile) | 478 | (require 'srecode/compile) |
| @@ -501,7 +502,7 @@ Compound values allow a field to be stored in the dictionary for when | |||
| 501 | it is referenced a second time. This compound value can then be | 502 | it is referenced a second time. This compound value can then be |
| 502 | inserted with a new editable field.") | 503 | inserted with a new editable field.") |
| 503 | 504 | ||
| 504 | (defmethod srecode-compound-toString((cp srecode-field-value) | 505 | (cl-defmethod srecode-compound-toString((cp srecode-field-value) |
| 505 | function | 506 | function |
| 506 | dictionary) | 507 | dictionary) |
| 507 | "Convert this field into an insertable string." | 508 | "Convert this field into an insertable string." |
| @@ -639,7 +640,7 @@ STATE is the current compiler state." | |||
| 639 | (srecode-dump dict)) | 640 | (srecode-dump dict)) |
| 640 | )))) | 641 | )))) |
| 641 | 642 | ||
| 642 | (defmethod srecode-dump ((dict srecode-dictionary) &optional indent) | 643 | (cl-defmethod srecode-dump ((dict srecode-dictionary) &optional indent) |
| 643 | "Dump a dictionary." | 644 | "Dump a dictionary." |
| 644 | (if (not indent) (setq indent 0)) | 645 | (if (not indent) (setq indent 0)) |
| 645 | (maphash (lambda (key entry) | 646 | (maphash (lambda (key entry) |
diff --git a/lisp/cedet/srecode/extract.el b/lisp/cedet/srecode/extract.el index c3b1f6e6da1..027ae0c25dd 100644 --- a/lisp/cedet/srecode/extract.el +++ b/lisp/cedet/srecode/extract.el | |||
| @@ -55,16 +55,16 @@ | |||
| 55 | ) | 55 | ) |
| 56 | "The current extraction state.") | 56 | "The current extraction state.") |
| 57 | 57 | ||
| 58 | (defmethod srecode-extract-state-set ((st srecode-extract-state) ins dict) | 58 | (cl-defmethod srecode-extract-state-set ((st srecode-extract-state) ins dict) |
| 59 | "Set onto the extract state ST a new inserter INS and dictionary DICT." | 59 | "Set onto the extract state ST a new inserter INS and dictionary DICT." |
| 60 | (oset st lastinserter ins) | 60 | (oset st lastinserter ins) |
| 61 | (oset st lastdict dict)) | 61 | (oset st lastdict dict)) |
| 62 | 62 | ||
| 63 | (defmethod srecode-extract-state-set-anchor ((st srecode-extract-state)) | 63 | (cl-defmethod srecode-extract-state-set-anchor ((st srecode-extract-state)) |
| 64 | "Reset the anchor point on extract state ST." | 64 | "Reset the anchor point on extract state ST." |
| 65 | (oset st anchor (point))) | 65 | (oset st anchor (point))) |
| 66 | 66 | ||
| 67 | (defmethod srecode-extract-state-extract ((st srecode-extract-state) | 67 | (cl-defmethod srecode-extract-state-extract ((st srecode-extract-state) |
| 68 | endpoint) | 68 | endpoint) |
| 69 | "Perform an extraction on the extract state ST with ENDPOINT. | 69 | "Perform an extraction on the extract state ST with ENDPOINT. |
| 70 | If there was no waiting inserter, do nothing." | 70 | If there was no waiting inserter, do nothing." |
| @@ -94,7 +94,7 @@ the dictionary entries were for that block of text." | |||
| 94 | (srecode-extract-method template dict state) | 94 | (srecode-extract-method template dict state) |
| 95 | dict)))) | 95 | dict)))) |
| 96 | 96 | ||
| 97 | (defmethod srecode-extract-method ((st srecode-template) dictionary | 97 | (cl-defmethod srecode-extract-method ((st srecode-template) dictionary |
| 98 | state) | 98 | state) |
| 99 | "Extract template ST and store extracted text in DICTIONARY. | 99 | "Extract template ST and store extracted text in DICTIONARY. |
| 100 | Optional STARTRETURN is a symbol in which the start of the first | 100 | Optional STARTRETURN is a symbol in which the start of the first |
| @@ -139,11 +139,11 @@ Uses STATE to maintain the current extraction state." | |||
| 139 | 139 | ||
| 140 | ;;; Inserter Base Extractors | 140 | ;;; Inserter Base Extractors |
| 141 | ;; | 141 | ;; |
| 142 | (defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter)) | 142 | (cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter)) |
| 143 | "Return non-nil if this inserter can extract values." | 143 | "Return non-nil if this inserter can extract values." |
| 144 | nil) | 144 | nil) |
| 145 | 145 | ||
| 146 | (defmethod srecode-inserter-extract ((ins srecode-template-inserter) | 146 | (cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter) |
| 147 | start end dict state) | 147 | start end dict state) |
| 148 | "Extract text from START/END and store in DICT. | 148 | "Extract text from START/END and store in DICT. |
| 149 | Return nil as this inserter will extract nothing." | 149 | Return nil as this inserter will extract nothing." |
| @@ -151,11 +151,11 @@ Return nil as this inserter will extract nothing." | |||
| 151 | 151 | ||
| 152 | ;;; Variable extractor is simple and can extract later. | 152 | ;;; Variable extractor is simple and can extract later. |
| 153 | ;; | 153 | ;; |
| 154 | (defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-variable)) | 154 | (cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-variable)) |
| 155 | "Return non-nil if this inserter can extract values." | 155 | "Return non-nil if this inserter can extract values." |
| 156 | 'later) | 156 | 'later) |
| 157 | 157 | ||
| 158 | (defmethod srecode-inserter-extract ((ins srecode-template-inserter-variable) | 158 | (cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-variable) |
| 159 | start end vdict state) | 159 | start end vdict state) |
| 160 | "Extract text from START/END and store in VDICT. | 160 | "Extract text from START/END and store in VDICT. |
| 161 | Return t if something was extracted. | 161 | Return t if something was extracted. |
| @@ -169,11 +169,11 @@ Return nil if this inserter doesn't need to extract anything." | |||
| 169 | 169 | ||
| 170 | ;;; Section Inserter | 170 | ;;; Section Inserter |
| 171 | ;; | 171 | ;; |
| 172 | (defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-section-start)) | 172 | (cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-section-start)) |
| 173 | "Return non-nil if this inserter can extract values." | 173 | "Return non-nil if this inserter can extract values." |
| 174 | 'now) | 174 | 'now) |
| 175 | 175 | ||
| 176 | (defmethod srecode-inserter-extract ((ins srecode-template-inserter-section-start) | 176 | (cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-section-start) |
| 177 | start end indict state) | 177 | start end indict state) |
| 178 | "Extract text from START/END and store in INDICT. | 178 | "Extract text from START/END and store in INDICT. |
| 179 | Return the starting location of the first plain-text match. | 179 | Return the starting location of the first plain-text match. |
| @@ -203,11 +203,11 @@ Return nil if nothing was extracted." | |||
| 203 | 203 | ||
| 204 | ;;; Include Extractor must extract now. | 204 | ;;; Include Extractor must extract now. |
| 205 | ;; | 205 | ;; |
| 206 | (defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-include)) | 206 | (cl-defmethod srecode-inserter-do-extract-p ((ins srecode-template-inserter-include)) |
| 207 | "Return non-nil if this inserter can extract values." | 207 | "Return non-nil if this inserter can extract values." |
| 208 | 'now) | 208 | 'now) |
| 209 | 209 | ||
| 210 | (defmethod srecode-inserter-extract ((ins srecode-template-inserter-include) | 210 | (cl-defmethod srecode-inserter-extract ((ins srecode-template-inserter-include) |
| 211 | start end dict state) | 211 | start end dict state) |
| 212 | "Extract text from START/END and store in DICT. | 212 | "Extract text from START/END and store in DICT. |
| 213 | Return the starting location of the first plain-text match. | 213 | 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 f473a0d8261..dd38b65d7bf 100644 --- a/lisp/cedet/srecode/fields.el +++ b/lisp/cedet/srecode/fields.el | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | 39 | ||
| 40 | ;; Keep this library independent of SRecode proper. | 40 | ;; Keep this library independent of SRecode proper. |
| 41 | (require 'eieio) | 41 | (require 'eieio) |
| 42 | (require 'cl-generic) | ||
| 42 | 43 | ||
| 43 | ;;; Code: | 44 | ;;; Code: |
| 44 | (defvar srecode-field-archive nil | 45 | (defvar srecode-field-archive nil |
| @@ -74,7 +75,7 @@ The overlay will crossreference this object.") | |||
| 74 | "An object that gets automatically bound to an overlay. | 75 | "An object that gets automatically bound to an overlay. |
| 75 | Has virtual :start and :end initializers.") | 76 | Has virtual :start and :end initializers.") |
| 76 | 77 | ||
| 77 | (defmethod initialize-instance ((olaid srecode-overlaid) &optional args) | 78 | (cl-defmethod initialize-instance ((olaid srecode-overlaid) &optional args) |
| 78 | "Initialize OLAID, being sure it archived." | 79 | "Initialize OLAID, being sure it archived." |
| 79 | ;; Extract :start and :end from the olaid list. | 80 | ;; Extract :start and :end from the olaid list. |
| 80 | (let ((newargs nil) | 81 | (let ((newargs nil) |
| @@ -107,11 +108,11 @@ Has virtual :start and :end initializers.") | |||
| 107 | (overlay-put olay 'srecode-init-only t) | 108 | (overlay-put olay 'srecode-init-only t) |
| 108 | 109 | ||
| 109 | (oset olaid overlay olay) | 110 | (oset olaid overlay olay) |
| 110 | (call-next-method olaid (nreverse newargs)) | 111 | (cl-call-next-method olaid (nreverse newargs)) |
| 111 | 112 | ||
| 112 | )) | 113 | )) |
| 113 | 114 | ||
| 114 | (defmethod srecode-overlaid-activate ((olaid srecode-overlaid)) | 115 | (cl-defmethod srecode-overlaid-activate ((olaid srecode-overlaid)) |
| 115 | "Activate the overlaid area." | 116 | "Activate the overlaid area." |
| 116 | (let* ((ola (oref olaid overlay)) | 117 | (let* ((ola (oref olaid overlay)) |
| 117 | (start (overlay-start ola)) | 118 | (start (overlay-start ola)) |
| @@ -128,23 +129,23 @@ Has virtual :start and :end initializers.") | |||
| 128 | 129 | ||
| 129 | )) | 130 | )) |
| 130 | 131 | ||
| 131 | (defmethod srecode-delete ((olaid srecode-overlaid)) | 132 | (cl-defmethod srecode-delete ((olaid srecode-overlaid)) |
| 132 | "Delete the overlay from OLAID." | 133 | "Delete the overlay from OLAID." |
| 133 | (delete-overlay (oref olaid overlay)) | 134 | (delete-overlay (oref olaid overlay)) |
| 134 | (slot-makeunbound olaid 'overlay) | 135 | (slot-makeunbound olaid 'overlay) |
| 135 | ) | 136 | ) |
| 136 | 137 | ||
| 137 | (defmethod srecode-empty-region-p ((olaid srecode-overlaid)) | 138 | (cl-defmethod srecode-empty-region-p ((olaid srecode-overlaid)) |
| 138 | "Return non-nil if the region covered by OLAID is of length 0." | 139 | "Return non-nil if the region covered by OLAID is of length 0." |
| 139 | (= 0 (srecode-region-size olaid))) | 140 | (= 0 (srecode-region-size olaid))) |
| 140 | 141 | ||
| 141 | (defmethod srecode-region-size ((olaid srecode-overlaid)) | 142 | (cl-defmethod srecode-region-size ((olaid srecode-overlaid)) |
| 142 | "Return the length of region covered by OLAID." | 143 | "Return the length of region covered by OLAID." |
| 143 | (let ((start (overlay-start (oref olaid overlay))) | 144 | (let ((start (overlay-start (oref olaid overlay))) |
| 144 | (end (overlay-end (oref olaid overlay)))) | 145 | (end (overlay-end (oref olaid overlay)))) |
| 145 | (- end start))) | 146 | (- end start))) |
| 146 | 147 | ||
| 147 | (defmethod srecode-point-in-region-p ((olaid srecode-overlaid)) | 148 | (cl-defmethod srecode-point-in-region-p ((olaid srecode-overlaid)) |
| 148 | "Return non-nil if point is in the region of OLAID." | 149 | "Return non-nil if point is in the region of OLAID." |
| 149 | (let ((start (overlay-start (oref olaid overlay))) | 150 | (let ((start (overlay-start (oref olaid overlay))) |
| 150 | (end (overlay-end (oref olaid overlay)))) | 151 | (end (overlay-end (oref olaid overlay)))) |
| @@ -161,7 +162,7 @@ Has virtual :start and :end initializers.") | |||
| 161 | (setq ol (cdr ol))) | 162 | (setq ol (cdr ol))) |
| 162 | (car (nreverse ret)))) | 163 | (car (nreverse ret)))) |
| 163 | 164 | ||
| 164 | (defmethod srecode-overlaid-text ((olaid srecode-overlaid) &optional set-to) | 165 | (cl-defmethod srecode-overlaid-text ((olaid srecode-overlaid) &optional set-to) |
| 165 | "Return the text under OLAID. | 166 | "Return the text under OLAID. |
| 166 | If SET-TO is a string, then replace the text of OLAID wit SET-TO." | 167 | If SET-TO is a string, then replace the text of OLAID wit SET-TO." |
| 167 | (let* ((ol (oref olaid overlay)) | 168 | (let* ((ol (oref olaid overlay)) |
| @@ -191,7 +192,7 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO." | |||
| 191 | ) | 192 | ) |
| 192 | "Manage a buffer region in which fields exist.") | 193 | "Manage a buffer region in which fields exist.") |
| 193 | 194 | ||
| 194 | (defmethod initialize-instance ((ir srecode-template-inserted-region) | 195 | (cl-defmethod initialize-instance ((ir srecode-template-inserted-region) |
| 195 | &rest args) | 196 | &rest args) |
| 196 | "Initialize IR, capturing the active fields, and creating the overlay." | 197 | "Initialize IR, capturing the active fields, and creating the overlay." |
| 197 | ;; Fill in the fields | 198 | ;; Fill in the fields |
| @@ -199,10 +200,10 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO." | |||
| 199 | (setq srecode-field-archive nil) | 200 | (setq srecode-field-archive nil) |
| 200 | 201 | ||
| 201 | ;; Initialize myself first. | 202 | ;; Initialize myself first. |
| 202 | (call-next-method) | 203 | (cl-call-next-method) |
| 203 | ) | 204 | ) |
| 204 | 205 | ||
| 205 | (defmethod srecode-overlaid-activate ((ir srecode-template-inserted-region)) | 206 | (cl-defmethod srecode-overlaid-activate ((ir srecode-template-inserted-region)) |
| 206 | "Activate the template area for IR." | 207 | "Activate the template area for IR." |
| 207 | ;; Activate all our fields | 208 | ;; Activate all our fields |
| 208 | 209 | ||
| @@ -210,7 +211,7 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO." | |||
| 210 | (srecode-overlaid-activate F)) | 211 | (srecode-overlaid-activate F)) |
| 211 | 212 | ||
| 212 | ;; Activate our overlay. | 213 | ;; Activate our overlay. |
| 213 | (call-next-method) | 214 | (cl-call-next-method) |
| 214 | 215 | ||
| 215 | ;; Position the cursor at the first field | 216 | ;; Position the cursor at the first field |
| 216 | (let ((first (car (oref ir fields)))) | 217 | (let ((first (car (oref ir fields)))) |
| @@ -223,14 +224,14 @@ If SET-TO is a string, then replace the text of OLAID wit SET-TO." | |||
| 223 | (add-hook 'post-command-hook 'srecode-field-post-command t t) | 224 | (add-hook 'post-command-hook 'srecode-field-post-command t t) |
| 224 | ) | 225 | ) |
| 225 | 226 | ||
| 226 | (defmethod srecode-delete ((ir srecode-template-inserted-region)) | 227 | (cl-defmethod srecode-delete ((ir srecode-template-inserted-region)) |
| 227 | "Call into our base, but also clear out the fields." | 228 | "Call into our base, but also clear out the fields." |
| 228 | ;; Clear us out of the baseclass. | 229 | ;; Clear us out of the baseclass. |
| 229 | (oset ir active-region nil) | 230 | (oset ir active-region nil) |
| 230 | ;; Clear our fields. | 231 | ;; Clear our fields. |
| 231 | (mapc 'srecode-delete (oref ir fields)) | 232 | (mapc 'srecode-delete (oref ir fields)) |
| 232 | ;; Call to our base | 233 | ;; Call to our base |
| 233 | (call-next-method) | 234 | (cl-call-next-method) |
| 234 | ;; Clear our hook. | 235 | ;; Clear our hook. |
| 235 | (remove-hook 'post-command-hook 'srecode-field-post-command t) | 236 | (remove-hook 'post-command-hook 'srecode-field-post-command t) |
| 236 | ) | 237 | ) |
| @@ -285,15 +286,15 @@ Try to use this to provide useful completion when available.") | |||
| 285 | km) | 286 | km) |
| 286 | "Keymap applied to field overlays.") | 287 | "Keymap applied to field overlays.") |
| 287 | 288 | ||
| 288 | (defmethod initialize-instance ((field srecode-field) &optional args) | 289 | (cl-defmethod initialize-instance ((field srecode-field) &optional args) |
| 289 | "Initialize FIELD, being sure it archived." | 290 | "Initialize FIELD, being sure it archived." |
| 290 | (add-to-list 'srecode-field-archive field t) | 291 | (add-to-list 'srecode-field-archive field t) |
| 291 | (call-next-method) | 292 | (cl-call-next-method) |
| 292 | ) | 293 | ) |
| 293 | 294 | ||
| 294 | (defmethod srecode-overlaid-activate ((field srecode-field)) | 295 | (cl-defmethod srecode-overlaid-activate ((field srecode-field)) |
| 295 | "Activate the FIELD area." | 296 | "Activate the FIELD area." |
| 296 | (call-next-method) | 297 | (cl-call-next-method) |
| 297 | 298 | ||
| 298 | (let* ((ol (oref field overlay)) | 299 | (let* ((ol (oref field overlay)) |
| 299 | (end nil) | 300 | (end nil) |
| @@ -314,13 +315,13 @@ Try to use this to provide useful completion when available.") | |||
| 314 | ) | 315 | ) |
| 315 | ) | 316 | ) |
| 316 | 317 | ||
| 317 | (defmethod srecode-delete ((olaid srecode-field)) | 318 | (cl-defmethod srecode-delete ((olaid srecode-field)) |
| 318 | "Delete our secondary overlay." | 319 | "Delete our secondary overlay." |
| 319 | ;; Remove our spare overlay | 320 | ;; Remove our spare overlay |
| 320 | (delete-overlay (oref olaid tail)) | 321 | (delete-overlay (oref olaid tail)) |
| 321 | (slot-makeunbound olaid 'tail) | 322 | (slot-makeunbound olaid 'tail) |
| 322 | ;; Do our baseclass work. | 323 | ;; Do our baseclass work. |
| 323 | (call-next-method) | 324 | (cl-call-next-method) |
| 324 | ) | 325 | ) |
| 325 | 326 | ||
| 326 | (defvar srecode-field-replication-max-size 100 | 327 | (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." | |||
| 379 | (srecode-field-mod-hook ol after start end pre-len)) | 380 | (srecode-field-mod-hook ol after start end pre-len)) |
| 380 | )) | 381 | )) |
| 381 | 382 | ||
| 382 | (defmethod srecode-field-goto ((field srecode-field)) | 383 | (cl-defmethod srecode-field-goto ((field srecode-field)) |
| 383 | "Goto the FIELD." | 384 | "Goto the FIELD." |
| 384 | (goto-char (overlay-start (oref field overlay)))) | 385 | (goto-char (overlay-start (oref field overlay)))) |
| 385 | 386 | ||
diff --git a/lisp/cedet/srecode/find.el b/lisp/cedet/srecode/find.el index fc1b79dfd52..092f739df7d 100644 --- a/lisp/cedet/srecode/find.el +++ b/lisp/cedet/srecode/find.el | |||
| @@ -96,7 +96,7 @@ all template files for that application will be loaded." | |||
| 96 | ;; | 96 | ;; |
| 97 | ;; Find if a template table has a project set, and if so, is the | 97 | ;; Find if a template table has a project set, and if so, is the |
| 98 | ;; current buffer in that project. | 98 | ;; current buffer in that project. |
| 99 | (defmethod srecode-template-table-in-project-p ((tab srecode-template-table)) | 99 | (cl-defmethod srecode-template-table-in-project-p ((tab srecode-template-table)) |
| 100 | "Return non-nil if the table TAB can be used in the current project. | 100 | "Return non-nil if the table TAB can be used in the current project. |
| 101 | If TAB has a :project set, check that the directories match. | 101 | If TAB has a :project set, check that the directories match. |
| 102 | If TAB is nil, then always return t." | 102 | If TAB is nil, then always return t." |
| @@ -113,7 +113,7 @@ If TAB is nil, then always return t." | |||
| 113 | ;; | 113 | ;; |
| 114 | ;; Find a given template based on name, and features of the current | 114 | ;; Find a given template based on name, and features of the current |
| 115 | ;; buffer. | 115 | ;; buffer. |
| 116 | (defmethod srecode-template-get-table ((tab srecode-template-table) | 116 | (cl-defmethod srecode-template-get-table ((tab srecode-template-table) |
| 117 | template-name &optional | 117 | template-name &optional |
| 118 | context application) | 118 | context application) |
| 119 | "Find in the template in table TAB, the template with TEMPLATE-NAME. | 119 | "Find in the template in table TAB, the template with TEMPLATE-NAME. |
| @@ -129,7 +129,7 @@ The APPLICATION argument is unused." | |||
| 129 | ;; No context, perhaps a merged name? | 129 | ;; No context, perhaps a merged name? |
| 130 | (gethash template-name (oref tab namehash))))) | 130 | (gethash template-name (oref tab namehash))))) |
| 131 | 131 | ||
| 132 | (defmethod srecode-template-get-table ((tab srecode-mode-table) | 132 | (cl-defmethod srecode-template-get-table ((tab srecode-mode-table) |
| 133 | template-name &optional | 133 | template-name &optional |
| 134 | context application) | 134 | context application) |
| 135 | "Find in the template in mode table TAB, the template with TEMPLATE-NAME. | 135 | "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." | |||
| 157 | ;; | 157 | ;; |
| 158 | ;; Find a given template based on a key binding. | 158 | ;; Find a given template based on a key binding. |
| 159 | ;; | 159 | ;; |
| 160 | (defmethod srecode-template-get-table-for-binding | 160 | (cl-defmethod srecode-template-get-table-for-binding |
| 161 | ((tab srecode-template-table) binding &optional context) | 161 | ((tab srecode-template-table) binding &optional context) |
| 162 | "Find in the template name in table TAB, the template with BINDING. | 162 | "Find in the template name in table TAB, the template with BINDING. |
| 163 | Optional argument CONTEXT specifies that the template should part | 163 | Optional argument CONTEXT specifies that the template should part |
| @@ -190,7 +190,7 @@ of a particular context." | |||
| 190 | (maphash hashfcn (oref tab namehash))) | 190 | (maphash hashfcn (oref tab namehash))) |
| 191 | keyout))) | 191 | keyout))) |
| 192 | 192 | ||
| 193 | (defmethod srecode-template-get-table-for-binding | 193 | (cl-defmethod srecode-template-get-table-for-binding |
| 194 | ((tab srecode-mode-table) binding &optional context application) | 194 | ((tab srecode-mode-table) binding &optional context application) |
| 195 | "Find in the template name in mode table TAB, the template with BINDING. | 195 | "Find in the template name in mode table TAB, the template with BINDING. |
| 196 | Optional argument CONTEXT specifies a context a particular template | 196 | Optional argument CONTEXT specifies a context a particular template |
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el index 78ec1658859..0c13ee51e34 100644 --- a/lisp/cedet/srecode/insert.el +++ b/lisp/cedet/srecode/insert.el | |||
| @@ -260,20 +260,20 @@ Optional argument TEMP is the template that is getting its arguments resolved." | |||
| 260 | ;; Code managing the top-level insert method and the current | 260 | ;; Code managing the top-level insert method and the current |
| 261 | ;; insertion stack. | 261 | ;; insertion stack. |
| 262 | ;; | 262 | ;; |
| 263 | (defmethod srecode-push ((st srecode-template)) | 263 | (cl-defmethod srecode-push ((st srecode-template)) |
| 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 | (defmethod srecode-pop :STATIC ((st srecode-template)) | 267 | (cl-defmethod srecode-pop ((st (subclass 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." | 269 | ST can be a class, or an object." |
| 270 | (oset st active (cdr (oref st active)))) | 270 | (oset st active (cdr (oref st active)))) |
| 271 | 271 | ||
| 272 | (defmethod srecode-peek :STATIC ((st srecode-template)) | 272 | (cl-defmethod srecode-peek ((st (subclass srecode-template))) |
| 273 | "Fetch the topmost active template record. ST can be a class." | 273 | "Fetch the topmost active template record. ST can be a class." |
| 274 | (car (oref st active))) | 274 | (car (oref st active))) |
| 275 | 275 | ||
| 276 | (defmethod srecode-insert-method ((st srecode-template) dictionary) | 276 | (cl-defmethod srecode-insert-method ((st srecode-template) dictionary) |
| 277 | "Insert the srecoder template ST." | 277 | "Insert the srecoder template ST." |
| 278 | ;; Merge any template entries into the input dictionary. | 278 | ;; Merge any template entries into the input dictionary. |
| 279 | ;; This may happen twice since some templates arguments need | 279 | ;; This may happen twice since some templates arguments need |
| @@ -324,7 +324,7 @@ by themselves.") | |||
| 324 | Specify the :indent argument to enable automatic indentation when newlines | 324 | Specify the :indent argument to enable automatic indentation when newlines |
| 325 | occur in your template.") | 325 | occur in your template.") |
| 326 | 326 | ||
| 327 | (defmethod srecode-insert-method ((sti srecode-template-inserter-newline) | 327 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-newline) |
| 328 | dictionary) | 328 | dictionary) |
| 329 | "Insert the STI inserter." | 329 | "Insert the STI inserter." |
| 330 | ;; To be safe, indent the previous line since the template will | 330 | ;; To be safe, indent the previous line since the template will |
| @@ -363,9 +363,9 @@ occur in your template.") | |||
| 363 | ((stringp i) | 363 | ((stringp i) |
| 364 | (princ i)))))) | 364 | (princ i)))))) |
| 365 | 365 | ||
| 366 | (defmethod srecode-dump ((ins srecode-template-inserter-newline) indent) | 366 | (cl-defmethod srecode-dump ((ins srecode-template-inserter-newline) indent) |
| 367 | "Dump the state of the SRecode template inserter INS." | 367 | "Dump the state of the SRecode template inserter INS." |
| 368 | (call-next-method) | 368 | (cl-call-next-method) |
| 369 | (when (oref ins hard) | 369 | (when (oref ins hard) |
| 370 | (princ " : hard") | 370 | (princ " : hard") |
| 371 | )) | 371 | )) |
| @@ -388,7 +388,7 @@ When set to 'end it will insert a CR if we are not at 'eol'.") | |||
| 388 | "Insert a newline before and after a template, and possibly do indenting. | 388 | "Insert a newline before and after a template, and possibly do indenting. |
| 389 | Specify the :blank argument to enable this inserter.") | 389 | Specify the :blank argument to enable this inserter.") |
| 390 | 390 | ||
| 391 | (defmethod srecode-insert-method ((sti srecode-template-inserter-blank) | 391 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-blank) |
| 392 | dictionary) | 392 | dictionary) |
| 393 | "Make sure there is no text before or after point." | 393 | "Make sure there is no text before or after point." |
| 394 | (let ((i (srecode-dictionary-lookup-name dictionary "INDENT")) | 394 | (let ((i (srecode-dictionary-lookup-name dictionary "INDENT")) |
| @@ -425,7 +425,7 @@ Specify the :blank argument to enable this inserter.") | |||
| 425 | ) | 425 | ) |
| 426 | "Allow comments within template coding. This inserts nothing.") | 426 | "Allow comments within template coding. This inserts nothing.") |
| 427 | 427 | ||
| 428 | (defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-comment) | 428 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-comment)) |
| 429 | escape-start escape-end) | 429 | escape-start escape-end) |
| 430 | "Insert an example using inserter INS. | 430 | "Insert an example using inserter INS. |
| 431 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 431 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| @@ -436,7 +436,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 436 | (terpri) | 436 | (terpri) |
| 437 | ) | 437 | ) |
| 438 | 438 | ||
| 439 | (defmethod srecode-insert-method ((sti srecode-template-inserter-comment) | 439 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-comment) |
| 440 | dictionary) | 440 | dictionary) |
| 441 | "Don't insert anything for comment macros in STI." | 441 | "Don't insert anything for comment macros in STI." |
| 442 | nil) | 442 | nil) |
| @@ -453,7 +453,7 @@ If there is no entry, insert nothing.") | |||
| 453 | (defvar srecode-inserter-variable-current-dictionary nil | 453 | (defvar srecode-inserter-variable-current-dictionary nil |
| 454 | "The active dictionary when calling a variable filter.") | 454 | "The active dictionary when calling a variable filter.") |
| 455 | 455 | ||
| 456 | (defmethod srecode-insert-variable-secondname-handler | 456 | (cl-defmethod srecode-insert-variable-secondname-handler |
| 457 | ((sti srecode-template-inserter-variable) dictionary value secondname) | 457 | ((sti srecode-template-inserter-variable) dictionary value secondname) |
| 458 | "For VALUE handle SECONDNAME behaviors for this variable inserter. | 458 | "For VALUE handle SECONDNAME behaviors for this variable inserter. |
| 459 | Return the result as a string. | 459 | Return the result as a string. |
| @@ -471,7 +471,7 @@ If SECONDNAME is nil, return VALUE." | |||
| 471 | (object-print sti) secondname))) | 471 | (object-print sti) secondname))) |
| 472 | value)) | 472 | value)) |
| 473 | 473 | ||
| 474 | (defmethod srecode-insert-method ((sti srecode-template-inserter-variable) | 474 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-variable) |
| 475 | dictionary) | 475 | dictionary) |
| 476 | "Insert the STI inserter." | 476 | "Insert the STI inserter." |
| 477 | ;; Convert the name into a name/fcn pair | 477 | ;; Convert the name into a name/fcn pair |
| @@ -541,7 +541,7 @@ If there is no entry, prompt the user for the value to use. | |||
| 541 | The prompt text used is derived from the previous PROMPT command in the | 541 | The prompt text used is derived from the previous PROMPT command in the |
| 542 | template file.") | 542 | template file.") |
| 543 | 543 | ||
| 544 | (defmethod srecode-inserter-apply-state | 544 | (cl-defmethod srecode-inserter-apply-state |
| 545 | ((ins srecode-template-inserter-ask) STATE) | 545 | ((ins srecode-template-inserter-ask) STATE) |
| 546 | "For the template inserter INS, apply information from STATE. | 546 | "For the template inserter INS, apply information from STATE. |
| 547 | Loop over the prompts to see if we have a match." | 547 | Loop over the prompts to see if we have a match." |
| @@ -561,14 +561,14 @@ Loop over the prompts to see if we have a match." | |||
| 561 | (setq prompts (cdr prompts))) | 561 | (setq prompts (cdr prompts))) |
| 562 | )) | 562 | )) |
| 563 | 563 | ||
| 564 | (defmethod srecode-insert-method ((sti srecode-template-inserter-ask) | 564 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-ask) |
| 565 | dictionary) | 565 | dictionary) |
| 566 | "Insert the STI inserter." | 566 | "Insert the STI inserter." |
| 567 | (let ((val (srecode-dictionary-lookup-name | 567 | (let ((val (srecode-dictionary-lookup-name |
| 568 | dictionary (oref sti :object-name)))) | 568 | dictionary (oref sti :object-name)))) |
| 569 | (if val | 569 | (if val |
| 570 | ;; Does some extra work. Oh well. | 570 | ;; Does some extra work. Oh well. |
| 571 | (call-next-method) | 571 | (cl-call-next-method) |
| 572 | 572 | ||
| 573 | ;; How is our -ask value determined? | 573 | ;; How is our -ask value determined? |
| 574 | (if srecode-insert-with-fields-in-progress | 574 | (if srecode-insert-with-fields-in-progress |
| @@ -585,9 +585,9 @@ Loop over the prompts to see if we have a match." | |||
| 585 | 585 | ||
| 586 | ;; Now that this value is safely stowed in the dictionary, | 586 | ;; Now that this value is safely stowed in the dictionary, |
| 587 | ;; we can do what regular inserters do. | 587 | ;; we can do what regular inserters do. |
| 588 | (call-next-method)))) | 588 | (cl-call-next-method)))) |
| 589 | 589 | ||
| 590 | (defmethod srecode-insert-ask-default ((sti srecode-template-inserter-ask) | 590 | (cl-defmethod srecode-insert-ask-default ((sti srecode-template-inserter-ask) |
| 591 | dictionary) | 591 | dictionary) |
| 592 | "Derive the default value for an askable inserter STI. | 592 | "Derive the default value for an askable inserter STI. |
| 593 | DICTIONARY is used to derive some values." | 593 | DICTIONARY is used to derive some values." |
| @@ -612,7 +612,7 @@ DICTIONARY is used to derive some values." | |||
| 612 | dictionary | 612 | dictionary |
| 613 | "Unknown default for prompt: %S" defaultfcn))))) | 613 | "Unknown default for prompt: %S" defaultfcn))))) |
| 614 | 614 | ||
| 615 | (defmethod srecode-insert-method-ask ((sti srecode-template-inserter-ask) | 615 | (cl-defmethod srecode-insert-method-ask ((sti srecode-template-inserter-ask) |
| 616 | dictionary) | 616 | dictionary) |
| 617 | "Do the \"asking\" for the template inserter STI. | 617 | "Do the \"asking\" for the template inserter STI. |
| 618 | Use DICTIONARY to resolve values." | 618 | Use DICTIONARY to resolve values." |
| @@ -646,7 +646,7 @@ Use DICTIONARY to resolve values." | |||
| 646 | val) | 646 | val) |
| 647 | ) | 647 | ) |
| 648 | 648 | ||
| 649 | (defmethod srecode-insert-method-field ((sti srecode-template-inserter-ask) | 649 | (cl-defmethod srecode-insert-method-field ((sti srecode-template-inserter-ask) |
| 650 | dictionary) | 650 | dictionary) |
| 651 | "Create an editable field for the template inserter STI. | 651 | "Create an editable field for the template inserter STI. |
| 652 | Use DICTIONARY to resolve values." | 652 | Use DICTIONARY to resolve values." |
| @@ -661,9 +661,9 @@ Use DICTIONARY to resolve values." | |||
| 661 | ;; across multiple locations. | 661 | ;; across multiple locations. |
| 662 | compound-value)) | 662 | compound-value)) |
| 663 | 663 | ||
| 664 | (defmethod srecode-dump ((ins srecode-template-inserter-ask) indent) | 664 | (cl-defmethod srecode-dump ((ins srecode-template-inserter-ask) indent) |
| 665 | "Dump the state of the SRecode template inserter INS." | 665 | "Dump the state of the SRecode template inserter INS." |
| 666 | (call-next-method) | 666 | (cl-call-next-method) |
| 667 | (princ " : \"") | 667 | (princ " : \"") |
| 668 | (princ (oref ins prompt)) | 668 | (princ (oref ins prompt)) |
| 669 | (princ "\"") | 669 | (princ "\"") |
| @@ -681,7 +681,7 @@ Thus a specification of `10:left' will insert the value of A | |||
| 681 | to 10 characters, with spaces added to the left. Use `right' for adding | 681 | to 10 characters, with spaces added to the left. Use `right' for adding |
| 682 | spaces to the right.") | 682 | spaces to the right.") |
| 683 | 683 | ||
| 684 | (defmethod srecode-insert-variable-secondname-handler | 684 | (cl-defmethod srecode-insert-variable-secondname-handler |
| 685 | ((sti srecode-template-inserter-width) dictionary value width) | 685 | ((sti srecode-template-inserter-width) dictionary value width) |
| 686 | "For VALUE handle WIDTH behaviors for this variable inserter. | 686 | "For VALUE handle WIDTH behaviors for this variable inserter. |
| 687 | Return the result as a string. | 687 | Return the result as a string. |
| @@ -714,7 +714,7 @@ By default, treat as a function name." | |||
| 714 | (concat padchars value) | 714 | (concat padchars value) |
| 715 | (concat value padchars)))))) | 715 | (concat value padchars)))))) |
| 716 | 716 | ||
| 717 | (defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-width) | 717 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-width)) |
| 718 | escape-start escape-end) | 718 | escape-start escape-end) |
| 719 | "Insert an example using inserter INS. | 719 | "Insert an example using inserter INS. |
| 720 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 720 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| @@ -750,7 +750,7 @@ The cursor is placed at the ^ macro after insertion. | |||
| 750 | Some inserter macros, such as `srecode-template-inserter-include-wrap' | 750 | Some inserter macros, such as `srecode-template-inserter-include-wrap' |
| 751 | will place text at the ^ macro from the included macro.") | 751 | will place text at the ^ macro from the included macro.") |
| 752 | 752 | ||
| 753 | (defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-point) | 753 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-point)) |
| 754 | escape-start escape-end) | 754 | escape-start escape-end) |
| 755 | "Insert an example using inserter INS. | 755 | "Insert an example using inserter INS. |
| 756 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 756 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| @@ -761,7 +761,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 761 | (terpri) | 761 | (terpri) |
| 762 | ) | 762 | ) |
| 763 | 763 | ||
| 764 | (defmethod srecode-insert-method ((sti srecode-template-inserter-point) | 764 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-point) |
| 765 | dictionary) | 765 | dictionary) |
| 766 | "Insert the STI inserter. | 766 | "Insert the STI inserter. |
| 767 | Save point in the class allocated 'point' slot. | 767 | Save point in the class allocated 'point' slot. |
| @@ -787,11 +787,11 @@ generalized marker will do something else. See | |||
| 787 | "Wrap a section of a template under the control of a macro." | 787 | "Wrap a section of a template under the control of a macro." |
| 788 | :abstract t) | 788 | :abstract t) |
| 789 | 789 | ||
| 790 | (defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-subtemplate) | 790 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-subtemplate)) |
| 791 | escape-start escape-end) | 791 | escape-start escape-end) |
| 792 | "Insert an example using inserter INS. | 792 | "Insert an example using inserter INS. |
| 793 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 793 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| 794 | (call-next-method) | 794 | (cl-call-next-method) |
| 795 | (princ " Template Text to control") | 795 | (princ " Template Text to control") |
| 796 | (terpri) | 796 | (terpri) |
| 797 | (princ " ") | 797 | (princ " ") |
| @@ -801,7 +801,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 801 | (terpri) | 801 | (terpri) |
| 802 | ) | 802 | ) |
| 803 | 803 | ||
| 804 | (defmethod srecode-insert-subtemplate ((sti srecode-template-inserter-subtemplate) | 804 | (cl-defmethod srecode-insert-subtemplate ((sti srecode-template-inserter-subtemplate) |
| 805 | dict slot) | 805 | dict slot) |
| 806 | "Insert a subtemplate for the inserter STI with dictionary DICT." | 806 | "Insert a subtemplate for the inserter STI with dictionary DICT." |
| 807 | ;; Make sure that only dictionaries are used. | 807 | ;; Make sure that only dictionaries are used. |
| @@ -814,7 +814,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 814 | ;; Output the code from the sub-template. | 814 | ;; Output the code from the sub-template. |
| 815 | (srecode-insert-method (slot-value sti slot) dict)) | 815 | (srecode-insert-method (slot-value sti slot) dict)) |
| 816 | 816 | ||
| 817 | (defmethod srecode-insert-method-helper ((sti srecode-template-inserter-subtemplate) | 817 | (cl-defmethod srecode-insert-method-helper ((sti srecode-template-inserter-subtemplate) |
| 818 | dictionary slot) | 818 | dictionary slot) |
| 819 | "Do the work for inserting the STI inserter. | 819 | "Do the work for inserting the STI inserter. |
| 820 | Loops over the embedded CODE which was saved here during compilation. | 820 | Loops over the embedded CODE which was saved here during compilation. |
| @@ -837,7 +837,7 @@ The template to insert is stored in SLOT." | |||
| 837 | (srecode-insert-subtemplate sti (car dicts) slot) | 837 | (srecode-insert-subtemplate sti (car dicts) slot) |
| 838 | (setq dicts (cdr dicts))))) | 838 | (setq dicts (cdr dicts))))) |
| 839 | 839 | ||
| 840 | (defmethod srecode-insert-method ((sti srecode-template-inserter-subtemplate) | 840 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-subtemplate) |
| 841 | dictionary) | 841 | dictionary) |
| 842 | "Insert the STI inserter. | 842 | "Insert the STI inserter. |
| 843 | Calls back to `srecode-insert-method-helper' for this class." | 843 | Calls back to `srecode-insert-method-helper' for this class." |
| @@ -858,7 +858,7 @@ The dictionary saved at the named dictionary entry will be | |||
| 858 | applied to the text between the section start and the | 858 | applied to the text between the section start and the |
| 859 | `srecode-template-inserter-section-end' macro.") | 859 | `srecode-template-inserter-section-end' macro.") |
| 860 | 860 | ||
| 861 | (defmethod srecode-parse-input ((ins srecode-template-inserter-section-start) | 861 | (cl-defmethod srecode-parse-input ((ins srecode-template-inserter-section-start) |
| 862 | tag input STATE) | 862 | tag input STATE) |
| 863 | "For the section inserter INS, parse INPUT. | 863 | "For the section inserter INS, parse INPUT. |
| 864 | Shorten input until the END token is found. | 864 | Shorten input until the END token is found. |
| @@ -872,9 +872,9 @@ Return the remains of INPUT." | |||
| 872 | :code (cdr out))) | 872 | :code (cdr out))) |
| 873 | (car out))) | 873 | (car out))) |
| 874 | 874 | ||
| 875 | (defmethod srecode-dump ((ins srecode-template-inserter-section-start) indent) | 875 | (cl-defmethod srecode-dump ((ins srecode-template-inserter-section-start) indent) |
| 876 | "Dump the state of the SRecode template inserter INS." | 876 | "Dump the state of the SRecode template inserter INS." |
| 877 | (call-next-method) | 877 | (cl-call-next-method) |
| 878 | (princ "\n") | 878 | (princ "\n") |
| 879 | (srecode-dump-code-list (oref (oref ins template) code) | 879 | (srecode-dump-code-list (oref (oref ins template) code) |
| 880 | (concat indent " ")) | 880 | (concat indent " ")) |
| @@ -889,12 +889,12 @@ Return the remains of INPUT." | |||
| 889 | "All template segments between the section-start and section-end | 889 | "All template segments between the section-start and section-end |
| 890 | are treated specially.") | 890 | are treated specially.") |
| 891 | 891 | ||
| 892 | (defmethod srecode-insert-method ((sti srecode-template-inserter-section-end) | 892 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-section-end) |
| 893 | dictionary) | 893 | dictionary) |
| 894 | "Insert the STI inserter." | 894 | "Insert the STI inserter." |
| 895 | ) | 895 | ) |
| 896 | 896 | ||
| 897 | (defmethod srecode-match-end ((ins srecode-template-inserter-section-end) name) | 897 | (cl-defmethod srecode-match-end ((ins srecode-template-inserter-section-end) name) |
| 898 | 898 | ||
| 899 | "For the template inserter INS, do I end a section called NAME?" | 899 | "For the template inserter INS, do I end a section called NAME?" |
| 900 | (string= name (oref ins :object-name))) | 900 | (string= name (oref ins :object-name))) |
| @@ -912,7 +912,7 @@ are treated specially.") | |||
| 912 | The included template will have additional dictionary entries from the subdictionary | 912 | The included template will have additional dictionary entries from the subdictionary |
| 913 | stored specified by this macro.") | 913 | stored specified by this macro.") |
| 914 | 914 | ||
| 915 | (defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-include) | 915 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-include)) |
| 916 | escape-start escape-end) | 916 | escape-start escape-end) |
| 917 | "Insert an example using inserter INS. | 917 | "Insert an example using inserter INS. |
| 918 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 918 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| @@ -923,7 +923,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 923 | (terpri) | 923 | (terpri) |
| 924 | ) | 924 | ) |
| 925 | 925 | ||
| 926 | (defmethod srecode-insert-include-lookup ((sti srecode-template-inserter-include) | 926 | (cl-defmethod srecode-insert-include-lookup ((sti srecode-template-inserter-include) |
| 927 | dictionary) | 927 | dictionary) |
| 928 | "For the template inserter STI, lookup the template to include. | 928 | "For the template inserter STI, lookup the template to include. |
| 929 | Finds the template with this macro function part and stores it in | 929 | Finds the template with this macro function part and stores it in |
| @@ -981,7 +981,7 @@ this template instance." | |||
| 981 | "No template \"%s\" found for include macro `%s'" | 981 | "No template \"%s\" found for include macro `%s'" |
| 982 | templatenamepart (oref sti :object-name))))) | 982 | templatenamepart (oref sti :object-name))))) |
| 983 | 983 | ||
| 984 | (defmethod srecode-insert-method ((sti srecode-template-inserter-include) | 984 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-include) |
| 985 | dictionary) | 985 | dictionary) |
| 986 | "Insert the STI inserter. | 986 | "Insert the STI inserter. |
| 987 | Finds the template with this macro function part, and inserts it | 987 | Finds the template with this macro function part, and inserts it |
| @@ -1017,7 +1017,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 | 1017 | then the text between this macro and the end macro will be inserted at |
| 1018 | the ^ macro.") | 1018 | the ^ macro.") |
| 1019 | 1019 | ||
| 1020 | (defmethod srecode-inserter-prin-example :STATIC ((ins srecode-template-inserter-include-wrap) | 1020 | (cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter-include-wrap)) |
| 1021 | escape-start escape-end) | 1021 | escape-start escape-end) |
| 1022 | "Insert an example using inserter INS. | 1022 | "Insert an example using inserter INS. |
| 1023 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | 1023 | Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." |
| @@ -1035,7 +1035,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 1035 | (terpri) | 1035 | (terpri) |
| 1036 | ) | 1036 | ) |
| 1037 | 1037 | ||
| 1038 | (defmethod srecode-insert-method ((sti srecode-template-inserter-include-wrap) | 1038 | (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-include-wrap) |
| 1039 | dictionary) | 1039 | dictionary) |
| 1040 | "Insert the template STI. | 1040 | "Insert the template STI. |
| 1041 | This will first insert the include part via inheritance, then | 1041 | This will first insert the include part via inheritance, then |
| @@ -1067,7 +1067,7 @@ template where a ^ inserter occurs." | |||
| 1067 | inserter1 dict 'template)))))))) | 1067 | inserter1 dict 'template)))))))) |
| 1068 | ;; Do a regular insertion for an include, but with our override in | 1068 | ;; Do a regular insertion for an include, but with our override in |
| 1069 | ;; place. | 1069 | ;; place. |
| 1070 | (call-next-method))) | 1070 | (cl-call-next-method))) |
| 1071 | 1071 | ||
| 1072 | (provide 'srecode/insert) | 1072 | (provide 'srecode/insert) |
| 1073 | 1073 | ||
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el index cc0c4ae4427..71ed835e4ff 100644 --- a/lisp/cedet/srecode/map.el +++ b/lisp/cedet/srecode/map.el | |||
| @@ -67,11 +67,11 @@ Each app keys to an alist of files and modes (as above.)") | |||
| 67 | ) | 67 | ) |
| 68 | "A map of srecode templates.") | 68 | "A map of srecode templates.") |
| 69 | 69 | ||
| 70 | (defmethod srecode-map-entry-for-file ((map srecode-map) file) | 70 | (cl-defmethod srecode-map-entry-for-file ((map srecode-map) file) |
| 71 | "Return the entry in MAP for FILE." | 71 | "Return the entry in MAP for FILE." |
| 72 | (assoc file (oref map files))) | 72 | (assoc file (oref map files))) |
| 73 | 73 | ||
| 74 | (defmethod srecode-map-entries-for-mode ((map srecode-map) mode) | 74 | (cl-defmethod srecode-map-entries-for-mode ((map srecode-map) mode) |
| 75 | "Return the entries in MAP for major MODE." | 75 | "Return the entries in MAP for major MODE." |
| 76 | (let ((ans nil)) | 76 | (let ((ans nil)) |
| 77 | (dolist (f (oref map files)) | 77 | (dolist (f (oref map files)) |
| @@ -79,12 +79,12 @@ Each app keys to an alist of files and modes (as above.)") | |||
| 79 | (setq ans (cons f ans)))) | 79 | (setq ans (cons f ans)))) |
| 80 | ans)) | 80 | ans)) |
| 81 | 81 | ||
| 82 | (defmethod srecode-map-entry-for-app ((map srecode-map) app) | 82 | (cl-defmethod srecode-map-entry-for-app ((map srecode-map) app) |
| 83 | "Return the entry in MAP for APP." | 83 | "Return the entry in MAP for APP." |
| 84 | (assoc app (oref map apps)) | 84 | (assoc app (oref map apps)) |
| 85 | ) | 85 | ) |
| 86 | 86 | ||
| 87 | (defmethod srecode-map-entries-for-app-and-mode ((map srecode-map) app mode) | 87 | (cl-defmethod srecode-map-entries-for-app-and-mode ((map srecode-map) app mode) |
| 88 | "Return the entries in MAP for major MODE." | 88 | "Return the entries in MAP for major MODE." |
| 89 | (let ((ans nil) | 89 | (let ((ans nil) |
| 90 | (appentry (srecode-map-entry-for-app map app))) | 90 | (appentry (srecode-map-entry-for-app map app))) |
| @@ -93,7 +93,7 @@ Each app keys to an alist of files and modes (as above.)") | |||
| 93 | (setq ans (cons f ans)))) | 93 | (setq ans (cons f ans)))) |
| 94 | ans)) | 94 | ans)) |
| 95 | 95 | ||
| 96 | (defmethod srecode-map-entry-for-file-anywhere ((map srecode-map) file) | 96 | (cl-defmethod srecode-map-entry-for-file-anywhere ((map srecode-map) file) |
| 97 | "Search in all entry points in MAP for FILE. | 97 | "Search in all entry points in MAP for FILE. |
| 98 | Return a list ( APP . FILE-ASSOC ) where APP is nil | 98 | Return a list ( APP . FILE-ASSOC ) where APP is nil |
| 99 | in the global map." | 99 | in the global map." |
| @@ -112,13 +112,13 @@ in the global map." | |||
| 112 | ;; Other? | 112 | ;; Other? |
| 113 | )) | 113 | )) |
| 114 | 114 | ||
| 115 | (defmethod srecode-map-delete-file-entry ((map srecode-map) file) | 115 | (cl-defmethod srecode-map-delete-file-entry ((map srecode-map) file) |
| 116 | "Update MAP to exclude FILE from the file list." | 116 | "Update MAP to exclude FILE from the file list." |
| 117 | (let ((entry (srecode-map-entry-for-file map file))) | 117 | (let ((entry (srecode-map-entry-for-file map file))) |
| 118 | (when entry | 118 | (when entry |
| 119 | (object-remove-from-list map 'files entry)))) | 119 | (object-remove-from-list map 'files entry)))) |
| 120 | 120 | ||
| 121 | (defmethod srecode-map-update-file-entry ((map srecode-map) file mode) | 121 | (cl-defmethod srecode-map-update-file-entry ((map srecode-map) file mode) |
| 122 | "Update a MAP entry for FILE to be used with MODE. | 122 | "Update a MAP entry for FILE to be used with MODE. |
| 123 | Return non-nil if the MAP was changed." | 123 | Return non-nil if the MAP was changed." |
| 124 | (let ((entry (srecode-map-entry-for-file map file)) | 124 | (let ((entry (srecode-map-entry-for-file map file)) |
| @@ -136,14 +136,14 @@ Return non-nil if the MAP was changed." | |||
| 136 | )) | 136 | )) |
| 137 | dirty)) | 137 | dirty)) |
| 138 | 138 | ||
| 139 | (defmethod srecode-map-delete-file-entry-from-app ((map srecode-map) file app) | 139 | (cl-defmethod srecode-map-delete-file-entry-from-app ((map srecode-map) file app) |
| 140 | "Delete from MAP the FILE entry within the APP." | 140 | "Delete from MAP the FILE entry within the APP." |
| 141 | (let* ((appe (srecode-map-entry-for-app map app)) | 141 | (let* ((appe (srecode-map-entry-for-app map app)) |
| 142 | (fentry (assoc file (cdr appe)))) | 142 | (fentry (assoc file (cdr appe)))) |
| 143 | (setcdr appe (delete fentry (cdr appe)))) | 143 | (setcdr appe (delete fentry (cdr appe)))) |
| 144 | ) | 144 | ) |
| 145 | 145 | ||
| 146 | (defmethod srecode-map-update-app-file-entry ((map srecode-map) file mode app) | 146 | (cl-defmethod srecode-map-update-app-file-entry ((map srecode-map) file mode app) |
| 147 | "Update the MAP entry for FILE to be used with MODE within APP. | 147 | "Update the MAP entry for FILE to be used with MODE within APP. |
| 148 | Return non-nil if the map was changed." | 148 | Return non-nil if the map was changed." |
| 149 | (let* ((appentry (srecode-map-entry-for-app map app)) | 149 | (let* ((appentry (srecode-map-entry-for-app map app)) |
diff --git a/lisp/cedet/srecode/semantic.el b/lisp/cedet/srecode/semantic.el index 2313fa73b73..0ea2ab4a5ff 100644 --- a/lisp/cedet/srecode/semantic.el +++ b/lisp/cedet/srecode/semantic.el | |||
| @@ -55,7 +55,7 @@ | |||
| 55 | "Wrap up a collection of semantic tag information. | 55 | "Wrap up a collection of semantic tag information. |
| 56 | This class will be used to derive dictionary values.") | 56 | This class will be used to derive dictionary values.") |
| 57 | 57 | ||
| 58 | (defmethod srecode-compound-toString((cp srecode-semantic-tag) | 58 | (cl-defmethod srecode-compound-toString((cp srecode-semantic-tag) |
| 59 | function | 59 | function |
| 60 | dictionary) | 60 | dictionary) |
| 61 | "Convert the compound dictionary value CP to a string. | 61 | "Convert the compound dictionary value CP to a string. |
diff --git a/lisp/cedet/srecode/table.el b/lisp/cedet/srecode/table.el index b4f20a9f35f..a2baa7b231f 100644 --- a/lisp/cedet/srecode/table.el +++ b/lisp/cedet/srecode/table.el | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | ;; | 26 | ;; |
| 27 | 27 | ||
| 28 | (require 'eieio) | 28 | (require 'eieio) |
| 29 | (require 'cl-generic) | ||
| 29 | (require 'eieio-base) | 30 | (require 'eieio-base) |
| 30 | (require 'mode-local) | 31 | (require 'mode-local) |
| 31 | (require 'srecode) | 32 | (require 'srecode) |
| @@ -172,7 +173,7 @@ calculate all inherited templates from parent modes." | |||
| 172 | 173 | ||
| 173 | new)))) | 174 | new)))) |
| 174 | 175 | ||
| 175 | (defmethod srecode-mode-table-find ((mt srecode-mode-table) file) | 176 | (cl-defmethod srecode-mode-table-find ((mt srecode-mode-table) file) |
| 176 | "Look in the mode table MT for a template table from FILE. | 177 | "Look in the mode table MT for a template table from FILE. |
| 177 | Return nil if there was none." | 178 | Return nil if there was none." |
| 178 | (object-assoc file 'file (oref mt modetables))) | 179 | (object-assoc file 'file (oref mt modetables))) |
| @@ -235,7 +236,7 @@ Use PREDICATE is the same as for the `sort' function." | |||
| 235 | (srecode-dump tmp)) | 236 | (srecode-dump tmp)) |
| 236 | ))) | 237 | ))) |
| 237 | 238 | ||
| 238 | (defmethod srecode-dump ((tab srecode-mode-table)) | 239 | (cl-defmethod srecode-dump ((tab srecode-mode-table)) |
| 239 | "Dump the contents of the SRecode mode table TAB." | 240 | "Dump the contents of the SRecode mode table TAB." |
| 240 | (princ "MODE TABLE FOR ") | 241 | (princ "MODE TABLE FOR ") |
| 241 | (princ (oref tab :major-mode)) | 242 | (princ (oref tab :major-mode)) |
| @@ -248,7 +249,7 @@ Use PREDICATE is the same as for the `sort' function." | |||
| 248 | (setq subtab (cdr subtab))) | 249 | (setq subtab (cdr subtab))) |
| 249 | )) | 250 | )) |
| 250 | 251 | ||
| 251 | (defmethod srecode-dump ((tab srecode-template-table)) | 252 | (cl-defmethod srecode-dump ((tab srecode-template-table)) |
| 252 | "Dump the contents of the SRecode template table TAB." | 253 | "Dump the contents of the SRecode template table TAB." |
| 253 | (princ "Template Table for ") | 254 | (princ "Template Table for ") |
| 254 | (princ (eieio-object-name-string tab)) | 255 | (princ (eieio-object-name-string tab)) |