unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22870: 25.0.91; Mouse-clicks fail on button overlays with display properties
@ 2016-03-01 17:00 Artur Malabarba
  2019-10-09 16:21 ` Stefan Kangas
  2020-09-20 20:18 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: Artur Malabarba @ 2016-03-01 17:00 UTC (permalink / raw)
  To: 22870


1. Visit the scratch buffer.

2. Evaluate this code:

(defun my-action (&rest _)
  (interactive)
  (message "WORKED!"))

(make-button (point-min) (+ 30 (point-min))
             'display "..."
             'action #'my-action
             'follow-link t)

3. As expected, the first 30 chars of the buffer will be hidden under a
button that displays as “...”.  Hitting RET on that buffer works as
expected (you see the message “Worked!” on the echo-area).

4. Try clicking on the button with the mouse. You'll get the following error:

Debugger entered--Lisp error: (void-function nil)
  nil(("..." . 1))
  button-activate(("..." . 1) t)
  push-button((mouse-2 (#<window 3 on *scratch*> 1 (14 . 2) 15461622 ("..." . 1) 1 (1 . 0) nil (5 . 2) (9 . 18))))
  funcall-interactively(push-button (mouse-2 (#<window 3 on *scratch*> 1 (14 . 2) 15461622 ("..." . 1) 1 (1 . 0) nil (5 . 2) (9 . 18))))
  call-interactively(push-button nil nil)
  command-execute(push-button)

5. Adding a `mouse-action' property makes no difference.

6. Without the `display' property, everything works as expected.



Looks like this happens because the first argument given to
`button-activate' is `("..." . 1)', while it should be the overlay.





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

end of thread, other threads:[~2020-09-20 20:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 17:00 bug#22870: 25.0.91; Mouse-clicks fail on button overlays with display properties Artur Malabarba
2019-10-09 16:21 ` Stefan Kangas
2019-10-10 10:32   ` Eli Zaretskii
2019-10-10 10:43     ` Stefan Kangas
2020-09-20 20:18 ` Lars Ingebrigtsen

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).