unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
Subject: Re: mouse-1-click-follows-link and mime messages
Date: Tue, 07 Feb 2006 19:42:14 -0500	[thread overview]
Message-ID: <87oe1iwujd.fsf@stupidchicken.com> (raw)
In-Reply-To: <877j86929j.fsf@stupidchicken.com> (Chong Yidong's message of "Tue, 07 Feb 2006 18:29:12 -0500")

Chong Yidong <cyd@stupidchicken.com> writes:

> Romain Francoise <romain@orebokech.com> 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  <rms@gnu.org>
>>
>> 	* 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	other threads:[~2006-02-08  0:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-06 20:43 mouse-1-click-follows-link and mime messages Chong Yidong
2006-02-07  7:44 ` Romain Francoise
2006-02-07 17:26   ` Chong Yidong
2006-02-07 18:05     ` Romain Francoise
2006-02-07 19:43       ` Chong Yidong
2006-02-07 23:29   ` Chong Yidong
2006-02-08  0:42     ` Chong Yidong [this message]
2006-02-09 17:48       ` Richard M. Stallman
2006-02-08 19:05     ` Richard M. Stallman
2006-02-08 20:51       ` Chong Yidong
2006-02-10  1:12         ` Richard M. Stallman
2006-02-10  1:32           ` David Kastrup
2006-02-16 14:32         ` mouse-1 drag invokes follow-link (was: mouse-1-click-follows-link and mime messages) Reiner Steib
2006-02-16 16:04           ` mouse-1 drag invokes follow-link Chong Yidong
2006-02-16 21:12             ` Reiner Steib

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87oe1iwujd.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    /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 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).