branch: elpa/go-mode
commit 5056b857a90d732d78162b3263a1dd94f7c5afe3
Author: Philipp Stephani <[email protected]>
Commit: Dominik Honnef <[email protected]>
Use xref functions if available
---
go-mode.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/go-mode.el b/go-mode.el
index bbd9267..92564cb 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -22,6 +22,7 @@
(require 'find-file)
(require 'ring)
(require 'url)
+(require 'xref nil :noerror) ; xref is new in Emacs 25.1
(eval-when-compile
@@ -1515,7 +1516,10 @@ description at POINT."
(if (not (godef--successful-p file))
(message "%s" (godef--error file))
(push-mark)
- (ring-insert find-tag-marker-ring (point-marker))
+ (if (eval-when-compile (fboundp 'xref-push-marker-stack))
+ ;; TODO: Integrate this facility with XRef.
+ (xref-push-marker-stack)
+ (ring-insert find-tag-marker-ring (point-marker)))
(godef--find-file-line-column file other-window)))
(file-error (message "Could not run godef binary"))))