emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Error on store-link in Normal File
@ 2010-05-07 16:06 Daniel E. Doherty
  2010-05-08 10:42 ` Carsten Dominik
  2010-05-08 14:23 ` David Maus
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel E. Doherty @ 2010-05-07 16:06 UTC (permalink / raw)
  To: Org-mode List


All,

In doing a C-c l in a normal .tex file, I get an error, similar to one I
was getting earlier in dired.  The dired error is fixed, but I just
noticed today that I get a similar error when trying to store a link
within an buffer for an open file.

Here is the trace:

,----
| Debugger entered--Lisp error: (wrong-type-argument stringp nil)
|   directory-file-name(nil)
|   (file-name-directory (directory-file-name dirpath))
|   (let ((dirname ...) (basename ...)) (list dirname basename))
|   org-git-split-dirpath(nil)
|   (let ((dirlist ...)) (when (string= ... "") (throw ... nil)) (setq dir (first dirlist) relpath (concat ... relpath)))
|   (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq dir ... relpath ...)))
|   (catch (quote toplevel) (while (not ...) (let ... ... ...)) (list (expand-file-name ".git" dir) relpath))
|   (let ((dir ...) (relpath ...)) (catch (quote toplevel) (while ... ...) (list ... relpath)))
|   org-git-gitrepos-p("~/tmfiles/Aegis Fire Protection/SunflowerFundingLLC/Petition.tex")
|   (if (org-git-gitrepos-p file) (progn (org-store-link-props :type "git" :link ...)))
|   (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file)))
|   (let ((file ...)) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link ...)))
|   (progn (let (...) (when ... ...)))
|   (if (buffer-file-name) (progn (let ... ...)))
|   (when (buffer-file-name) (let (...) (when ... ...)))
|   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)
`----

Regards,
-- 
===============================================
,----[ Law Offices ]               
| Daniel E. Doherty                
| 7300 W. 110th Street, Suite 930  
| Overland Park, KS 66210
| 913.338.7182 (Phone)   
| 913,338.7164 (FAX)     
`----                    
================================================

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

* Re: Error on store-link in Normal File
  2010-05-07 16:06 Error on store-link in Normal File Daniel E. Doherty
@ 2010-05-08 10:42 ` Carsten Dominik
  2010-05-08 14:23 ` David Maus
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-05-08 10:42 UTC (permalink / raw)
  To: Daniel E. Doherty, reimar.finken; +Cc: Org-mode List

Hi,

this appears to be a bug in org-git-link.el, please get in touch with

Reimar Finken <reimar.finken@gmx.de>

- Carsten

On May 7, 2010, at 6:06 PM, Daniel E. Doherty wrote:

>
> All,
>
> In doing a C-c l in a normal .tex file, I get an error, similar to  
> one I
> was getting earlier in dired.  The dired error is fixed, but I just
> noticed today that I get a similar error when trying to store a link
> within an buffer for an open file.
>
> Here is the trace:
>
> ,----
> | Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> |   directory-file-name(nil)
> |   (file-name-directory (directory-file-name dirpath))
> |   (let ((dirname ...) (basename ...)) (list dirname basename))
> |   org-git-split-dirpath(nil)
> |   (let ((dirlist ...)) (when (string= ... "") (throw ... nil))  
> (setq dir (first dirlist) relpath (concat ... relpath)))
> |   (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq  
> dir ... relpath ...)))
> |   (catch (quote toplevel) (while (not ...) (let ... ... ...))  
> (list (expand-file-name ".git" dir) relpath))
> |   (let ((dir ...) (relpath ...)) (catch (quote toplevel)  
> (while ... ...) (list ... relpath)))
> |   org-git-gitrepos-p("~/tmfiles/Aegis Fire Protection/ 
> SunflowerFundingLLC/Petition.tex")
> |   (if (org-git-gitrepos-p file) (progn (org-store-link-props :type  
> "git" :link ...)))
> |   (when (org-git-gitrepos-p file) (org-store-link-props :type  
> "git" :link (org-git-create-git-link file)))
> |   (let ((file ...)) (when (org-git-gitrepos-p file) (org-store- 
> link-props :type "git" :link ...)))
> |   (progn (let (...) (when ... ...)))
> |   (if (buffer-file-name) (progn (let ... ...)))
> |   (when (buffer-file-name) (let (...) (when ... ...)))
> |   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)
> `----
>
> Regards,
> -- 
> ===============================================
> ,----[ Law Offices ]
> | Daniel E. Doherty
> | 7300 W. 110th Street, Suite 930
> | Overland Park, KS 66210
> | 913.338.7182 (Phone)
> | 913,338.7164 (FAX)
> `----
> ================================================
>
>
> _______________________________________________
> 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

* Re: Error on store-link in Normal File
  2010-05-07 16:06 Error on store-link in Normal File Daniel E. Doherty
  2010-05-08 10:42 ` Carsten Dominik
@ 2010-05-08 14:23 ` David Maus
  1 sibling, 0 replies; 3+ messages in thread
From: David Maus @ 2010-05-08 14:23 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: reimar.finken, Org-mode List


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

Daniel E. Doherty wrote:

>All,

>In doing a C-c l in a normal .tex file, I get an error, similar to one I
>was getting earlier in dired.  The dired error is fixed, but I just
>noticed today that I get a similar error when trying to store a link
>within an buffer for an open file.

Attached patch should fix that: The problem was that org-git-link
abbreviates the file name and searches for a .git directory not
considering that calling `file-name-directory' for the abbreviation of
the home directory ("~") returns nil.

HTH
 -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.1.2: org-git-link-fix.diff --]
[-- Type: application/octet-stream, Size: 1056 bytes --]

diff --git a/contrib/lisp/org-git-link.el b/contrib/lisp/org-git-link.el
index 4596e41..195bf9b 100644
--- a/contrib/lisp/org-git-link.el
+++ b/contrib/lisp/org-git-link.el
@@ -96,7 +96,7 @@
   (let* ((strlist (org-git-split-string str))
          (filepath (first strlist))
          (commit (second strlist))
-         (dirlist (org-git-find-gitdir filepath))
+         (dirlist (org-git-find-gitdir (file-truename filepath)))
          (gitdir (first dirlist))
          (relpath (second dirlist)))
     (org-git-open-file-internal gitdir (concat commit ":" relpath))))
@@ -168,7 +168,7 @@
 (defun org-git-create-git-link (file)
   "Create git link part to file at specific time"
   (interactive "FFile: ")
-  (let* ((gitdir (first (org-git-find-gitdir file)))
+  (let* ((gitdir (first (org-git-find-gitdir (file-truename file))))
          (branchname (org-git-get-current-branch gitdir))
          (timestring (format-time-string "%Y-%m-%d" (current-time))))
     (org-make-link "git:" file "::" (org-git-create-searchstring branchname timestring))))

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

end of thread, other threads:[~2010-05-08 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07 16:06 Error on store-link in Normal File Daniel E. Doherty
2010-05-08 10:42 ` Carsten Dominik
2010-05-08 14:23 ` David Maus

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