emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r113464: * net/shr.el (shr-mouse-browse-url): Ne


From: Lars Magne Ingebrigtsen
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
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Stefan Monnier <address@hidden> 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 via email to

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