emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] org-follow-link-in-same-window


From: Nicolas Girard
Subject: Re: [Orgmode] org-follow-link-in-same-window
Date: Sat, 27 Jun 2009 12:25:45 +0200

2009/6/27 Carsten Dominik <address@hidden>
>
> On Jun 27, 2009, at 10:41 AM, Nicolas Girard wrote:

> (defun org-open-at-mouse-same-window (ev)
>  "Open file link or URL at mouse."
>  (interactive "e")
>  (mouse-set-point ev)
>  (if (eq major-mode 'org-agenda-mode)
>      (org-agenda-copy-local-variable 'org-link-abbrev-alist-local))
>  (let ((org-link-frame-setup
>         '((vm . vm-visit-folder)
>           (gnus . gnus)
>           (file . find-file))))
>    (org-open-at-point)))

Thanks ! This works great !

>>
>> I found none of them to work *but* the latest, [s-mouse-1].

Now, I must have been mistaken because none of the bindings I tried
actually worked. I'm sure I could trigger my own function thanks to a
debugging message, but it was after a bit of trial and error, and I
can't see how.

Here's what I tried and which didn't work:


(add-hook 'org-load-hook
          '(lambda ()
             (define-key org-mouse-map [s-mouse-1] 
'org-open-at-mouse-same-window)
             (define-key org-mouse-map [s-down-mouse-1] 
'org-open-at-mouse-same-window)
             (define-key org-mode-map [(control button1)]
'org-open-at-mouse-same-window)
             (define-key org-mouse-map [C-down-mouse-1]
'org-open-at-mouse-same-window)
             (define-key org-mouse-map [C-down-mouse-2] 
'org-open-at-mouse-same-window)
))

I could only get the behaviour I want by de-defining
org-mouse-move-tree-start with the body of your
org-open-at-mouse-same-window function.

Nicolas




reply via email to

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