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 YJIZIdOX0l/5SwAA0tVLHw (envelope-from ) for ; Thu, 10 Dec 2020 21:49:07 +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 uBX3HNOX0l+IUQAAB5/wlQ (envelope-from ) for ; Thu, 10 Dec 2020 21:49:07 +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 DEF9D940367 for ; Thu, 10 Dec 2020 21:49:06 +0000 (UTC) Received: from localhost ([::1]:47052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knTo7-0001Mo-MO for larch@yhetil.org; Thu, 10 Dec 2020 16:49:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knTlC-0001Le-3m for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 16:46:02 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]:56757) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knTlA-0007XX-9n for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 16:46:01 -0500 Received: from localhost ([::ffff:41.202.241.31]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E535.000000005FD29717.00005A0A; Thu, 10 Dec 2020 14:45:58 -0700 Date: Fri, 11 Dec 2020 00:04:17 +0300 From: Jean Louis To: emacs-orgmode@gnu.org Subject: Re: from dired to an org file with list of files with links Message-ID: References: <877dpp78fy.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <877dpp78fy.fsf@mat.ucm.es> 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: , 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: DEF9D940367 X-Spam-Score: -1.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: qgyDXhtLWrzR Dear Uwe, * Uwe Brauer [2020-12-10 22:45]: > > Hi > > Suppose via dired I see > > -rw-rw-r-- 1 oub oub 1003 dic 10 18:17 auto-org-md-autoloads.el > -rw-rw-r-- 1 oub oub 2,0K dic 10 18:17 auto-org-md.el > -rw-rw-r-- 1 oub oub 2,3K dic 10 18:17 auto-org-md.elc > -rw-rw-r-- 1 oub oub 486 dic 10 18:17 auto-org-md-pkg.el > > I'd like to create a org file > with lists these files and there links to it > > Like this > > > [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-autoloads.el][outo-org-md-autoloads.el]] > [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]] > [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]] > [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.elc][outo-org-md.elc]] > [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-pkg.elc][outo-org-md-pkg.elc]] > > Anybody know whether such a functionality/package exist? (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))))))