From f3434fe2f3f1ae6abebb64f6198569e43ba0ee73 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 24 Apr 2022 15:47:08 +0300 Subject: [PATCH] ; Fix last change 'display-local-help' and its documentation * etc/NEWS: * doc/emacs/help.texi (Help Summary): Fix typo and wording of documentation of 'C-u C-h .'. * lisp/help-at-pt.el (display-local-help): Avoid byte-compiler warnings. Fix wording of doc string. --- doc/emacs/help.texi | 7 ++++--- etc/NEWS | 7 ++++--- lisp/help-at-pt.el | 7 +++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index ee3d898019e..a4b329d0890 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -182,9 +182,10 @@ programming language you are editing (@code{info-lookup-symbol}). @item C-h . Display the help message for a special text area, if point is in one (@code{display-local-help}). (These include, for example, links in -@file{*Help*} buffers.) @xref{Help Echo}. If you use a prefix for -this command, and point as on a button or a widget, this command will -pop to a new buffer that describes the button/widget. +@file{*Help*} buffers.) @xref{Help Echo}. If you invoke +this command with a prefix argument, @kbd{C-u C-h .}, and point is on +a button or a widget, this command will pop a new buffer that +describes that button/widget. @end table @node Key Help diff --git a/etc/NEWS b/etc/NEWS index 48ff8c37087..73df079ce5f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -417,10 +417,11 @@ command also works for non-Emoji characters.) ** Help +++ -*** The 'C-h .' command now takes a prefix to display button/widget help. +*** The 'C-h .' command now accepts a prefix argument. 'C-u C-h .' would previously inhibit displaying a warning message if -there's no local help at point. This has been changed to trigger a -call 'button-describe'/'widget-describe' instead. +there's no local help at point. This has been changed to call +call 'button-describe'/'widget-describe' and display button/widget +help instead. --- *** New user option 'help-enable-variable-value-editing'. diff --git a/lisp/help-at-pt.el b/lisp/help-at-pt.el index 5bdaa35c0bc..1a6d374db09 100644 --- a/lisp/help-at-pt.el +++ b/lisp/help-at-pt.el @@ -81,6 +81,9 @@ If this produces no string either, return nil." (echo (help-at-pt-string))) (if (and kbd (not (eq kbd t))) kbd echo))) +(declare-function widget-describe "wid-edit" (&optional widget-or-pos)) +(declare-function widget-at "wid-edit" (&optional pos)) + ;;;###autoload (defun display-local-help (&optional inhibit-warning describe-button) "Display local help in the echo area. @@ -95,8 +98,8 @@ is displayed. If INHIBIT-WARNING is non-nil, this prevents display of a message in case there is no help. -If DESCRIBE-BUTTON in non-nil (interactively, the prefix), and -there's a button/widget at point, pop to a buffer describing that +If DESCRIBE-BUTTON in non-nil (interactively, the prefix arg), and +there's a button/widget at point, pop a buffer describing that button/widget instead." (interactive (list nil current-prefix-arg)) (let ((help (help-at-pt-kbd-string))) -- 2.39.5