all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23899: 24.5; mouse-on-link-p breaks for positions
@ 2016-07-05 17:32 sbaugh
  2016-07-07 16:16 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: sbaugh @ 2016-07-05 17:32 UTC (permalink / raw
  To: 23899


The documentation for mouse-on-link-p says:
    POS must be a buffer position in the current buffer or a mouse
    event location in the selected window (see `event-start').
However, doing M-: (mouse-on-link-p (point)) fails with a type
error. And, in general, passing a buffer position to mouse-on-link-p
fails with a type error.

This appears to be due to this section of mouse-on-link-p:
    (let ((area (posn-area pos)))
      (when area
        (key-binding (vector area 'follow-link) nil t pos)))

I would recommend wrapping this in a (and (consp pos) ...) to avoid
running posn-area on buffer positions. The rest of the function works
fine, this part was added later.





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

* bug#23899: 24.5; mouse-on-link-p breaks for positions
  2016-07-05 17:32 bug#23899: 24.5; mouse-on-link-p breaks for positions sbaugh
@ 2016-07-07 16:16 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2016-07-07 16:16 UTC (permalink / raw
  To: sbaugh; +Cc: 23899-done

> From: sbaugh@catern.com
> Date: Tue, 05 Jul 2016 13:32:49 -0400
> 
> The documentation for mouse-on-link-p says:
>     POS must be a buffer position in the current buffer or a mouse
>     event location in the selected window (see `event-start').
> However, doing M-: (mouse-on-link-p (point)) fails with a type
> error. And, in general, passing a buffer position to mouse-on-link-p
> fails with a type error.
> 
> This appears to be due to this section of mouse-on-link-p:
>     (let ((area (posn-area pos)))
>       (when area
>         (key-binding (vector area 'follow-link) nil t pos)))
> 
> I would recommend wrapping this in a (and (consp pos) ...) to avoid
> running posn-area on buffer positions. The rest of the function works
> fine, this part was added later.

I don't think any code changes are required.  This is just a
documentation problem: what the doc string fails to tell is that the
function needs POS as a mouse-click position, which is a list.  If you
want to invoke the function at point, you can get the argument by
calling posn-at-point.

I installed a change to that effect on the emacs-25 branch, and I'm
marking this bug "done".

Thanks.





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

end of thread, other threads:[~2016-07-07 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-05 17:32 bug#23899: 24.5; mouse-on-link-p breaks for positions sbaugh
2016-07-07 16:16 ` Eli Zaretskii

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.