diff options
Diffstat (limited to 'lisp/cedet/srecode/insert.el')
-rw-r--r-- | lisp/cedet/srecode/insert.el | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el index 66bdf785c63..d23597ec479 100644 --- a/lisp/cedet/srecode/insert.el +++ b/lisp/cedet/srecode/insert.el @@ -471,12 +471,11 @@ If SECONDNAME is nil, return VALUE." dictionary) "Insert the STI inserter." ;; Convert the name into a name/fcn pair - (let* ((name (oref sti :object-name)) - (fcnpart (oref sti :secondname)) + (let* ((name (oref sti object-name)) + (fcnpart (oref sti secondname)) (val (srecode-dictionary-lookup-name dictionary name)) - (do-princ t) - ) + (do-princ t)) ;; Alert if a macro wasn't found. (when (not val) (message "Warning: macro %S was not found in the dictionary." name) @@ -545,12 +544,12 @@ Loop over the prompts to see if we have a match." ) (while prompts (when (string= (semantic-tag-name (car prompts)) - (oref ins :object-name)) - (oset ins :prompt + (oref ins object-name)) + (oset ins prompt (semantic-tag-get-attribute (car prompts) :text)) - (oset ins :defaultfcn + (oset ins defaultfcn (semantic-tag-get-attribute (car prompts) :default)) - (oset ins :read-fcn + (oset ins read-fcn (or (semantic-tag-get-attribute (car prompts) :read) 'read-string)) ) @@ -561,7 +560,7 @@ Loop over the prompts to see if we have a match." dictionary) "Insert the STI inserter." (let ((val (srecode-dictionary-lookup-name - dictionary (oref sti :object-name)))) + dictionary (oref sti object-name)))) (if val ;; Does some extra work. Oh well. (cl-call-next-method) @@ -577,7 +576,7 @@ Loop over the prompts to see if we have a match." ;; the user can use the same name again later. (srecode-dictionary-set-value (srecode-root-dictionary dictionary) - (oref sti :object-name) val) + (oref sti object-name) val) ;; Now that this value is safely stowed in the dictionary, ;; we can do what regular inserters do. @@ -587,7 +586,7 @@ Loop over the prompts to see if we have a match." dictionary) "Derive the default value for an askable inserter STI. DICTIONARY is used to derive some values." - (let ((defaultfcn (oref sti :defaultfcn))) + (let ((defaultfcn (oref sti defaultfcn))) (cond ((stringp defaultfcn) defaultfcn) @@ -614,13 +613,13 @@ DICTIONARY is used to derive some values." Use DICTIONARY to resolve values." (let* ((prompt (oref sti prompt)) (default (srecode-insert-ask-default sti dictionary)) - (reader (oref sti :read-fcn)) + (reader (oref sti read-fcn)) (val nil) ) (cond ((eq reader 'y-or-n-p) (if (y-or-n-p (or prompt (format "%s? " - (oref sti :object-name)))) + (oref sti object-name)))) (setq val default) (setq val ""))) ((eq reader 'read-char) @@ -628,14 +627,14 @@ Use DICTIONARY to resolve values." "%c" (read-char (or prompt (format "Char for %s: " - (oref sti :object-name)))))) + (oref sti object-name)))))) ) (t (save-excursion (setq val (funcall reader (or prompt (format "Specify %s: " - (oref sti :object-name))) + (oref sti object-name))) default ))))) ;; Return our derived value. @@ -648,7 +647,7 @@ Use DICTIONARY to resolve values." Use DICTIONARY to resolve values." (let* ((default (srecode-insert-ask-default sti dictionary)) (compound-value - (srecode-field-value (oref sti :object-name) + (srecode-field-value (oref sti object-name) :firstinserter sti :defaultvalue default)) ) @@ -816,12 +815,12 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." Loops over the embedded CODE which was saved here during compilation. The template to insert is stored in SLOT." (let ((dicts (srecode-dictionary-lookup-name - dictionary (oref sti :object-name)))) + dictionary (oref sti object-name)))) (when (not (listp dicts)) (srecode-insert-report-error dictionary "Cannot insert section %S from non-section variable." - (oref sti :object-name))) + (oref sti object-name))) ;; If there is no section dictionary, then don't output anything ;; from this section. (while dicts @@ -829,7 +828,7 @@ The template to insert is stored in SLOT." (srecode-insert-report-error dictionary "Cannot insert section %S from non-section variable." - (oref sti :object-name))) + (oref sti object-name))) (srecode-insert-subtemplate sti (car dicts) slot) (setq dicts (cdr dicts))))) @@ -860,7 +859,7 @@ applied to the text between the section start and the Shorten input until the END token is found. Return the remains of INPUT." (let* ((out (srecode-compile-split-code tag input STATE - (oref ins :object-name)))) + (oref ins object-name)))) (oset ins template (srecode-template (eieio-object-name-string ins) :context nil @@ -893,7 +892,7 @@ are treated specially.") (cl-defmethod srecode-match-end ((ins srecode-template-inserter-section-end) name) "For the template inserter INS, do I end a section called NAME?" - (string= name (oref ins :object-name))) + (string= name (oref ins object-name))) (defclass srecode-template-inserter-include (srecode-template-inserter-subtemplate) ((key :initform ?> @@ -924,13 +923,13 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." "For the template inserter STI, lookup the template to include. Finds the template with this macro function part and stores it in this template instance." - (let ((templatenamepart (oref sti :secondname))) + (let ((templatenamepart (oref sti secondname))) ;; If there was no template name, throw an error. (unless templatenamepart (srecode-insert-report-error dictionary "Include macro `%s' needs a template name" - (oref sti :object-name))) + (oref sti object-name))) ;; NOTE: We used to cache the template and not look it up a second time, ;; but changes in the template tables can change which template is @@ -968,14 +967,14 @@ this template instance." ) ;; Store the found template into this object for later use. - (oset sti :includedtemplate tmpl)) + (oset sti includedtemplate tmpl)) (unless (oref sti includedtemplate) ;; @todo - Call into a debugger to help find the template in question. (srecode-insert-report-error dictionary "No template \"%s\" found for include macro `%s'" - templatenamepart (oref sti :object-name))))) + templatenamepart (oref sti object-name))))) (cl-defmethod srecode-insert-method ((sti srecode-template-inserter-include) dictionary) @@ -985,7 +984,7 @@ with the dictionaries found in the dictionary." (srecode-insert-include-lookup sti dictionary) ;; Insert the template. ;; Our baseclass has a simple way to do this. - (if (srecode-dictionary-lookup-name dictionary (oref sti :object-name)) + (if (srecode-dictionary-lookup-name dictionary (oref sti object-name)) ;; If we have a value, then call the next method (srecode-insert-method-helper sti dictionary 'includedtemplate) ;; If we don't have a special dictionary, then just insert with the @@ -1053,7 +1052,7 @@ template where a ^ inserter occurs." (lambda (dict) (let ((srecode-template-inserter-point-override nil)) (if (srecode-dictionary-lookup-name - dict (oref sti :object-name)) + dict (oref sti object-name)) ;; Insert our sectional part with looping. (srecode-insert-method-helper sti dict 'template) |