emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Girard <nicolas.girard@nerim.net>
To: emacs-orgmode@gnu.org
Subject: Re: org-follow-link-in-same-window
Date: Sat, 27 Jun 2009 12:25:45 +0200	[thread overview]
Message-ID: <51b0095d0906270325j72aeff64hb4be06d1ca7522cc@mail.gmail.com> (raw)
In-Reply-To: <11A9F44D-1DFC-4E8B-A7B1-3A9FC34CA859@gmail.com>

2009/6/27 Carsten Dominik <carsten.dominik@gmail.com>
> 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)]
	     (define-key org-mouse-map [C-down-mouse-1]
	     (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.


      reply	other threads:[~2009-06-27 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-27  8:41 org-follow-link-in-same-window Nicolas Girard
2009-06-27  9:38 ` org-follow-link-in-same-window Carsten Dominik
2009-06-27 10:25   ` Nicolas Girard [this message]

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:

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=51b0095d0906270325j72aeff64hb4be06d1ca7522cc@mail.gmail.com \
    --to=nicolas.girard@nerim.net \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: org-follow-link-in-same-window' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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