emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: Re: from dired to an org file with list of files with links
Date: Fri, 11 Dec 2020 09:09:50 +0100	[thread overview]
Message-ID: <87o8j069wx.fsf@mat.ucm.es> (raw)
In-Reply-To: X9KNUccKUNiqgCJt@protected.rcdrun.com

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

> 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 #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

  reply	other threads:[~2020-12-11  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 19:44 from dired to an org file with list of files with links Uwe Brauer
2020-12-10 20:36 ` [one pkf found] (was: from dired to an org file with list of files with links) Uwe Brauer
2020-12-10 21:04 ` from dired to an org file with list of files with links Jean Louis
2020-12-11  8:09   ` Uwe Brauer [this message]
2020-12-11 16:14     ` TRS-80
2020-12-13 15:46       ` Jean Louis

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:

  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=87o8j069wx.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \


* 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


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