From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id BcwcKotRwWCBcwEAgWs5BA (envelope-from ) for ; Thu, 10 Jun 2021 01:40:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kLp8JItRwWAJRwAAbx9fmQ (envelope-from ) for ; Wed, 09 Jun 2021 23:40:59 +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 74E6E18189 for ; Thu, 10 Jun 2021 01:40:58 +0200 (CEST) Received: from localhost ([::1]:46198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr7oe-00038i-Ad for larch@yhetil.org; Wed, 09 Jun 2021 19:40:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr7nO-0002ZL-77 for emacs-orgmode@gnu.org; Wed, 09 Jun 2021 19:39:40 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:36816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lr7nL-0008AW-Kf for emacs-orgmode@gnu.org; Wed, 09 Jun 2021 19:39:37 -0400 Received: by mail-wr1-x433.google.com with SMTP id e11so17099198wrg.3 for ; Wed, 09 Jun 2021 16:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sJKXkv68/ke1Zta4+jqYijiZrzpYnRsih3U21jGwwdE=; b=mtzcZFUWec70bahzgolucbK50JlUenELOtUKcnSa3KCcwSB8BYuNnYsMdnOyFu0JYQ FOG7gXYjs20T4Cvr/q0GgUVJwcSaMdCukVoWFRXs75+0OehRWuKHqM5nVPGaJAZeCP3p QjljguCLcxl0zzUWQJA1eHmN/mG7nAsaeVqbmVXfPKSifbHnCr/Y3REkdZW/ak7PWLMM WJto7gWbEYfCQ4w+QFWTAWN5GeKZyzo5nXXstAoXV37a74o8jJaBAJhMm+Ji0vp3EyFp f7h+lBPTfExkJSbJx0KRFPeQUmf1my7NfYHs+bB2K0U0V8VcFGmGdRMBlCbsiE+BdbtE 7VEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sJKXkv68/ke1Zta4+jqYijiZrzpYnRsih3U21jGwwdE=; b=m1+7pyrZTgADuUTXWrZI09PJuJ2jAJglYmtbnznkrHDttyfk/RwFfvCEf6ORNLgp4Y t++/Rp+gmiycnkSOM3aUPoqotKeRVXbEHb3Rste3jZRp4pTlqHMQCC5jklT7fnMXEbnr tlPI3P7xVoO+vBRnIfoy8QrCggi+hdEz+NjuqJQaNnt0kDsFXXLESlxbOgu45gtLxd7m vcWuqtmPxGx15Mv7Mm+FVJMFATkv5BBift1ryl+23+gnxALfeA3Im6K01Szs473oEB52 JXBSFl+51Xg6XhC+EnTLQbdQlUiDhHFfoFq2bCUrptFaq5rWjWvyAXiPE9SY2BJULWAg cPvQ== X-Gm-Message-State: AOAM530QgqfxpTkE0T9Q3WqFKcDt3H+Pne4u0WsN029Nd/n3TWfSyRP9 s3EjsKD0N3jOwSmyv5yRQ8YB/Kej5BLq+M/Zc/o= X-Google-Smtp-Source: ABdhPJz1xU/tlTCzjcdOU47KdFioiac52oJWHDC94M0xRFMo+O22xIsCkY0MSiRkX34jDPQWCqocnGsRNlFZT1gmuHk= X-Received: by 2002:adf:ea86:: with SMTP id s6mr2159598wrm.75.1623281972085; Wed, 09 Jun 2021 16:39:32 -0700 (PDT) MIME-Version: 1.0 References: <5a5703fb-943c-4da8-8981-63cac9ef3bae@gmail.com> In-Reply-To: <5a5703fb-943c-4da8-8981-63cac9ef3bae@gmail.com> From: John Kitchin Date: Wed, 9 Jun 2021 19:39:20 -0400 Message-ID: Subject: Re: org-attach a directory? To: Ypo Content-Type: multipart/alternative; boundary="0000000000005104bf05c45dc972" Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=johnrkitchin@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=no 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 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=1623282059; 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=sJKXkv68/ke1Zta4+jqYijiZrzpYnRsih3U21jGwwdE=; b=ciFwVoDBCP55UuBWy5mdJQnqplfVD1IBuJBJ6mDWj29KpvjTgbpvelSFfA9Ul8bN5ZPvhL ZXM6UjdOC4HUZDWRSpjuXJ5rnLV9+1y7tHbDi7+EEcPQSY6r6lsLuszk8xESndbwIvMryJ L+sNRIb8Dv9dnNnqPt1TPoOVPGSvLvbRwv6q1s42OwQj+7SlpvAzA/c/MZXN35abEGaVMn OsOf57z6+qyDnPYldH8/wE757svH5gDXc5tflJFIem8glIiT98RbmnhrmfPEMzBeZTd7DN BgOlcrawienhwf3d9gfM2nil9KSuN+93xqqoSZtGOZgScCAqImoS5GAbLmT7IQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623282059; a=rsa-sha256; cv=none; b=L83BrUF4XY2crPKT7QFPN+VwDz/r+vvWNwAyqiij3DjcPEIh2ZiJC+HTlHhnUtltHH6KhP o1MwxEtDf6O/ZKrwfEJLO/ydpoOKnec450rUlJVYUBor1J1uB8vyLmFKGnVOO+sNJiOiF3 bADC3vOkhqiaxM84NuqQOvkovo+qXmVwY4927V2XSiLlPnDFfdsERL14shXiGlMslvGJ7S sXN/Z/yMPgOf1FaSOpcm19ThvM5OjfZa0DCdKlC4dLzR3UQ7r3HxP/AkrNCADJSeWhnHOT P2/7jatKnjyT7WKxDSTzu77HBF8UWeECXh429zwkYOAJNTdgfOMR606qqFZctA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=mtzcZFUW; 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.53 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=mtzcZFUW; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=andrew.cmu.edu (policy=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: 74E6E18189 X-Spam-Score: -1.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: 52tfu2y/qvIg --0000000000005104bf05c45dc972 Content-Type: text/plain; charset="UTF-8" can you give an example of those commands, I tried the key commands C-c C-a which opens the dispatcher s to set a directory then C-c C-a z to sync, but it did not do anything but add a :DIR: property. it didn't move or copy files anywhere. Here is the code I am currently using that basically does what I want. (defun scimax-org-attach-attach-directory-cp (dir) "Copy DIR as an attachment to the current heading." (interactive "DDir: ") (copy-directory dir (file-name-as-directory (org-attach-dir 'get-create))) (org-attach-sync) (org-entry-put (point) "ATTACHMENTS" (concat (org-entry-get (point) "ATTACHMENTS") (format " [[attachment:%s]]" (car (last (f-split dir))))))) (defun scimax-org-attach-attach-directory-mv (dir) "Move DIR as an attachment to the current heading." (interactive "DDir: ") (scimax-org-attach-attach-directory-cp dir) (delete-directory dir t t)) John ----------------------------------- Professor John Kitchin (he/him/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Wed, Jun 9, 2021 at 3:35 PM Ypo wrote: > Firstly you set the folder where your files are as attachment DIRectory. > > Then, you set your target attachment DIRectory (always using the > attachment commands). > > After doing this, you will be offered the option to copy and delete all > the files from the former to the target folder. > > Hugs > --0000000000005104bf05c45dc972 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
can you give an example of those commands, I tried the key= commands=C2=A0

C-c C-a which opens the dispatcher
=
s to set a directory
then C-c C-a z to sync, but it did not = do=C2=A0anything but add a :DIR: property. it didn't move or copy files= anywhere.

Here is the code I am currently using t= hat basically does what I want.=C2=A0

(defun scima= x-org-attach-attach-directory-cp (dir)
=C2=A0 "Copy DIR as an attac= hment to the current heading."
=C2=A0 (interactive "DDir: &quo= t;)
=C2=A0 (copy-directory dir (file-name-as-directory (org-attach-dir &= #39;get-create)))
=C2=A0 (org-attach-sync)
=C2=A0 (org-entry-put (poi= nt) "ATTACHMENTS"
(concat
=C2=A0(org-entry-get (point= ) "ATTACHMENTS")
=C2=A0(format " [[attachment:%s]]&quo= t; (car (last (f-split dir)))))))


(defun scimax-org-attach-attac= h-directory-mv (dir)
=C2=A0 "Move DIR as an attachment to the curre= nt heading."
=C2=A0 (interactive "DDir: ")
=C2=A0 (sci= max-org-attach-attach-directory-cp dir)
=C2=A0 (delete-directory dir t t= ))


John
-----------------------------------
Professor John Kitchin (he/him/= his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegi= e Mellon University
Pittsburgh, PA 15213
412-268-7803


On Wed, Jun 9, 2021 at 3:35 PM Ypo <ypuntot@gmail.com> wrote:=
=20 =20
Firstly you set th= e folder where your files are as attachment DIRectory.=20
=20
Then, you set your= target attachment DIRectory (always using the attachment commands).= =20
=20
After doing this, = you will be offered the option to copy and delete all the files from the fo= rmer to the target folder.=20
=20
Hugs=20
=20
--0000000000005104bf05c45dc972--