From: Stephan Schmitt <drmabuse@cs.tu-berlin.de>
To: emacs-orgmode@gnu.org
Subject: link to magit-status buffers
Date: Sat, 15 Aug 2009 15:27:53 +0200 [thread overview]
Message-ID: <4A86B7D9.6080805@cs.tu-berlin.de> (raw)
Hello,
if you use magit mode for your git repositories and want to
create/follow links to magit status buffers (showing the current branch) like this:
[[magit:/usr/local/emacs/org-mode/][/usr/local/emacs/org-mode/]]
you may want to use this code snippet:
--8<---------------cut here---------------start------------->8---
(defun org-magit-store-link ()
"Store a link to a directory to open with magit."
(when (eq major-mode 'magit-mode)
(let* ((dir default-directory)
(link (org-make-link "magit:" dir))
(desc (abbreviate-file-name dir)))
(org-store-link-props :type "magit" :link link :description desc)
link)))
(defun org-magit-open (dir)
"Follow a magit link to DIR."
(require 'magit)
(magit-status dir))
(org-add-link-type "magit" 'org-magit-open nil)
(add-hook 'org-store-link-functions 'org-magit-store-link)
--8<---------------cut here---------------end--------------->8---
Greetings,
Stephan
reply other threads:[~2009-08-15 13:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A86B7D9.6080805@cs.tu-berlin.de \
--to=drmabuse@cs.tu-berlin.de \
--cc=emacs-orgmode@gnu.org \
/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/org-mode.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).