[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 4e92adb 150/495: add godef-jump-other-window
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 4e92adb 150/495: add godef-jump-other-window |
Date: |
Sat, 7 Aug 2021 09:05:02 -0400 (EDT) |
branch: elpa/go-mode
commit 4e92adb2ae25435db3ec8823f03a6eb8d4e396db
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>
add godef-jump-other-window
Allow jumping to source in another window. Bound to C-x 4 C-c C-j by
default.
---
go-mode.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 6288468..3886e46 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -209,6 +209,7 @@
(define-key m "=" 'go-mode-insert-and-indent)
(define-key m (kbd "C-c C-a") 'go-import-add)
(define-key m (kbd "C-c C-j") 'godef-jump)
+ (define-key m (kbd "C-x 4 C-c C-j") 'godef-jump-other-window)
(define-key m (kbd "C-c C-d") 'godef-describe)
m)
"Keymap used by Go mode to implement electric keys.")
@@ -873,13 +874,13 @@ will be commented, otherwise they will be removed
completely."
(message "Removed %d imports" (length lines)))
(if flymake-state (flymake-mode-on)))))
-(defun godef--find-file-line-column (specifier)
+(defun godef--find-file-line-column (specifier other-window)
"Given a file name in the format of `filename:line:column',
visit FILENAME and go to line LINE and column COLUMN."
(let* ((components (split-string specifier ":"))
(line (string-to-number (nth 1 components)))
(column (string-to-number (nth 2 components))))
- (with-current-buffer (find-file (car components))
+ (with-current-buffer (funcall (if other-window 'find-file-other-window
'find-file) (car components))
(goto-char (point-min))
(forward-line (1- line))
(beginning-of-line)
@@ -911,7 +912,7 @@ description at POINT."
(message "%s" description)))
(file-error (message "Could not run godef binary"))))
-(defun godef-jump (point)
+(defun godef-jump (point &optional other-window)
"Jump to the definition of the expression at POINT."
(interactive "d")
(condition-case nil
@@ -925,9 +926,13 @@ description at POINT."
(message "%s" file))
(t
(push-mark)
- (godef--find-file-line-column file))))
+ (godef--find-file-line-column file other-window))))
(file-error (message "Could not run godef binary"))))
+(defun godef-jump-other-window (point)
+ (interactive "d")
+ (godef-jump point t))
+
(provide 'go-mode)
;;; go-mode.el ends here
- [nongnu] elpa/go-mode 895b285 138/495: add customizable variable for mode hook, (continued)
- [nongnu] elpa/go-mode 895b285 138/495: add customizable variable for mode hook, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode bf0bd30 144/495: Change the way we use prog-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2ec688b 143/495: kill gofmt errbuf if the buffer was already formatted, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 98e66f7 142/495: add docstring to go--apply-rcs-patch, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fd03739 151/495: push mark to find-tag-marker-ring, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4c13588 147/495: replace go-goto-opening-parenthesis implementation with backward-up-list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dc6bd34 154/495: swallow error in go-goto-opening-parenthesis, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c2b4441 155/495: Require ring so that we don't rely on a transitive require, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8a1c5df 159/495: minor style changes from CL, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 96eb71e 153/495: fix godef-jump on Windows, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4e92adb 150/495: add godef-jump-other-window,
ELPA Syncer <=
- [nongnu] elpa/go-mode 2f67998 160/495: don't change point in go--line-column-to-point, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f79120b 166/495: add support for mode=count coverage, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1d5ddda 167/495: add coverage count as a tooltip, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode eaa47c2 165/495: remove old overlays, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 210bb30 174/495: go-coverage: only update max-count if it's a count for the file we're interested in, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 38f2465 164/495: display a helpful prompt in go-coverage, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9db834a 178/495: changes from CL, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f1c266d 172/495: enable godef to work in coverage buffers, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4b1c93f 173/495: use error instead of message in godef--call, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 68e9626 177/495: fully implement prog-mode for older emacsen, ELPA Syncer, 2021/08/07