emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1545f28 2/2: Add some documentation for widget-describe and butto


From: Lars Ingebrigtsen
Subject: master 1545f28 2/2: Add some documentation for widget-describe and button-describe
Date: Fri, 7 Aug 2020 07:37:04 -0400 (EDT)

branch: master
commit 1545f28a98e143f027bd9cf69a2f0d323ad49ed3
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add some documentation for widget-describe and button-describe
    
    * doc/emacs/help.texi (Key Help): Document button-describe and
    widget-describe.
    
    * lisp/button.el (push-button): Mention button-describe.
    
    * lisp/cus-edit.el (Custom-newline): Mention widget-describe (bug#139).
---
 doc/emacs/help.texi | 10 ++++++++++
 etc/NEWS            |  4 ++--
 lisp/button.el      |  6 +++++-
 lisp/cus-edit.el    |  5 ++++-
 4 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 167c32c..06ad5a5 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -220,6 +220,16 @@ documentation string of the command it runs.
 command is not on any key, that means you must use @kbd{M-x} to run
 it.  @kbd{C-h w} runs the command @code{where-is}.
 
+@findex button-describe
+@findex widget-describe
+  Some modes in Emacs use various buttons (@pxref{Buttons,,,elisp, The
+Emacs Lisp Reference Manual}) and widgets
+(@pxref{Introduction,,,widget, Emacs Widgets}) that can be clicked to
+perform some action.  To find out what function is ultimately invoked
+by these buttons, Emacs provides the @code{button-describe} and
+@code{widget-describe} commands, that should be run with point over
+the button.
+
 @node Name Help
 @section Help by Command or Variable Name
 
diff --git a/etc/NEWS b/etc/NEWS
index 201c0b5..dcd8ea6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -123,8 +123,8 @@ horizontal movements now stop at the edge of the board.
 setting the variable 'auto-save-visited-mode' buffer-locally to nil.
 
 ** New commands to describe buttons and widgets have been added.
-'describe-widget' (on a widget) will pop up a help buffer and give a
-description of the properties.  Likewise 'describe-button' does the
+'widget-describe' (on a widget) will pop up a help buffer and give a
+description of the properties.  Likewise 'button-describe' does the
 same for a button.
 
 
diff --git a/lisp/button.el b/lisp/button.el
index 941b9fe..03ab59b 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -464,8 +464,12 @@ see).
 POS defaults to point, except when `push-button' is invoked
 interactively as the result of a mouse-event, in which case, the
 mouse event is used.
+
 If there's no button at POS, do nothing and return nil, otherwise
-return t."
+return t.
+
+To get a description of what function will called when pushing a
+butting, use the `button-describe' command."
   (interactive
    (list (if (integerp last-command-event) (point) last-command-event)))
   (if (and (not (integerp pos)) (eventp pos))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 1942f25..1669596 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4841,7 +4841,10 @@ The format is suitable for use with `easy-menu-define'."
   (error "You can't edit this part of the Custom buffer"))
 
 (defun Custom-newline (pos &optional event)
-  "Invoke button at POS, or refuse to allow editing of Custom buffer."
+  "Invoke button at POS, or refuse to allow editing of Custom buffer.
+
+To see what function the widget will call, use the
+`widget-describe' command."
   (interactive "@d")
   (let ((button (get-char-property pos 'button)))
     ;; If there is no button at point, then use the one at the start



reply via email to

[Prev in Thread] Current Thread [Next in Thread]