unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: 38248@debbugs.gnu.org
Subject: bug#38248: help-follow-symbol silent when no symbol was found
Date: Sun, 17 Nov 2019 20:40:33 +0100	[thread overview]
Message-ID: <CAAeL0SRAvS-ZTXEEvqVjukef-9WeQ9HcBek2cpsQKBRo_RBvaA@mail.gmail.com> (raw)


[-- 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


             reply	other threads:[~2019-11-17 19:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17 19:40 Juanma Barranquero [this message]
2019-11-21 15:12 ` bug#38248: help-follow-symbol silent when no symbol was found 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeL0SRAvS-ZTXEEvqVjukef-9WeQ9HcBek2cpsQKBRo_RBvaA@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=38248@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).