cedet: Pass object name via explicit :object-name arg

* lisp/cedet/srecode/insert.el (srecode-parse-input):
* lisp/cedet/srecode/compile.el (srecode-compile-one-template-tag)
(srecode-compile-inserter): Pass object name via explicit
`:object-name` arg to `srecode-template`,
`srecode-template-inserter-variable`, and children of `srecode-template`.

* lisp/cedet/semantic/mru-bookmark.el (semantic-mrub-push):
Pass object name via explicit `:object-name` arg to `semantic-bookmark`.
This commit is contained in:
Stefan Monnier 2025-04-06 23:56:36 -04:00
parent ba13e7de32
commit f75f8f3d6a
3 changed files with 9 additions and 7 deletions

View file

@ -197,7 +197,7 @@ The resulting bookmark is then sorted within the ring."
(ring-remove ring idx))
(setq idx (1+ idx)))
;; Create a new mark
(let ((sbm (semantic-bookmark (semantic-tag-name tag)
(let ((sbm (semantic-bookmark :object-name (semantic-tag-name tag)
:tag tag)))
;; Take the mark, and update it for the current state.
(ring-insert ring sbm)

View file

@ -361,7 +361,7 @@ STATE is the current compile state as an object of class
:where 'end)))))))
;; Construct and return the template object.
(srecode-template (semantic-tag-name tag)
(srecode-template :object-name (semantic-tag-name tag)
:context context
:args (nreverse addargs)
:dictionary root-dict
@ -504,7 +504,8 @@ PROPS are additional properties that might need to be passed
to the inserter constructor."
;;(message "Compile: %s %S" name props)
(if (not key)
(apply #'make-instance 'srecode-template-inserter-variable name props)
(apply #'make-instance 'srecode-template-inserter-variable
:object-name name props)
(let ((classes (eieio-class-children 'srecode-template-inserter))
(new nil))
;; Loop over the various subclasses and
@ -515,7 +516,8 @@ to the inserter constructor."
(when (and (not (class-abstract-p (car classes)))
(equal (oref-default (car classes) key) key))
;; Create the new class, and apply state.
(setq new (apply #'make-instance (car classes) name props))
(setq new (apply #'make-instance (car classes)
:object-name name props))
(srecode-inserter-apply-state new STATE)
)
(setq classes (cdr classes)))

View file

@ -860,10 +860,10 @@ applied to the text between the section start and the
"For the section inserter INS, parse INPUT.
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))))
(let* ((name (oref ins object-name))
(out (srecode-compile-split-code tag input STATE name)))
(oset ins template (srecode-template
(eieio-object-name-string ins)
:object-name name
:context nil
:args nil
:code (cdr out)))