# HG changeset patch # User Chong Yidong # Date 1258329261 0 # Node ID 4ff5c9cf147f062c4b6492bb64149bfea2c13d4d # Parent 2bed02fa304108b09c1ec3071e412493108a4926 * register.el (jump-to-register, insert-register): Handle Semantic tags. From commented-out advice in semantic/senator.el. diff -r 2bed02fa3041 -r 4ff5c9cf147f lisp/ChangeLog --- a/lisp/ChangeLog Sun Nov 15 20:28:58 2009 +0000 +++ b/lisp/ChangeLog Sun Nov 15 23:54:21 2009 +0000 @@ -1,3 +1,8 @@ +2009-11-15 Chong Yidong + + * register.el (jump-to-register, insert-register): Handle Semantic + tags. From commented-out advice in semantic/senator.el. + 2009-11-15 Dan Nicolaescu * vc.el (vc-log-show-limit): New variable. diff -r 2bed02fa3041 -r 4ff5c9cf147f lisp/cedet/semantic/senator.el --- a/lisp/cedet/semantic/senator.el Sun Nov 15 20:28:58 2009 +0000 +++ b/lisp/cedet/semantic/senator.el Sun Nov 15 23:54:21 2009 +0000 @@ -857,26 +857,6 @@ ;; [(control ?,)] ;; 'senator-isearch-toggle-semantic-mode) -;; (defadvice insert-register (around senator activate) -;; "Insert contents of register REGISTER as a tag. -;; If senator is not active, use the original mechanism." -;; (let ((val (get-register (ad-get-arg 0)))) -;; (if (and senator-minor-mode (interactive-p) -;; (semantic-foreign-tag-p val)) -;; (semantic-insert-foreign-tag val) -;; ad-do-it))) - -;; (defadvice jump-to-register (around senator activate) -;; "Insert contents of register REGISTER as a tag. -;; If senator is not active, use the original mechanism." -;; (let ((val (get-register (ad-get-arg 0)))) -;; (if (and senator-minor-mode (interactive-p) -;; (semantic-foreign-tag-p val)) -;; (progn -;; (switch-to-buffer (semantic-tag-buffer val)) -;; (goto-char (semantic-tag-start val))) -;; ad-do-it))) - (provide 'semantic/senator) ;; Local variables: diff -r 2bed02fa3041 -r 4ff5c9cf147f lisp/register.el --- a/lisp/register.el Sun Nov 15 20:28:58 2009 +0000 +++ b/lisp/register.el Sun Nov 15 23:54:21 2009 +0000 @@ -28,6 +28,10 @@ ;; pieces of buffer state to named variables. The entry points are ;; documented in the Emacs user's manual. +(declare-function semantic-insert-foreign-tag "semantic/tag" (foreign-tag)) +(declare-function semantic-tag-buffer "semantic/tag" (tag)) +(declare-function semantic-tag-start "semantic/tag" (tag)) + ;;; Global key bindings (define-key ctl-x-r-map "\C-@" 'point-to-register) @@ -135,6 +139,11 @@ (error "Register access aborted")) (find-file (nth 1 val)) (goto-char (nth 2 val))) + ((and (fboundp 'semantic-foreign-tag-p) + semantic-mode + (semantic-foreign-tag-p val)) + (switch-to-buffer (semantic-tag-buffer val)) + (goto-char (semantic-tag-start val))) (t (error "Register doesn't contain a buffer position or configuration"))))) @@ -284,6 +293,10 @@ (princ val (current-buffer))) ((and (markerp val) (marker-position val)) (princ (marker-position val) (current-buffer))) + ((and (fboundp 'semantic-foreign-tag-p) + semantic-mode + (semantic-foreign-tag-p val)) + (semantic-insert-foreign-tag val)) (t (error "Register does not contain text")))) (if (not arg) (exchange-point-and-mark)))