From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id gJGJFNZR1l8IBQAA0tVLHw (envelope-from ) for ; Sun, 13 Dec 2020 17:39:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KCxaENZR1l/9RwAAB5/wlQ (envelope-from ) for ; Sun, 13 Dec 2020 17:39:34 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A64819403E8 for ; Sun, 13 Dec 2020 17:39:33 +0000 (UTC) Received: from localhost ([::1]:60484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koVLI-0002tf-Gh for larch@yhetil.org; Sun, 13 Dec 2020 12:39:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koVIp-0008Ev-Q9 for emacs-orgmode@gnu.org; Sun, 13 Dec 2020 12:36:59 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]:47057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koVIm-0002k7-QA for emacs-orgmode@gnu.org; Sun, 13 Dec 2020 12:36:59 -0500 Received: from localhost ([::ffff:197.157.34.185]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000308F4.000000005FD65137.00004E39; Sun, 13 Dec 2020 10:36:55 -0700 Date: Sun, 13 Dec 2020 18:46:40 +0300 From: Jean Louis To: TRS-80 Subject: Re: from dired to an org file with list of files with links Message-ID: References: <877dpp78fy.fsf@mat.ucm.es> <87o8j069wx.fsf@mat.ucm.es> <187b91011b02ac8bf039accd9905423b@isnotmyreal.name> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <187b91011b02ac8bf039accd9905423b@isnotmyreal.name> User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: A64819403E8 X-Spam-Score: -1.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: HEGly3ICgsPT * TRS-80 [2020-12-11 19:21]: > On 2020-12-11 03:09, Uwe Brauer wrote: > > > Dear Uwe, > > > * Uwe Brauer [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. > > Indeed, nice function! > > And what great and fast service! :) > > If I may be permitted to pick a nit; Uwe, you may want to prefix the > function with `my-` or `uwe-` or your initials, etc. for namespace > reasons. Unless of course this is something Jean Louis is planning on > submitting as a patch to dired itself... ;) It is more Org related. In my opinion all built-in Org hyperlink types should be already integrated in Org, probably also this is integrated. The org-store-link actually works in Dired. The org-insert-last-link works to put link into buffer So it is just iteration missing.