[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode a13b814 448/495: Add option to reuse a single buff
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode a13b814 448/495: Add option to reuse a single buffer for godoc |
Date: |
Sat, 7 Aug 2021 09:06:06 -0400 (EDT) |
branch: elpa/go-mode
commit a13b8146bfde207513327d95e5e85cefadf99832
Author: Peter GardfjÀll <peter.gardfjall.work@gmail.com>
Commit: Peter Sanford <psanford@sanford.io>
Add option to reuse a single buffer for godoc
This introduces a customization variable 'godoc-reuse-buffer' which, when
non-nil, makes godoc-at-point reuse the same ("*godoc*") buffer to write
output
from all invocations. The default behavior (when nil), is still to write
each
output to a separate buffer (*godoc <path>*).
Closes: #295 [via git-merge-pr]
---
go-mode.el | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/go-mode.el b/go-mode.el
index 853de70..a5a6890 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -239,6 +239,12 @@ Only really desirable when using `godoc' instead of `go
doc'."
:type 'boolean
:group 'godoc)
+(defcustom godoc-reuse-buffer nil
+ "Reuse a single *godoc* buffer to display godoc-at-point calls.
+The default behavior is to open a separate buffer for each call."
+ :type 'boolean
+ :group 'godoc)
+
(defcustom godoc-at-point-function #'godoc-and-godef
"Function to call to display the documentation for an
identifier at a given position.
@@ -1694,9 +1700,15 @@ you save any file, kind of defeating the point of
autoloading."
(go-packages) nil nil nil 'go-godoc-history)
(read-from-minibuffer "godoc: " nil nil nil 'go-godoc-history)))
+(defun godoc--buffer-name (query)
+ "Determine the name to use for the output buffer of a given godoc QUERY."
+ (if godoc-reuse-buffer
+ "*godoc*"
+ (concat "*godoc " query "*")))
+
(defun godoc--get-buffer (query)
"Get an empty buffer for a godoc QUERY."
- (let* ((buffer-name (concat "*godoc " query "*"))
+ (let* ((buffer-name (godoc--buffer-name query))
(buffer (get-buffer buffer-name)))
;; Kill the existing buffer if it already exists.
(when buffer (kill-buffer buffer))
- [nongnu] elpa/go-mode 00e72cd 431/495: Update default for godoc-and-godef-command, (continued)
- [nongnu] elpa/go-mode 00e72cd 431/495: Update default for godoc-and-godef-command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6b67088 432/495: Support trailing commas as dangling operators., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8ddf0b3 433/495: Speed up go-goto-opening-parenthesis, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fdc1545 436/495: Fix indent for case statement comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d387378 438/495: indent: handle comments after multiline case lists, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fbf2544 444/495: Improve fill-paragraph for comment blocks., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e7e0157 447/495: indent: fix indent at top level of file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3bc7479 450/495: Fix infinite loop in fill-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 88ffc9e 452/495: Add github action yaml file to run ert tests, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4f15abf 449/495: Fix fill-paragraph for certain block comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a13b814 448/495: Add option to reuse a single buffer for godoc,
ELPA Syncer <=
- [nongnu] elpa/go-mode a82369b 453/495: Readme: add basic information about gopls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 839190b 455/495: Run all tests in GH CI, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7248358 462/495: Fontify type names in type switch statements, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4fabba6 464/495: Small fix for fontification of array types, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 656590a 463/495: Fontify qualified composite literal types., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d304565 474/495: Fix signature fontification after comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e9b9c0e 473/495: Add some fontification faces for go-dot-mod-mode., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4acf733 468/495: Fully fontify type and const decls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dac200f 469/495: Fix font locking in nested signatures., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fa2162b 475/495: Fix "nil" fontification in type switch clause., ELPA Syncer, 2021/08/07