Subject: bug#14052: 24.3; [PATCH] Cleanup for register.el

From: Leo Liu <[email-masked]>
Date: Mon, 25 Mar 2013 23:41:09 +0800

I would like to install the following cleanup for register.el.

David, could you help check the change to senator.el? Thanks.

Leo

diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index a79e70a7..157223ff 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -727,7 +727,13 @@ (defun senator-copy-tag-to-register (register &optional kill-flag)
   (semantic-fetch-tags)
   (let ((ft (semantic-obtain-foreign-tag)))
     (when ft
-      (set-register register 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)))))
       (if kill-flag
           (kill-region (semantic-tag-start ft)
                        (semantic-tag-end ft))))))
diff --git a/lisp/register.el b/lisp/register.el
index ae2f7cf3..4876c614 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -31,10 +31,6 @@
 
 (eval-when-compile (require 'cl-lib))
 
-(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))
-
 ;;; Code:
 
 (cl-defstruct
@@ -174,11 +170,6 @@ (defun jump-to-register (register &optional delete)
 	  (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")))))
 
@@ -349,10 +340,6 @@ (defun insert-register (register &optional arg)
       (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)))