unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Binding mouse-3 to browse-url-at-point question
@ 2002-09-10 15:08 Jeff Rancier
  2002-09-10 16:26 ` David Kastrup
  2002-09-10 16:42 ` Kevin Rodgers
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Rancier @ 2002-09-10 15:08 UTC (permalink / raw)


Hello.

I easily enough bound it, via the following in my .emacs:

(global-set-key [(mouse-3)] 'browse-url-at-point)

The problem is that the point doesn't change to the line I mouse-3 click on
before I browse-url-at-point().  Of course I can click mouse-1, then
mouse-3, to acheive this, but I'd rather have mouse-3 move the point then
browse.

I did C-h k on mouse-1 and got:  mouse-drag-region (which first moves the
point), so I naively tried:

(global-set-key [(mouse-3)]
  (lambda()
    progn
    'mouse-drag-region
    'browse-url-at-point))

But got:

recursive-edit: Wrong type argument: commandp, (lambda nil progn (quote
mouse-drag-region) (quote browse-url-at-point))

Can anyone help me fix this up a bit?
--

Thanks,
Jeff

-----------------------------------------------------------------
"Live as if you were to die tomorrow.
Learn as if you were to live forever."

                                    - M.K. Gandhi

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

* Re: Binding mouse-3 to browse-url-at-point question
  2002-09-10 15:08 Binding mouse-3 to browse-url-at-point question Jeff Rancier
@ 2002-09-10 16:26 ` David Kastrup
  2002-09-10 16:42 ` Kevin Rodgers
  1 sibling, 0 replies; 3+ messages in thread
From: David Kastrup @ 2002-09-10 16:26 UTC (permalink / raw)


"Jeff Rancier" <jeff.rancier@softechnics.com> writes:

> Hello.
> 
> I easily enough bound it, via the following in my .emacs:
> 
> (global-set-key [(mouse-3)] 'browse-url-at-point)
> 
> The problem is that the point doesn't change to the line I mouse-3 click on
> before I browse-url-at-point().  Of course I can click mouse-1, then
> mouse-3, to acheive this, but I'd rather have mouse-3 move the point then
> browse.
> 
> I did C-h k on mouse-1 and got:  mouse-drag-region (which first moves the
> point), so I naively tried:
> 
> (global-set-key [(mouse-3)]
>   (lambda()
>     progn
>     'mouse-drag-region
>     'browse-url-at-point))
> 
> But got:
> 
> recursive-edit: Wrong type argument: commandp, (lambda nil progn (quote
> mouse-drag-region) (quote browse-url-at-point))
> 
> Can anyone help me fix this up a bit?

Commands bound to keys have to start with an (interactive ...) form.
Take a look at C-h f interactive RET, a particular letter argument
tells the keybinding that it should first move the point to the
clicked position...

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David.Kastrup@t-online.de

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

* Re: Binding mouse-3 to browse-url-at-point question
  2002-09-10 15:08 Binding mouse-3 to browse-url-at-point question Jeff Rancier
  2002-09-10 16:26 ` David Kastrup
@ 2002-09-10 16:42 ` Kevin Rodgers
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2002-09-10 16:42 UTC (permalink / raw)


Jeff Rancier wrote:

> I easily enough bound it, via the following in my .emacs:
> 
> (global-set-key [(mouse-3)] 'browse-url-at-point)
> 
> The problem is that the point doesn't change to the line I mouse-3 click on
> before I browse-url-at-point().  Of course I can click mouse-1, then
> mouse-3, to acheive this, but I'd rather have mouse-3 move the point then
> browse.


Shouldn't you bind browse-url-at-mouse instead:


| browse-url-at-mouse: an interactive autoloaded Lisp function in `browse-url'.
|
| Ask a WWW browser to load a URL clicked with the mouse.
| The URL is the one around or before the position of the mouse click
| but point is not changed.  The URL is loaded according to the value of
| `browse-url-browser-function'.

-- 
Kevin Rodgers <kevinr@ihs.com>

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

end of thread, other threads:[~2002-09-10 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-10 15:08 Binding mouse-3 to browse-url-at-point question Jeff Rancier
2002-09-10 16:26 ` David Kastrup
2002-09-10 16:42 ` Kevin Rodgers

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).