Commit 4cf1d7e3 authored by Chong Yidong's avatar Chong Yidong

* register.el (jump-to-register, insert-register): Handle Semantic

tags.  From commented-out advice in semantic/senator.el.
parent 6616006b
2009-11-15 Chong Yidong <cyd@stupidchicken.com>
* register.el (jump-to-register, insert-register): Handle Semantic
tags. From commented-out advice in semantic/senator.el.
2009-11-15 Dan Nicolaescu <dann@ics.uci.edu> 2009-11-15 Dan Nicolaescu <dann@ics.uci.edu>
* vc.el (vc-log-show-limit): New variable. * vc.el (vc-log-show-limit): New variable.
......
...@@ -857,26 +857,6 @@ Use a senator search function when semantic isearch mode is enabled." ...@@ -857,26 +857,6 @@ Use a senator search function when semantic isearch mode is enabled."
;; [(control ?,)] ;; [(control ?,)]
;; 'senator-isearch-toggle-semantic-mode) ;; '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) (provide 'semantic/senator)
;; Local variables: ;; Local variables:
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
;; pieces of buffer state to named variables. The entry points are ;; pieces of buffer state to named variables. The entry points are
;; documented in the Emacs user's manual. ;; 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 ;;; Global key bindings
(define-key ctl-x-r-map "\C-@" 'point-to-register) (define-key ctl-x-r-map "\C-@" 'point-to-register)
...@@ -135,6 +139,11 @@ delete any existing frames that the frame configuration doesn't mention. ...@@ -135,6 +139,11 @@ delete any existing frames that the frame configuration doesn't mention.
(error "Register access aborted")) (error "Register access aborted"))
(find-file (nth 1 val)) (find-file (nth 1 val))
(goto-char (nth 2 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 (t
(error "Register doesn't contain a buffer position or configuration"))))) (error "Register doesn't contain a buffer position or configuration")))))
...@@ -284,6 +293,10 @@ Interactively, second arg is non-nil if prefix arg is supplied." ...@@ -284,6 +293,10 @@ Interactively, second arg is non-nil if prefix arg is supplied."
(princ val (current-buffer))) (princ val (current-buffer)))
((and (markerp val) (marker-position val)) ((and (markerp val) (marker-position val))
(princ (marker-position val) (current-buffer))) (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 (t
(error "Register does not contain text")))) (error "Register does not contain text"))))
(if (not arg) (exchange-point-and-mark))) (if (not arg) (exchange-point-and-mark)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment