unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14052: 24.3; [PATCH] Cleanup for register.el
@ 2013-03-25 15:41 Leo Liu
  2013-03-25 19:04 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Leo Liu @ 2013-03-25 15:41 UTC (permalink / raw)
  To: 14052; +Cc: David Engster

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)))





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#14052: 24.3; [PATCH] Cleanup for register.el
  2013-03-25 15:41 bug#14052: 24.3; [PATCH] Cleanup for register.el Leo Liu
@ 2013-03-25 19:04 ` Stefan Monnier
  2013-03-25 21:15   ` David Engster
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-03-25 19:04 UTC (permalink / raw)
  To: Leo Liu; +Cc: 14052, David Engster

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

Looks good to me, thank you (assuming the CEDET guys can deal with the
compatibility issues).


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14052: 24.3; [PATCH] Cleanup for register.el
  2013-03-25 19:04 ` Stefan Monnier
@ 2013-03-25 21:15   ` David Engster
  2013-03-25 21:30     ` David Engster
  2013-03-26  2:54     ` Leo Liu
  0 siblings, 2 replies; 5+ messages in thread
From: David Engster @ 2013-03-25 21:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 14052, Leo Liu

Stefan Monnier writes:
>> I would like to install the following cleanup for register.el.
>
> Looks good to me, thank you (assuming the CEDET guys can deal with the
> compatibility issues).

Since which version is registerv-make supported? I couldn't find
anything in NEWS.

Well, I guess we would have to advice jump-to-register and
insert-register on older Emacsen... But I can understand why you want to
get rid of those Semantic things in register.el, so go ahead and thanks
for the heads up.

-David





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14052: 24.3; [PATCH] Cleanup for register.el
  2013-03-25 21:15   ` David Engster
@ 2013-03-25 21:30     ` David Engster
  2013-03-26  2:54     ` Leo Liu
  1 sibling, 0 replies; 5+ messages in thread
From: David Engster @ 2013-03-25 21:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 14052, Leo Liu

David Engster writes:
> Well, I guess we would have to advice jump-to-register and
> insert-register on older Emacsen...

Sorry, I was confused. We won't have to advice anything, of course, so
please go ahead and install it.

-David





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14052: 24.3; [PATCH] Cleanup for register.el
  2013-03-25 21:15   ` David Engster
  2013-03-25 21:30     ` David Engster
@ 2013-03-26  2:54     ` Leo Liu
  1 sibling, 0 replies; 5+ messages in thread
From: Leo Liu @ 2013-03-26  2:54 UTC (permalink / raw)
  To: David Engster; +Cc: 14052-done

Fixed in trunk.

On 2013-03-26 05:15 +0800, David Engster wrote:
> Since which version is registerv-make supported? I couldn't find
> anything in NEWS.

It was added on 26 Jun 2011. I am not sure if it is in 23.4 release but
definitely in 24.x releases.

Thanks.
Leo





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-26  2:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 15:41 bug#14052: 24.3; [PATCH] Cleanup for register.el Leo Liu
2013-03-25 19:04 ` Stefan Monnier
2013-03-25 21:15   ` David Engster
2013-03-25 21:30     ` David Engster
2013-03-26  2:54     ` Leo Liu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).