all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#38248: help-follow-symbol silent when no symbol was found
@ 2019-11-17 19:40 Juanma Barranquero
  2019-11-21 15:12 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2019-11-17 19:40 UTC (permalink / raw)
  To: 38248


[-- Attachment #1.1: Type: text/plain, Size: 829 bytes --]

Package: emacs
Severity: minor
Tags: patch

Currently, help-follow and help-follow-mouse signal an error if there's
nothing to follow. However, help-follow-symbol does not, which means that
C-c C-c in the help buffer when over an arbitrary non-symbol does nothing
and says nothing.

That's not just inconsistent, but a bit disconcerting, as sometimes
following a symbol can be slow. In my build, it takes a second or more to
show the symbol documentation, so when there's no symbol I stand waiting
for something to happen for a couple of seconds.

The following patch fixes that. The only reason against I can think of is
when `help-follow-symbol' is called from elisp, because it will now signal
an error. However, at least in the Emacs sources help-follow-symbol is
never called from elisp, just as a keybinding or menu entry.

[-- Attachment #1.2: Type: text/html, Size: 975 bytes --]

[-- Attachment #2: 0001-lisp-help-mode.el-help-follow-symbol-Signal-no-symbo.patch --]
[-- Type: application/octet-stream, Size: 1105 bytes --]

From 4fb8e8c124009ab283fb9d15ad7aaa0a90f56ec7 Mon Sep 17 00:00:00 2001
From: Juanma Barranquero <lekktu@gmail.com>
Date: Sun, 17 Nov 2019 20:27:12 +0100
Subject: [PATCH] * lisp/help-mode.el (help-follow-symbol): Signal no symbol at
 point.

---
 lisp/help-mode.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 054a1ef8c2..e70570c3ee 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -749,10 +749,11 @@ help-follow-symbol
 	    (buffer-substring (point)
 			      (progn (skip-syntax-forward "w_")
 				     (point)))))))
-    (when (or (boundp sym)
-	      (get sym 'variable-documentation)
-	      (fboundp sym) (facep sym))
-      (help-do-xref pos #'describe-symbol (list sym)))))
+    (if (or (boundp sym)
+	    (get sym 'variable-documentation)
+	    (fboundp sym) (facep sym))
+        (help-do-xref pos #'describe-symbol (list sym))
+      (user-error "No symbol here"))))
 
 (defun help-mode-revert-buffer (_ignore-auto noconfirm)
   (when (or noconfirm (yes-or-no-p "Revert help buffer? "))
-- 
2.23.0.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-22 20:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-17 19:40 bug#38248: help-follow-symbol silent when no symbol was found Juanma Barranquero
2019-11-21 15:12 ` Lars Ingebrigtsen
2019-11-22 18:50   ` Juanma Barranquero
2019-11-22 19:25     ` Eli Zaretskii
2019-11-22 19:40       ` Juanma Barranquero
2019-11-22 19:52         ` Eli Zaretskii
2019-11-22 20:13           ` Juanma Barranquero

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.