[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))))
- [nongnu] elpa/go-mode 3da5817 383/495: refactor/rename: allow passing -force flag from Emacs, (continued)
- [nongnu] elpa/go-mode 3da5817 383/495: refactor/rename: allow passing -force flag from Emacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3448304 340/495: go.tools/oracle: change -mode argument into subcommand., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9d94107 328/495: Release version 1.4.0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6bb38ea 387/495: refactor/rename: emacs: set up autoloading of go-rename function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 221e967 390/495: Move go-rename.el to top level, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 12ef34c 391/495: Regenerate AUTHORS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 965dcbc 393/495: Use file name, not directory, with -srcdir flag, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e565a58 394/495: Use goto-char, not beginning-of-buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5737e59 401/495: Regenerate AUTHORS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d13feb2 397/495: Remove support for XEmacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode bfe7a14 405/495: Fix all compilation warnings in go-guru.el,
ELPA Syncer <=
- [nongnu] elpa/go-mode ff87a1e 411/495: Remove Donations section from README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b234d71 412/495: Remove outdated autoloads instructions from README.md, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode eed4af3 415/495: autocompletion while seting guru scope using `completing-read-multiple', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 791dfa5 418/495: require subr-x when interpreting go-guru.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b02c6f6 414/495: Fix local variables list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 120fb91 419/495: Use "guru -tags=xxx yyy", not "guru -tags=xxx, yyy", ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode ed5c2cf 421/495: Fixed compiler warnings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 77c6aae 422/495: Fix quotation marks in the gofmt doc string, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3f60838 424/495: Move testdata under test/ directory., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3ba1982 427/495: Handle indentation for nested dangling operators, ELPA Syncer, 2021/08/07