GNU bug report logs - #22870
25.0.91; Mouse-clicks fail on button overlays with display properties

Previous Next

Package: emacs;

Reported by: Artur Malabarba <bruce.connor.am <at> gmail.com>

Date: Tue, 1 Mar 2016 17:03:02 UTC

Severity: normal

Found in version 25.0.91

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22870 in the body.
You can then email your comments to 22870 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22870; Package emacs. (Tue, 01 Mar 2016 17:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Artur Malabarba <bruce.connor.am <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 01 Mar 2016 17:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.91; Mouse-clicks fail on button overlays with display properties
Date: Tue, 01 Mar 2016 14:00:32 -0300
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22870; Package emacs. (Wed, 09 Oct 2019 16:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 22870 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 22870 <at> debbugs.gnu.org
Subject: Re: bug#22870: 25.0.91; Mouse-clicks fail on button overlays with
 display properties
Date: Wed, 9 Oct 2019 18:21:22 +0200
[Message part 1 (text/plain, inline)]
Artur Malabarba <bruce.connor.am <at> gmail.com> writes:

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

It seems like it was broken by this commit:
24fc948039 2012-12-06 * lisp/button.el: Make them work in header-lines.

Best regards,
Stefan Kangas
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22870; Package emacs. (Thu, 10 Oct 2019 10:33:02 GMT) Full text and rfc822 format available.

Message #11 received at 22870 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 22870 <at> debbugs.gnu.org, bruce.connor.am <at> gmail.com
Subject: Re: bug#22870: 25.0.91;
 Mouse-clicks fail on button overlays with display properties
Date: Thu, 10 Oct 2019 13:32:15 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 9 Oct 2019 18:21:22 +0200
> Cc: 22870 <at> debbugs.gnu.org
> 
> > Looks like this happens because the first argument given to
> > `button-activate' is `("..." . 1)', while it should be the overlay.
> 
> It seems like it was broken by this commit:
> 24fc948039 2012-12-06 * lisp/button.el: Make them work in header-lines.

Can you sport which part(s) of that change broke this?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22870; Package emacs. (Thu, 10 Oct 2019 10:44:01 GMT) Full text and rfc822 format available.

Message #14 received at 22870 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22870 <at> debbugs.gnu.org, Artur Malabarba <bruce.connor.am <at> gmail.com>
Subject: Re: bug#22870: 25.0.91; Mouse-clicks fail on button overlays with
 display properties
Date: Thu, 10 Oct 2019 12:43:07 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> > It seems like it was broken by this commit:
> > 24fc948039 2012-12-06 * lisp/button.el: Make them work in header-lines.
>
> Can you sport which part(s) of that change broke this?

Yes, this part:

@@ -417,11 +444,13 @@ push-button
       ;; POS is a mouse event; switch to the proper window/buffer
       (let ((posn (event-start pos)))
        (with-current-buffer (window-buffer (posn-window posn))
-     (push-button (posn-point posn) t)))
+   (if (posn-area posn)
+       ;; mode-line or header-line event
+       (button-activate (car (posn-string posn)) t)
+     (push-button (posn-point posn)) t)))

(car (posn-string posn))  -- changed to (posn-string posn) in commit
4b0df8483 means that in button-activate, the following expression
returns nil:

(or (and use-mouse-action (button-get button 'mouse-action))
            (button-get button 'action))

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22870; Package emacs. (Sun, 20 Sep 2020 20:19:01 GMT) Full text and rfc822 format available.

Message #17 received at 22870 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 22870 <at> debbugs.gnu.org
Subject: Re: bug#22870: 25.0.91; Mouse-clicks fail on button overlays with
 display properties
Date: Sun, 20 Sep 2020 22:18:03 +0200
Artur Malabarba <bruce.connor.am <at> gmail.com> writes:

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

I'm unable to reproduce this in Emacs 28, and I see that a change was
committed to the push-button command earlier this year, so I think this
has been fixed, and I'm closing this bug report.  If you can see this
bug in Emacs 28, please send a message to the debbugs address and we'll
reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 22870 <at> debbugs.gnu.org and Artur Malabarba <bruce.connor.am <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 20 Sep 2020 20:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 19 Oct 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.