emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: Patch for links to dired buffers
Date: Tue, 2 Feb 2010 07:22:40 +0100	[thread overview]
Message-ID: <393B69A9-9FC4-4411-B7D5-D914D4C4F3D1@gmail.com> (raw)
In-Reply-To: <13564.1265037804@maps>

Applied, thanks.

- Carsten

On Feb 1, 2010, at 4:23 PM, Stephen Eglen wrote:

> Currently if I do 'C-c l' (org-store-link) on the top line of a dired
> buffer, I get:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>  expand-file-name(nil)
>  (abbreviate-file-name (expand-file-name (dired-get-filename nil t)))
>
> This simple patch suggests that instead of signaling an error, the
> default directory is used.  (I've not removed the trailing / from the
> directory name, as I prefer that on the link name to indicate  
> directory
> - but that can be deleted.)
>
> Thanks, Stephen
>
> 2010-02-01  Stephen Eglen  <stephen@gnu.org>
>
> 	* org.el (org-store-link): For dired buffers, use
> 	default-directory as link name if dired-get-filename returns
> 	nil.
>
> *** /tmp/ediff11782xez	2010-02-01 15:17:48.000000000 +0000
> --- /home/stephen/langs/emacs/elisp-ds/org-mode/lisp/org.el	 
> 2010-02-01 15:17:45.000000000 +0000
> ***************
> *** 7669,7679 ****
>
>       ((eq major-mode 'dired-mode)
>        ;; link to the file in the current line
> !       (setq cpltxt (concat "file:"
> ! 			   (abbreviate-file-name
> ! 			    (expand-file-name
> ! 			     (dired-get-filename nil t))))
> ! 	    link (org-make-link cpltxt)))
>
>       ((and buffer-file-name (org-mode-p))
>        (setq custom-id (ignore-errors (org-entry-get nil  
> "CUSTOM_ID")))
> --- 7669,7682 ----
>
>       ((eq major-mode 'dired-mode)
>        ;; link to the file in the current line
> !       (let ((file (dired-get-filename nil t)))
> ! 	(setq file (if file
> ! 		       (abbreviate-file-name
> ! 			(expand-file-name (dired-get-filename nil t)))
> ! 		     ;; otherwise, no file so use current directory.
> ! 		     default-directory))
> ! 	(setq cpltxt (concat "file:" file)
> ! 	      link (org-make-link cpltxt))))
>
>       ((and buffer-file-name (org-mode-p))
>        (setq custom-id (ignore-errors (org-entry-get nil  
> "CUSTOM_ID")))
>
>
>
>
> _______________________________________________
> 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

      reply	other threads:[~2010-02-02  7:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 15:23 Patch for links to dired buffers Stephen Eglen
2010-02-02  6:22 ` Carsten Dominik [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:
  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=393B69A9-9FC4-4411-B7D5-D914D4C4F3D1@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=S.J.Eglen@damtp.cam.ac.uk \
    --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).