[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/eldoc-async 6b7f276 1/4: Fix bug when Eldoc buffer is manually k
From: |
João Távora |
Subject: |
scratch/eldoc-async 6b7f276 1/4: Fix bug when Eldoc buffer is manually killed |
Date: |
Sat, 6 Jun 2020 08:37:10 -0400 (EDT) |
branch: scratch/eldoc-async
commit 6b7f276854b4fff41ca907db9dcca75316f5d42d
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Fix bug when Eldoc buffer is manually killed
* lisp/emacs-lisp/eldoc.el (eldoc-doc-buffer): Use buffer-live-p.
(eldoc--handle-docs): Bind q to quit-window
---
lisp/emacs-lisp/eldoc.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 61fc0a8..697ed99 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -393,8 +393,9 @@ return any documentation.")
"Get latest *eldoc* help buffer. Interactively, display it."
(interactive (list t))
(prog1
- (or eldoc--doc-buffer (setq eldoc--doc-buffer
- (get-buffer-create "*eldoc*")))
+ (if (and eldoc--doc-buffer (buffer-live-p eldoc--doc-buffer))
+ eldoc--doc-buffer
+ (setq eldoc--doc-buffer (get-buffer-create "*eldoc*")))
(when interactive (display-buffer eldoc--doc-buffer))))
(defun eldoc--handle-docs (docs)
@@ -404,6 +405,7 @@ Honour most of `eldoc-echo-area-use-multiline-p'."
(with-current-buffer (eldoc-doc-buffer)
(let ((inhibit-read-only t))
(erase-buffer) (setq buffer-read-only t)
+ (local-set-key "q" 'quit-window)
(insert (mapconcat #'identity (mapcar #'car docs) "\n")))
(let* ((width (1- (window-width (minibuffer-window))))
(val (if (and (symbolp eldoc-echo-area-use-multiline-p)