all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: 37515@debbugs.gnu.org
Cc: "Jose A. Ortega Ruiz" <jao@gnu.org>
Subject: bug#37515: 27.0.50; button.el doesn't support help-echo function
Date: Thu, 26 Sep 2019 10:14:52 +0900	[thread overview]
Message-ID: <b4mzhirx3hv.fsf@jpl.org> (raw)

Hi,

I found the `forward-button' command shows a Lisp function object
if the value of the `help-echo' text property at the destination
point is a function.  But is should be its return value.

,---- (info "(elisp) Special Properties")
| `help-echo'
|  If text has a string as its `help-echo' property, then when you
|  move the mouse onto that text, Emacs displays that string in the
|  echo area, or in the tooltip window (*note Tooltips::).
|
|  If the value of the `help-echo' property is a function, that
|  function is called with three arguments, WINDOW, OBJECT and POS and
|  should return a help string or `nil for none.
`----

So, `forward-button' should be fixed to something like this:

--8<---------------cut here---------------start------------->8---
--- button.el~	2019-07-30 21:20:12.288879200 +0000
+++ button.el	2019-09-26 01:12:28.492808400 +0000
@@ -513,8 +513,11 @@
             nil
 	  (user-error (if wrap "No buttons!" "No more buttons")))
       (let ((msg (and display-message (button-get button 'help-echo))))
-	(when msg
-	  (message "%s" msg)))
+	(cond ((functionp msg)
+	       (message
+		"%s" (funcall msg (selected-window) (current-buffer) (point))))
+	      (msg
+	       (message "%s" msg))))
       button)))
 
 (defun backward-button (n &optional wrap display-message no-error)
--8<---------------cut here---------------end--------------->8---

Thanks.





             reply	other threads:[~2019-09-26  1:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26  1:14 Katsumi Yamaoka [this message]
2019-09-26  1:26 ` bug#37515: 27.0.50; button.el doesn't support help-echo function Katsumi Yamaoka
2019-09-26 13:49   ` Lars Ingebrigtsen
     [not found]     ` <esr-pdhHsyCqhSoZbW_3iLp4UdujyDpcbOuBdPROA9aG3j9CO0niyrK5O_Tf33N-le-e5hmaqbYZLyuNc6kd3A==@protonmail.internalid>
2019-09-26 21:44     ` Katsumi Yamaoka
2019-09-26 22:56       ` Jose A. Ortega Ruiz
2019-09-30 19:47         ` Basil L. Contovounesios
2019-09-30 19:53           ` Basil L. Contovounesios
2019-10-01 12:29             ` Basil L. Contovounesios
2019-10-01 12:28           ` Lars Ingebrigtsen
2019-10-01 12:32             ` Basil L. Contovounesios
2019-10-03 23:00               ` Basil L. Contovounesios

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

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

  git send-email \
    --in-reply-to=b4mzhirx3hv.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=37515@debbugs.gnu.org \
    --cc=jao@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 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.