GNU bug report logs - #23793
25.0.95; CEDET should use xref marker stack when jumping

Previous Next

Package: emacs;

Reported by: Bastian Beischer <bastian.beischer <at> gmail.com>

Date: Sat, 18 Jun 2016 10:56:02 UTC

Severity: minor

Tags: fixed, patch

Found in version 25.0.95

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bastian Beischer <bastian.beischer <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org,cedet-devel <at> lists.sourceforge.net
Subject: 25.0.95; CEDET should use xref marker stack when jumping
Date: Sat, 18 Jun 2016 12:55:06 +0200
[Message part 1 (text/plain, inline)]
CEDET / Semantic should use xref-push-marker-stack when jumping to a
tag, this makes it easy to pop back to the original place.

Patch for Emacs 25.0.95 is attached - but maybe there are more places
that need fixing? There's also the option to put this in
semantic-go-to-tag directly.

[xref.patch (text/x-diff, inline)]
diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el
index f876827..1087dbd 100644
--- a/lisp/cedet/semantic/analyze/refs.el
+++ b/lisp/cedet/semantic/analyze/refs.el
@@ -347,6 +347,8 @@ semantic-analyze-proto-impl-toggle
 	     (if (semantic-tag-prototype-p tag) "implementation" "prototype")))
 
     (push-mark)
+    (when (fboundp 'xref-push-marker-stack)
+      (xref-push-marker-stack))
     (semantic-go-to-tag target)
     (switch-to-buffer (current-buffer))
     (semantic-momentary-highlight-tag target))
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index de76232..825ca8d 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -2105,6 +2105,8 @@ semantic-complete-jump-local
   (let ((tag (semantic-complete-read-tag-buffer-deep "Jump to symbol: ")))
     (when (semantic-tag-p tag)
       (push-mark)
+      (when (fboundp 'xref-push-marker-stack)
+        (xref-push-marker-stack))
       (goto-char (semantic-tag-start tag))
       (semantic-momentary-highlight-tag tag)
       (message "%S: %s "
@@ -2119,6 +2121,8 @@ semantic-complete-jump
   (let* ((tag (semantic-complete-read-tag-project "Jump to symbol: ")))
     (when (semantic-tag-p tag)
       (push-mark)
+      (when (fboundp 'xref-push-marker-stack)
+        (xref-push-marker-stack))
       (semantic-go-to-tag tag)
       (switch-to-buffer (current-buffer))
       (semantic-momentary-highlight-tag tag)
@@ -2138,6 +2142,8 @@ semantic-complete-jump-local-members
 	(unless start
 	  (error "Tag %s has no location" (semantic-format-tag-prototype tag)))
 	(push-mark)
+        (when (fboundp 'xref-push-marker-stack)
+          (xref-push-marker-stack))
 	(goto-char start)
 	(semantic-momentary-highlight-tag tag)
 	(message "%S: %s "
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el
index 214fbb5..562d3cf 100644
--- a/lisp/cedet/semantic/ia.el
+++ b/lisp/cedet/semantic/ia.el
@@ -316,8 +316,8 @@ semantic-ia--fast-jump-helper
   ;; 1) Push the mark, so you can pop global mark back, or
   ;;    use semantic-mru-bookmark mode to do so.
   (push-mark)
-  (when (fboundp 'push-tag-mark)
-    (push-tag-mark))
+  (when (fboundp 'xref-push-marker-stack)
+    (xref-push-marker-stack))
   ;; 2) Visits the tag.
   (semantic-go-to-tag dest)
   ;; 3) go-to-tag doesn't switch the buffer in the current window,
@@ -385,8 +385,8 @@ semantic-ia-fast-jump
       ;; Push the mark, so you can pop global mark back, or
       ;; use semantic-mru-bookmark mode to do so.
       (push-mark)
-      (when (fboundp 'push-tag-mark)
-	(push-tag-mark))
+      (when (fboundp 'xref-push-marker-stack)
+	(xref-push-marker-stack))
 
       (semantic-decoration-include-visit)
       )
diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index 38abc9e..39ab639 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -526,6 +526,8 @@ senator-go-to-up-reference
     (if (not result)
         (error "No up reference found")
       (push-mark)
+      (when (fboundp 'xref-push-marker-stack)
+        (xref-push-marker-stack))
       (cond
        ;; A tag
        ((semantic-tag-p result)

This bug report was last modified 6 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.