aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2025-04-06 23:56:36 -0400
committerStefan Monnier2025-04-07 00:02:20 -0400
commitf75f8f3d6a09fe3dda3e747665187a0c34c19eaf (patch)
tree723a9a0c7c04d12775988bf65471b25209bd6f4d
parentba13e7de32d08028ab7bffdd73dab271a95ea453 (diff)
downloademacs-f75f8f3d6a09fe3dda3e747665187a0c34c19eaf.tar.gz
emacs-f75f8f3d6a09fe3dda3e747665187a0c34c19eaf.zip
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`.
-rw-r--r--lisp/cedet/semantic/mru-bookmark.el2
-rw-r--r--lisp/cedet/srecode/compile.el8
-rw-r--r--lisp/cedet/srecode/insert.el6
3 files changed, 9 insertions, 7 deletions
diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-bookmark.el
index edb8e091a2a..edb2fe414e6 100644
--- a/lisp/cedet/semantic/mru-bookmark.el
+++ b/lisp/cedet/semantic/mru-bookmark.el
@@ -197,7 +197,7 @@ The resulting bookmark is then sorted within the ring."
197 (ring-remove ring idx)) 197 (ring-remove ring idx))
198 (setq idx (1+ idx))) 198 (setq idx (1+ idx)))
199 ;; Create a new mark 199 ;; Create a new mark
200 (let ((sbm (semantic-bookmark (semantic-tag-name tag) 200 (let ((sbm (semantic-bookmark :object-name (semantic-tag-name tag)
201 :tag tag))) 201 :tag tag)))
202 ;; Take the mark, and update it for the current state. 202 ;; Take the mark, and update it for the current state.
203 (ring-insert ring sbm) 203 (ring-insert ring sbm)
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 08082b9ecc1..9fe499be83a 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -361,7 +361,7 @@ STATE is the current compile state as an object of class
361 :where 'end))))))) 361 :where 'end)))))))
362 362
363 ;; Construct and return the template object. 363 ;; Construct and return the template object.
364 (srecode-template (semantic-tag-name tag) 364 (srecode-template :object-name (semantic-tag-name tag)
365 :context context 365 :context context
366 :args (nreverse addargs) 366 :args (nreverse addargs)
367 :dictionary root-dict 367 :dictionary root-dict
@@ -504,7 +504,8 @@ PROPS are additional properties that might need to be passed
504to the inserter constructor." 504to the inserter constructor."
505 ;;(message "Compile: %s %S" name props) 505 ;;(message "Compile: %s %S" name props)
506 (if (not key) 506 (if (not key)
507 (apply #'make-instance 'srecode-template-inserter-variable name props) 507 (apply #'make-instance 'srecode-template-inserter-variable
508 :object-name name props)
508 (let ((classes (eieio-class-children 'srecode-template-inserter)) 509 (let ((classes (eieio-class-children 'srecode-template-inserter))
509 (new nil)) 510 (new nil))
510 ;; Loop over the various subclasses and 511 ;; Loop over the various subclasses and
@@ -515,7 +516,8 @@ to the inserter constructor."
515 (when (and (not (class-abstract-p (car classes))) 516 (when (and (not (class-abstract-p (car classes)))
516 (equal (oref-default (car classes) key) key)) 517 (equal (oref-default (car classes) key) key))
517 ;; Create the new class, and apply state. 518 ;; Create the new class, and apply state.
518 (setq new (apply #'make-instance (car classes) name props)) 519 (setq new (apply #'make-instance (car classes)
520 :object-name name props))
519 (srecode-inserter-apply-state new STATE) 521 (srecode-inserter-apply-state new STATE)
520 ) 522 )
521 (setq classes (cdr classes))) 523 (setq classes (cdr classes)))
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index 2e70469fa39..a28a4f0e63c 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -860,10 +860,10 @@ applied to the text between the section start and the
860 "For the section inserter INS, parse INPUT. 860 "For the section inserter INS, parse INPUT.
861Shorten input until the END token is found. 861Shorten input until the END token is found.
862Return the remains of INPUT." 862Return the remains of INPUT."
863 (let* ((out (srecode-compile-split-code tag input STATE 863 (let* ((name (oref ins object-name))
864 (oref ins object-name)))) 864 (out (srecode-compile-split-code tag input STATE name)))
865 (oset ins template (srecode-template 865 (oset ins template (srecode-template
866 (eieio-object-name-string ins) 866 :object-name name
867 :context nil 867 :context nil
868 :args nil 868 :args nil
869 :code (cdr out))) 869 :code (cdr out)))