emacs-devel
[Top][All Lists]
Advanced

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

Re: mouse-1-click-follows-link and mime messages


From: Chong Yidong
Subject: Re: mouse-1-click-follows-link and mime messages
Date: Tue, 07 Feb 2006 19:42:14 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Chong Yidong <address@hidden> writes:

> Romain Francoise <address@hidden> writes:
>
>>> With point in the Gnus article window, mouse-1 on links in the article
>>> (e.g., mime attachments or URLs) performs the correct action (i.e.,
>>> opening the attachment or following the URL).
>>
>>> However, with point is in the Gnus summary window, mouse-1 on the same
>>> links does nothing.  Mouse-2 works fine.
>>
>> It's a bug in Emacs due to this change:
>>
>> 2005-12-27  Richard M. Stallman  <address@hidden>
>>
>>      * mouse.el (mouse-drag-region-1): When remapping mouse-1 to
>>      mouse-2, go back to previously selected window, so it's selected
>>      when mouse-2 command runs.
>
> Looks like this affects all `link' widgets.  For instance, clicking on
> the links in the Customize buffer does not work if another window is
> selected.

I debugged this some more.  One way to fix it (without reverting RMS's
change) is to change the :follow-link property of the `link' widget:

*** /home/cyd/emacs/lisp/wid-edit.el.~1.163.~   2006-02-07 18:22:31.000000000 
-0500
--- /home/cyd/emacs/lisp/wid-edit.el    2006-02-07 19:32:34.000000000 -0500
***************
*** 1754,1760 ****
    "An embedded link."
    :button-prefix 'widget-link-prefix
    :button-suffix 'widget-link-suffix
!   :follow-link "\C-m"
    :help-echo "Follow the link."
    :format "%[%t%]")
  
--- 1754,1760 ----
    "An embedded link."
    :button-prefix 'widget-link-prefix
    :button-suffix 'widget-link-suffix
!   :follow-link 'widget-button-click
    :help-echo "Follow the link."
    :format "%[%t%]")
  
However, another strange bug surfaces if you do this.  Do
M-x customize in one window, and select another window.  Click mouse-1
on "Custom file" in the Customize buffer.  With the above patch, this
works: the Info file is opened in that window, as expected.  Now,
hover the mouse over one of the links in the header line.  An error is
signalled:

  Debugger entered--Lisp error: (args-out-of-range 1875 1875)
  get-char-property(1875 follow-link)
  mouse-on-link-p((#<window 6 on *info*> header-line (118 . 13) 0
    (#("Next: Face Customization,  Prev: Changing a Variable,  Up: Easy
        Customization" 0 6 ... 6 24 ... 24 27 nil 27 33 ... 33 52 ... 52 55
        nil 55 59 ... 59 77 ...) . 16) 1875 (16 . -1) nil (6 . 13) (7 . 14)))
  mouse-fixup-help-message(#("mouse-2: Go to node Face Customization"
    0 20 nil 20 38 (font-lock-face info-header-xref mouse-face highlight)))
  read-event()
  byte-code("...")
  (track-mouse (byte-code "..."))
  (lambda nil (track-mouse (byte-code "...")
  mouse-drag-track((down-mouse-1 (#<window 6 on *info*> 315 (60 . 82)
    200741335 nil 315 (8 . 5) nil (4 . 12) (7 . 14))) t)
  mouse-drag-region((down-mouse-1 (#<window 6 on *info*> 315 (60 . 82)
    200741335 nil 315 (8 . 5) nil (4 . 12) (7 . 14))))
  call-interactively(mouse-drag-region)

Any ideas?




reply via email to

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