(message "Use C-y to recover the yank the text of %s."
(semantic-tag-name ft))))))
+(cl-defstruct (senator-register
+ (:constructor nil)
+ (:constructor senator-make-register (foreign-tag)))
+ foreign-tag)
+
+(cl-defmethod register-val-jump-to ((data senator-register) _arg)
+ (let ((ft (senator-register-foreign-tag data)))
+ (switch-to-buffer (semantic-tag-buffer ft))
+ (goto-char (semantic-tag-start ft))))
+
+(cl-defmethod register-val-describe ((data senator-register) _verbose)
+ (cl-prin1-to-string (senator-register-foreign-tag data)))
+
+(cl-defmethod register-val-insert ((data senator-register))
+ (semantic-insert-foreign-tag (senator-register-foreign-tag data)))
+
;;;###autoload
(defun senator-copy-tag-to-register (register &optional kill-flag)
"Copy the current tag into REGISTER.
(semantic-fetch-tags)
(let ((ft (semantic-obtain-foreign-tag)))
(when ft
- (set-register
- register (registerv-make
- ft
- :insert-func #'semantic-insert-foreign-tag
- :jump-func (lambda (v)
- (switch-to-buffer (semantic-tag-buffer v))
- (goto-char (semantic-tag-start v)))))
+ (set-register register (senator-make-register ft))
(if kill-flag
(kill-region (semantic-tag-start ft)
(semantic-tag-end ft))))))