[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa a0249c8 23/71: Per #437: remap display-local-help
From: |
João Távora |
Subject: |
[elpa] externals/elpa a0249c8 23/71: Per #437: remap display-local-help (C-h .) to eglot-help-at-point |
Date: |
Wed, 16 Dec 2020 11:42:17 -0500 (EST) |
branch: externals/elpa
commit a0249c81fa466c08df87de92749b77f0f0db5ff6
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Per #437: remap display-local-help (C-h .) to eglot-help-at-point
* eglot.el (eglot-help-at-point): Fallback to display-local-help if no
hover doc
(eglot-mode-map): Remap display-local-help to eglot-help-at-point..
---
eglot.el | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/eglot.el b/eglot.el
index 09be1f8..8fadd5f 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1238,7 +1238,10 @@ and just return it. PROMPT shouldn't end with a
question mark."
;;; Minor modes
;;;
-(defvar eglot-mode-map (make-sparse-keymap))
+(defvar eglot-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [remap display-local-help] 'eglot-help-at-point)
+ map))
(defvar-local eglot--current-flymake-report-fn nil
"Current flymake report function for this buffer")
@@ -2247,19 +2250,20 @@ is not active."
(setq eglot--help-buffer (generate-new-buffer "*eglot-help*"))))
(defun eglot-help-at-point ()
- "Request \"hover\" information for the thing at point."
+ "Request documentation for the thing at point."
(interactive)
(eglot--dbind ((Hover) contents range)
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover
(eglot--TextDocumentPositionParams))
- (when (seq-empty-p contents) (eglot--error "No hover info here"))
- (let ((blurb (eglot--hover-info contents range))
- (sym (thing-at-point 'symbol)))
- (with-current-buffer (eglot--help-buffer)
- (with-help-window (current-buffer)
- (rename-buffer (format "*eglot-help for %s*" sym))
- (with-current-buffer standard-output (insert blurb))
- (setq-local nobreak-char-display nil))))))
+ (if (seq-empty-p contents)
+ (display-local-help)
+ (let ((blurb (eglot--hover-info contents range))
+ (sym (thing-at-point 'symbol)))
+ (with-current-buffer (eglot--help-buffer)
+ (with-help-window (current-buffer)
+ (rename-buffer (format "*eglot-help for %s*" sym))
+ (with-current-buffer standard-output (insert blurb))
+ (setq-local nobreak-char-display nil)))))))
(defun eglot-doc-too-large-for-echo-area (string)
"Return non-nil if STRING won't fit in echo area.
- [elpa] externals/elpa e5cf30e 09/71: Close #435: create match xrefs when possible, (continued)
- [elpa] externals/elpa e5cf30e 09/71: Close #435: create match xrefs when possible, João Távora, 2020/12/16
- [elpa] externals/elpa ad3f049 24/71: Close #417: minimally document relation with project.el, João Távora, 2020/12/16
- [elpa] externals/elpa 2f75da2 28/71: Fix #460: fix "free variable" warning, João Távora, 2020/12/16
- [elpa] externals/elpa 0f57efb 26/71: Simplify bug-reporting instructions, João Távora, 2020/12/16
- [elpa] externals/elpa 91a7cba 33/71: Fix #474, #478: prompt for executable if supplied name does not exist, João Távora, 2020/12/16
- [elpa] externals/elpa 9efe207 05/71: Make curl invocation fail more explicitly in .travis.yml, João Távora, 2020/12/16
- [elpa] externals/elpa 73bc752 11/71: Close #441: shield tests from some user customizations, João Távora, 2020/12/16
- [elpa] externals/elpa b6519a5 16/71: Per #446: Add tests for eglot-server-programs, João Távora, 2020/12/16
- [elpa] externals/elpa 9bc58df 17/71: Fix #446: unbreak eglot--guess-contact for host-and-port case, João Távora, 2020/12/16
- [elpa] externals/elpa 197984c 27/71: Remove trailing whitespaces, João Távora, 2020/12/16
- [elpa] externals/elpa a0249c8 23/71: Per #437: remap display-local-help (C-h .) to eglot-help-at-point,
João Távora <=
- [elpa] externals/elpa ee87519 41/71: Replace uses of project-roots with project-root, João Távora, 2020/12/16
- [elpa] externals/elpa 3b01561 39/71: Close #459: rework computation of string given to Eldoc (again), João Távora, 2020/12/16
- [elpa] externals/elpa bf75312 35/71: Require Xref, Project and Eldoc from GNU ELPA, João Távora, 2020/12/16
- [elpa] externals/elpa 2b16952 44/71: Try to make hover-multiline-doc-locus test pass on Travis, João Távora, 2020/12/16
- [elpa] externals/elpa ac9239b 46/71: Fix small problems around Eglot's help buffer, João Távora, 2020/12/16
- [elpa] externals/elpa 433779d 49/71: * eglot.el (Package-Requires): Require Flymake 1.0.9 and eldoc 1.2.0, João Távora, 2020/12/16
- [elpa] externals/elpa e3ce64a 54/71: Fix #510: use a hash-table for storing resolved completions, João Távora, 2020/12/16
- [elpa] externals/elpa e5fefc7 56/71: Really unbreak eldoc-related tests, João Távora, 2020/12/16
- [elpa] externals/elpa 2172641 65/71: Fix #558: Don't force eglot-strict-mode completely in eglot--dcase, João Távora, 2020/12/16
- [elpa] externals/elpa f9a11fe 63/71: Per #300: Don't send JSON null (Elisp nil) down the wire, João Távora, 2020/12/16