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 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:
  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=87o8j069wx.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: from dired to an org file with list of files with links' \
    /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

Code repositories for project(s) associated with this 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).