emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Git Store Link Broken?
@ 2010-02-20 16:03 Daniel E. Doherty
  2010-02-20 18:48 ` David Maus
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel E. Doherty @ 2010-02-20 16:03 UTC (permalink / raw)
  To: Org Mode


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:

##################################################
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^/tmp_mnt/" nil)
  abbreviate-file-name(nil)
  org-git-store-link()
  run-hook-with-args-until-success(org-git-store-link)
  org-store-link(nil)
  call-interactively(org-store-link nil nil)
##################################################

It looks like something is going wrong when it enters
org-git-store-link, even though it is not a git link that I'm storing.
From what I can tell from the lisp code (I'm no lisper), it looks like
it cycles trhough all the link types until one succeeds.  Mine always
chokes on the org-git-store-link.

Is anyone else having this problem, or do I perhaps have something
configured badly?

By the way, Org-mode is fantastic.
-- 

====================================================
Daniel E. Doherty
7300 W. 110th Street, Suite 930
Overland Park, KS 66210
913.338.7182 (Phone)
913,338.7164 (FAX)

Up the airy mountain,
Down the rushy glen,
We daren't go a-hunting,
For fear of little men.
          --- William Allingham (Donegal, Ireland)

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

* Re: Git Store Link Broken?
  2010-02-20 16:03 Git Store Link Broken? Daniel E. Doherty
@ 2010-02-20 18:48 ` David Maus
  2010-02-20 19:34   ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: David Maus @ 2010-02-20 18:48 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: reimar.finken, Org Mode


[-- 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

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

* Re: Git Store Link Broken?
  2010-02-20 18:48 ` David Maus
@ 2010-02-20 19:34   ` Carsten Dominik
  0 siblings, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-02-20 19:34 UTC (permalink / raw)
  To: David Maus; +Cc: Org Mode, Daniel E. Doherty, reimar.finken

Applied, thanks.

- Carsten

On Feb 20, 2010, at 7:48 PM, David Maus wrote:

> 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
> <0001-Avoid-trying-to-run-org-git-store-link-on-buffers- 
> th.patch>_______________________________________________
> 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

- Carsten

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

end of thread, other threads:[~2010-02-20 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-20 16:03 Git Store Link Broken? Daniel E. Doherty
2010-02-20 18:48 ` David Maus
2010-02-20 19:34   ` Carsten Dominik

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