emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: from dired to an org file with list of files with links


From: Uwe Brauer
Subject: Re: from dired to an org file with list of files with links
Date: Fri, 11 Dec 2020 09:09:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Dear Uwe,
> * Uwe Brauer <oub@mat.ucm.es> [2020-12-10 22:45]:

> (require 'dired-x)

> (defun dired-to-org-links ()
>   "Generates Org links for Dired files and stores in memory. Yank
> it in other buffer"
>   (interactive)
>   (let* ((files (dired-get-marked-files)))
>     (when files
>       (kill-new
>        (with-temp-buffer
>        (dolist (file files)
>          (let* ((base (file-name-nondirectory file))
>                 (link (format "[[file:%s][%s]]\n" file base)))
>            (insert link)))
>        (buffer-string))))))

Thanks, that is very nice. 
I played a bit around with org-fstree, that is also useful.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]