From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Sp7oI24awGBFjQAAgWs5BA (envelope-from ) for ; Wed, 09 Jun 2021 03:33:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QKjBHm4awGAJMwAAB5/wlQ (envelope-from ) for ; Wed, 09 Jun 2021 01:33: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 CD35923B9C for ; Wed, 9 Jun 2021 03:33:33 +0200 (CEST) Received: from localhost ([::1]:53326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqn63-0007Wp-LQ for larch@yhetil.org; Tue, 08 Jun 2021 21:33:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqn5Y-0007WV-U1 for emacs-orgmode@gnu.org; Tue, 08 Jun 2021 21:33:01 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:34495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqn5V-0001NX-Qk for emacs-orgmode@gnu.org; Tue, 08 Jun 2021 21:33:00 -0400 Received: by mail-lj1-x229.google.com with SMTP id bn21so29538236ljb.1 for ; Tue, 08 Jun 2021 18:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:cc:date:message-id :mime-version; bh=VNv/rILdVxRwy+pxgn0HgycK93Z2/pdfUmUTV5Nemgg=; b=PRboGfHYF5Cnp0tRpkU8VejuFPMAp9YboS9k207Hk0COinBLeTLrjTJKR4dXyJ66rS gGQdfYPD2RWpBWUVSZQmACSdw5Xogzhc8GgxlEf98C3t4yQNgwVYQQl9NJeIfpoWUZF6 jZ0wP8iExuDtKubayQ264VtJ1CX8UZ2PSuI7o1HIQRZl32ajX04orWv9wI53lsxl8Q4u +UP17W99xO3c3dAY6OhjNgHxscjOwtvxPDcNadnvbKjHBCT1kKlUli4ipXDTOGwM9b9B AdM4giyhtpwjySFSpeL3QWNGLpe9L8ljPqqapHQ98nyNDW7Aq1fLSg+xqsPQ/dV50PbD BEyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:cc:date :message-id:mime-version; bh=VNv/rILdVxRwy+pxgn0HgycK93Z2/pdfUmUTV5Nemgg=; b=BdcglMGtz76G8W/KjJnClk3yhtrvqEmf9PI1u5hram3cv5+t3kYF7poziQoD14vrbV VFB758sg5ESOpPrRIDOoX5tT+Et+IRCLPuJjUdYmXOQCNyBB+AJXG8/paIrpSLtpoM5X egm37JFBJJooYzhuyWUJN4cR88CLnM3zCMqu7Y416q84+leRWjUlB66tK3qsnFyJt36R Flq+UM9TSva/pJLIRpxx2AGbYCKH9GbPG6+TzX2vOgOM/m5YVyxarBedGVbMONG2woev FQlzBL+xiZePNPjX2Hn6XYhW0GePY3U+lt6oz2r/I9qxBN7yF5zXiPhga6sKZg4inxGc 0HfQ== X-Gm-Message-State: AOAM5337HXoX6/V5pjFPos/d0GGs9vrQ5jSixko6rH9wqQx/TjXzwOOZ FVv3JvfZMxR1YKaB1YE3gsw= X-Google-Smtp-Source: ABdhPJy5shFFHz5TIi1uXJuQKkQPV1+og4OCtZnkVUlKGo70REZfvGIj2QSCpavp8cC68mF8plfhSA== X-Received: by 2002:a2e:9bd3:: with SMTP id w19mr3383354ljj.381.1623202375859; Tue, 08 Jun 2021 18:32:55 -0700 (PDT) Received: from localhost ([91.210.107.197]) by smtp.gmail.com with ESMTPSA id x8sm158500lfn.186.2021.06.08.18.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 18:32:55 -0700 (PDT) From: Ihor Radchenko To: John Kitchin Subject: Re: org-attach a directory? In-Reply-To: References: Date: Wed, 09 Jun 2021 09:38:49 +0800 Message-ID: <87im2nn7fa.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=yantar92@gmail.com; helo=mail-lj1-x229.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623202414; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=VNv/rILdVxRwy+pxgn0HgycK93Z2/pdfUmUTV5Nemgg=; b=NjQFAr/RvSXNLNLCWPTlFMsVK9V4bWdIcZamuRkPknYDF1tFlfk96Rm8ET4f43i96E3YUz vj4IJS3Pd9mVM23RdTbQODDjsIZCfTpHNlPWh+TRtu1ERNKMvH6d8Lxm0kPFZLgRWsqMm5 BhVClbZ2QROHKUdM6Ac1sAZ1k0DhLFHcwKRt9Z1qvtyl9z7nFQeorDun2qgviAwTFD6Tmj UVz9GVaYNkvapcjVfLDjpm9Ia0IWm4VgHJCyqLC9uoX5fenS5a3We8TzlJdD4Wf0A/J5yP xvDHAGEOaLoZeAKyUmfkAQW8GC0sonVXzkSDGA1HKhhuobQrU8uqPTGtpXtk5g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623202414; a=rsa-sha256; cv=none; b=GwQl418rOE1hboQzlyAC1PY5XNP+768DDcZzuML1wKRd0JsKbtsI6c9fwHA40QN7WG8XK/ EDk65gmB64ZwRCEZZx0l3ykkVTJUwiP0/LuQZqo4klvXO21f/w/pNtqOsC1mOSp9ZpTsnA vAni1Dt2NugBFxTbjd1mAQEWL0Rdd5pHJVA5Nwo/psP8XFnUjL2SEsCx82bN/WD7fu83b+ BXASmLZDiYlr4sCXR+fh6trXWu3rQL9de2v/8a77RC3FnHLHc1uFUdS7pYSABjzlYCOqkG deEJ1oOkd6MdK5Jq72OKO3DxaxfpZXjfMbMTSO8OMDrQ9+aX4wWZx+0xfxjUfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=PRboGfHY; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -1.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=PRboGfHY; dmarc=pass (policy=none) header.from=gmail.com; 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: CD35923B9C X-Spam-Score: -1.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: UvhUjduTVluE John Kitchin writes: > Is it possible to attach a directory to an org heading? > > I have only seen how to attach a file so far. I use the code below to attach directories and allow multiple selection while attaching files. Also, if more people are interested in this kind of functionality, I can write a simple patch. It's just a matter of applying #'directory-file-name to the selected file name in the interactive spec of the org-attach-attach. (defvar yant/org-attach-default-source "~/Downloads/" "Default directory to attach the files from.") (define-advice org-attach-attach (:around (oldfun files &rest args) start-from-default-directory) "Look for new attachments from `yant/org-attach-default-source' directory instead of `default-directory'." (interactive (list (mapcar #'directory-file-name (helm-read-file-name "File to keep as an attachment:" :initial-input (or (progn (require 'dired-aux) (dired-dwim-target-directory)) (and yant/org-attach-default-source (f-slash yant/org-attach-default-source)) default-directory) :marked-candidates t)) current-prefix-arg nil)) (unless (listp files) (setq files (list files))) (mapc (lambda (file) (apply oldfun file args)) files)) Best, Ihor