aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Beischer2019-06-25 15:12:04 +0200
committerLars Ingebrigtsen2019-06-25 15:12:04 +0200
commite195bbd95a35a5aeaf3689ff9e9293d350bb4056 (patch)
tree1b89d4a34df558aa58dd1b9dbb313a0e72569989
parent72963b4e82eef5767e3172f28bd9bd97f487c98a (diff)
downloademacs-e195bbd95a35a5aeaf3689ff9e9293d350bb4056.tar.gz
emacs-e195bbd95a35a5aeaf3689ff9e9293d350bb4056.zip
Use xref in cedet
* lisp/cedet/semantic/complete.el (semantic-complete-jump-local) * lisp/cedet/semantic/analyze/refs.el (semantic-analyze-proto-impl-toggle): Use xref to handle jumping (bug#23793). Copyright-paperwork-exempt: yes
-rw-r--r--lisp/cedet/semantic/analyze/refs.el2
-rw-r--r--lisp/cedet/semantic/complete.el6
-rw-r--r--lisp/cedet/semantic/ia.el8
-rw-r--r--lisp/cedet/semantic/senator.el2
4 files changed, 14 insertions, 4 deletions
diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el
index cb0f4645320..179aa5f3d62 100644
--- a/lisp/cedet/semantic/analyze/refs.el
+++ b/lisp/cedet/semantic/analyze/refs.el
@@ -346,6 +346,8 @@ Only works for tags in the global namespace."
346 (if (semantic-tag-prototype-p tag) "implementation" "prototype"))) 346 (if (semantic-tag-prototype-p tag) "implementation" "prototype")))
347 347
348 (push-mark) 348 (push-mark)
349 (when (fboundp 'xref-push-marker-stack)
350 (xref-push-marker-stack))
349 (semantic-go-to-tag target) 351 (semantic-go-to-tag target)
350 (pop-to-buffer-same-window (current-buffer)) 352 (pop-to-buffer-same-window (current-buffer))
351 (semantic-momentary-highlight-tag target)) 353 (semantic-momentary-highlight-tag target))
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index bf86c3f9a37..e95f08eb91e 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -2100,6 +2100,8 @@ completion works."
2100 (let ((tag (semantic-complete-read-tag-buffer-deep "Jump to symbol: "))) 2100 (let ((tag (semantic-complete-read-tag-buffer-deep "Jump to symbol: ")))
2101 (when (semantic-tag-p tag) 2101 (when (semantic-tag-p tag)
2102 (push-mark) 2102 (push-mark)
2103 (when (fboundp 'xref-push-marker-stack)
2104 (xref-push-marker-stack))
2103 (goto-char (semantic-tag-start tag)) 2105 (goto-char (semantic-tag-start tag))
2104 (semantic-momentary-highlight-tag tag) 2106 (semantic-momentary-highlight-tag tag)
2105 (message "%S: %s " 2107 (message "%S: %s "
@@ -2114,6 +2116,8 @@ completion works."
2114 (let* ((tag (semantic-complete-read-tag-project "Jump to symbol: "))) 2116 (let* ((tag (semantic-complete-read-tag-project "Jump to symbol: ")))
2115 (when (semantic-tag-p tag) 2117 (when (semantic-tag-p tag)
2116 (push-mark) 2118 (push-mark)
2119 (when (fboundp 'xref-push-marker-stack)
2120 (xref-push-marker-stack))
2117 (semantic-go-to-tag tag) 2121 (semantic-go-to-tag tag)
2118 (pop-to-buffer-same-window (current-buffer)) 2122 (pop-to-buffer-same-window (current-buffer))
2119 (semantic-momentary-highlight-tag tag) 2123 (semantic-momentary-highlight-tag tag)
@@ -2133,6 +2137,8 @@ completion works."
2133 (unless start 2137 (unless start
2134 (error "Tag %s has no location" (semantic-format-tag-prototype tag))) 2138 (error "Tag %s has no location" (semantic-format-tag-prototype tag)))
2135 (push-mark) 2139 (push-mark)
2140 (when (fboundp 'xref-push-marker-stack)
2141 (xref-push-marker-stack))
2136 (goto-char start) 2142 (goto-char start)
2137 (semantic-momentary-highlight-tag tag) 2143 (semantic-momentary-highlight-tag tag)
2138 (message "%S: %s " 2144 (message "%S: %s "
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el
index 1549f52925f..68c6e4279cf 100644
--- a/lisp/cedet/semantic/ia.el
+++ b/lisp/cedet/semantic/ia.el
@@ -316,8 +316,8 @@ This helper manages the mark, buffer switching, and pulsing."
316 ;; 1) Push the mark, so you can pop global mark back, or 316 ;; 1) Push the mark, so you can pop global mark back, or
317 ;; use semantic-mru-bookmark mode to do so. 317 ;; use semantic-mru-bookmark mode to do so.
318 (push-mark) 318 (push-mark)
319 (when (fboundp 'push-tag-mark) 319 (when (fboundp 'xref-push-marker-stack)
320 (push-tag-mark)) 320 (xref-push-marker-stack))
321 ;; 2) Visits the tag. 321 ;; 2) Visits the tag.
322 (semantic-go-to-tag dest) 322 (semantic-go-to-tag dest)
323 ;; 3) go-to-tag doesn't switch the buffer in the current window, 323 ;; 3) go-to-tag doesn't switch the buffer in the current window,
@@ -385,8 +385,8 @@ origin of the code at point."
385 ;; Push the mark, so you can pop global mark back, or 385 ;; Push the mark, so you can pop global mark back, or
386 ;; use semantic-mru-bookmark mode to do so. 386 ;; use semantic-mru-bookmark mode to do so.
387 (push-mark) 387 (push-mark)
388 (when (fboundp 'push-tag-mark) 388 (when (fboundp 'xref-push-marker-stack)
389 (push-tag-mark)) 389 (xref-push-marker-stack))
390 390
391 (semantic-decoration-include-visit) 391 (semantic-decoration-include-visit)
392 ) 392 )
diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index b36f801988b..f76d3328888 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -526,6 +526,8 @@ Some tags such as includes have other reference features."
526 (if (not result) 526 (if (not result)
527 (error "No up reference found") 527 (error "No up reference found")
528 (push-mark) 528 (push-mark)
529 (when (fboundp 'xref-push-marker-stack)
530 (xref-push-marker-stack))
529 (cond 531 (cond
530 ;; A tag 532 ;; A tag
531 ((semantic-tag-p result) 533 ((semantic-tag-p result)