unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r113464: * net/shr.el (shr-mouse-browse-url): New command and keystroke.
Date: Tue, 30 Jul 2013 16:16:56 +0200	[thread overview]
Message-ID: <m3vc3sf7zb.fsf@stories.gnus.org> (raw)
In-Reply-To: <jwv38r97i5v.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 20 Jul 2013 04:25:54 -0400")

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> +(defun shr-mouse-browse-url (ev)
>> +  "Browse the URL under the mouse cursor."
>> +  (interactive "e")
>> +  (mouse-set-point ev)
>> +  (shr-browse-url))
>
> You can make that work for RET as well (by using (list
> last-nonmenu-event) instead of "e", IIRC), so you don't need a separate
> command for mouse events.

Hm.  I don't quite follow.  The command it calls reads stuff under
point, so we need the event (to change point) in the mousey command, but
not in the non-mousey command:

(defun shr-browse-url (&optional external)
  "Browse the URL under point.
If EXTERNAL, browse the URL using `shr-external-browser'."
  (interactive "P")
  (let ((url (get-text-property (point) 'shr-url)))


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



  reply	other threads:[~2013-07-30 14:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1V0C7f-0002wo-8j@vcs.savannah.gnu.org>
2013-07-20  8:25 ` [Emacs-diffs] trunk r113464: * net/shr.el (shr-mouse-browse-url): New command and keystroke Stefan Monnier
2013-07-30 14:16   ` Lars Magne Ingebrigtsen [this message]
2013-07-30 14:20     ` Jambunathan K
2013-07-30 14:22       ` Lars Magne Ingebrigtsen
2013-07-30 16:00         ` Glenn Morris
2013-07-30 16:45           ` Jambunathan K
2013-07-30 16:59             ` Eli Zaretskii
2013-07-30 17:11               ` Jambunathan K
2013-07-30 17:36                 ` Juanma Barranquero
2013-07-30 18:26                   ` Jambunathan K
2013-07-30 17:40             ` Stephen J. Turnbull
2013-07-30 18:01               ` Jambunathan K
2013-07-30 20:03           ` Stefan Monnier
2013-07-30 20:16             ` Lars Magne Ingebrigtsen
2013-07-30 14:47     ` Stefan Monnier
2013-07-30 14:58       ` Lars Magne Ingebrigtsen

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=m3vc3sf7zb.fsf@stories.gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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).