emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/go-mode bfe7a14 405/495: Fix all compilation warnings in g


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode bfe7a14 405/495: Fix all compilation warnings in go-guru.el
Date: Sat, 7 Aug 2021 09:05:57 -0400 (EDT)

branch: elpa/go-mode
commit bfe7a14e9bf957d050e3c429156e697bb3670f21
Author: Philipp Stephani <phst@google.com>
Commit: Dominik Honnef <dominik@honnef.co>

    Fix all compilation warnings in go-guru.el
    
    Closes: gh-188 [via git-merge-pr]
---
 go-guru.el | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/go-guru.el b/go-guru.el
index cab5eb3..c2ac658 100644
--- a/go-guru.el
+++ b/go-guru.el
@@ -117,7 +117,7 @@
   (define-key m ">" #'go-guru-callees)
   (define-key m "x" #'go-guru-expand-region)) ;; x for expand
 
-(define-key go-mode-map (kbd "C-c C-o") #'go-guru-map)
+(define-key go-mode-map (kbd "C-c C-o") 'go-guru-map)
 
 (easy-menu-define go-guru-mode-menu go-mode-map
   "Menu for Go Guru."
@@ -367,7 +367,10 @@ function containing the current point."
   (let* ((res (go-guru--json "definition"))
         (desc (cdr (assoc 'desc res))))
     (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)))
     (go-guru--goto-pos (cdr (assoc 'objpos res)))
     (message "%s" desc)))
 
@@ -450,6 +453,22 @@ highlights from previously highlighted identifier."
   (go-guru-unhighlight-identifiers)
   (go-guru--hl-identifier))
 
+;;;###autoload
+(define-minor-mode go-guru-hl-identifier-mode
+  "Highlight instances of the identifier at point after a short
+timeout."
+  :group 'go-guru
+  (if go-guru-hl-identifier-mode
+      (progn
+       (go-guru--hl-set-timer)
+       ;; Unhighlight if point moves off identifier
+       (add-hook 'post-command-hook 
#'go-guru--hl-identifiers-post-command-hook nil t)
+       ;; Unhighlight any time the buffer changes
+       (add-hook 'before-change-functions 
#'go-guru--hl-identifiers-before-change-function nil t))
+    (remove-hook 'post-command-hook 
#'go-guru--hl-identifiers-post-command-hook t)
+    (remove-hook 'before-change-functions 
#'go-guru--hl-identifiers-before-change-function t)
+    (go-guru-unhighlight-identifiers)))
+
 (defun go-guru--hl-identifier ()
   "Highlight all instances of the identifier under point."
   (let ((posn (cdr (assoc 'sameids (go-guru-what)))))
@@ -478,22 +497,6 @@ identifier at point, if necessary."
                                      t
                                      #'go-guru--hl-identifiers-function)))
 
-;;;###autoload
-(define-minor-mode go-guru-hl-identifier-mode
-  "Highlight instances of the identifier at point after a short
-timeout."
-  :group 'go-guru
-  (if go-guru-hl-identifier-mode
-      (progn
-       (go-guru--hl-set-timer)
-       ;; Unhighlight if point moves off identifier
-       (add-hook 'post-command-hook 
#'go-guru--hl-identifiers-post-command-hook nil t)
-       ;; Unhighlight any time the buffer changes
-       (add-hook 'before-change-functions 
#'go-guru--hl-identifiers-before-change-function nil t))
-    (remove-hook 'post-command-hook 
#'go-guru--hl-identifiers-post-command-hook t)
-    (remove-hook 'before-change-functions 
#'go-guru--hl-identifiers-before-change-function t)
-    (go-guru-unhighlight-identifiers)))
-
 (defun go-guru--on-overlay-p (id)
   "Return whether point is on a guru overlay of type ID."
   (cl-find-if (lambda (el) (eq (overlay-get el 'go-guru-overlay) id)) 
(overlays-at (point))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]