emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <maus.david@gmail.com>
To: "Daniel E. Doherty" <ded-law@ddoherty.net>
Cc: reimar.finken@gmx.de, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Git Store Link Broken?
Date: Sat, 20 Feb 2010 19:48:17 +0100	[thread overview]
Message-ID: <87r5of4uby.wl%maus.david@gmail.com> (raw)
In-Reply-To: <87hbpbki7r.wl%ded-law@ddoherty.net>


[-- Attachment #1.1.1: Type: text/plain, Size: 834 bytes --]

Hi Daniel,

Daniel E. Doherty wrote:

>Hello all,

>I noticed when I upgraded org from 6.21 (which comes with Emacs) to the
>git version (6.34trans), org-store-link stopped working.  When I try to
>store a link from dired, I get a stringp nil error, with this debugger
>output:

It's a small glitch in `org-git-store-link': Orgmode calls all
registered store-link functions to see if one declares itself of being
responsible for the particular file or buffer.  `org-git-store-link'
tries to make an assumption on whether the file that is currently
visited is inside a git repository w/o taking into consideration that
there are buffers that are not associated with a file -- like a dired
buffer.

Attached patch fixes this.

HTH
 -- David

--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com

[-- Attachment #1.1.2: 0001-Avoid-trying-to-run-org-git-store-link-on-buffers-th.patch --]
[-- Type: application/octet-stream, Size: 1099 bytes --]

From 9fff5ad35933a82a85138d58bf2c25a2a679dec4 Mon Sep 17 00:00:00 2001
From: David Maus <maus.david@gmail.com>
Date: Sat, 20 Feb 2010 19:37:20 +0100
Subject: [PATCH] Avoid trying to run `org-git-store-link' on buffers that do not operate on a file.

---
 contrib/lisp/org-git-link.el |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/org-git-link.el b/contrib/lisp/org-git-link.el
index 6fc7742..4596e41 100644
--- a/contrib/lisp/org-git-link.el
+++ b/contrib/lisp/org-git-link.el
@@ -175,11 +175,12 @@
 
 (defun org-git-store-link ()
   "Store git link to current file."
-  (let ((file (abbreviate-file-name (buffer-file-name))))
-    (when (org-git-gitrepos-p file)
-      (org-store-link-props
-       :type "git"
-       :link (org-git-create-git-link file)))))
+  (when (buffer-file-name)
+    (let ((file (abbreviate-file-name (buffer-file-name))))
+      (when (org-git-gitrepos-p file)
+	(org-store-link-props
+	 :type "git"
+	 :link (org-git-create-git-link file))))))
 
 (add-hook 'org-store-link-functions 'org-git-store-link)
 
-- 
1.6.6.1


[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-02-20 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-20 16:03 Git Store Link Broken? Daniel E. Doherty
2010-02-20 18:48 ` David Maus [this message]
2010-02-20 19:34   ` Carsten Dominik

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=87r5of4uby.wl%maus.david@gmail.com \
    --to=maus.david@gmail.com \
    --cc=ded-law@ddoherty.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=reimar.finken@gmx.de \
    /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).