From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SJxPA5ToBGDNeQAA0tVLHw (envelope-from ) for ; Mon, 18 Jan 2021 01:47:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qOqWOpPoBGCQcwAAbx9fmQ (envelope-from ) for ; Mon, 18 Jan 2021 01:46: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 52E2F94043B for ; Mon, 18 Jan 2021 01:46:59 +0000 (UTC) Received: from localhost ([::1]:46238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1JdA-00078G-Th for larch@yhetil.org; Sun, 17 Jan 2021 20:46:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Jcg-00076u-IE for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 20:46:26 -0500 Received: from securemail-y36.synaq.com ([196.35.198.58]:55148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Jcd-00008m-0K for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 20:46:26 -0500 Received: from [197.95.154.214] (helo=DESKTOP-0T0U162) by securemail-pl-omx6.synaq.com with esmtps (TLS1.2) tls TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93.0.4-30-5edf9c7) (envelope-from ) id 1l1JcT-0007qs-DY; Mon, 18 Jan 2021 03:46:13 +0200 From: Raoul Comninos To: Ihor Radchenko Subject: Re: Feature request In-Reply-To: <87sg70vsvy.fsf@localhost> (message from Ihor Radchenko on Sun, 17 Jan 2021 17:01:53 +0800) Date: Mon, 18 Jan 2021 03:46:01 +0200 Message-ID: <86k0sbm2zq.fsf@mweb.co.za> MIME-Version: 1.0 Content-Type: text/plain X-SYNAQ-Pinpoint-Information: Please contact SYNAQ for more information X-SYNAQ-Pinpoint-ID: 1l1JcT-0007qs-DY X-SYNAQ-Pinpoint: Found to be clean X-SYNAQ-Pinpoint-SpamCheck: not spam, SpamAssassin (not cached, score=0.202, required 7, autolearn=disabled, FSL_HELO_NON_FQDN_1 0.00, HELO_NO_DOMAIN 0.00, RDNS_NONE 0.10, SPF_SOFTFAIL 0.10) X-Pinpoint-From: revrari@mweb.co.za Received-SPF: pass client-ip=196.35.198.58; envelope-from=revrari@mweb.co.za; helo=securemail-y36.synaq.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, 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: 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: -2.26 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=mweb.co.za (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: 52E2F94043B X-Spam-Score: -2.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: KnKUKWND8SeZ Ihor Radchenko writes: > Raoul Comninos writes: > >> I have copied the code to my dot Emacs, but now when I try to add an attachment now, it generates this error: >> >> run-hook-with-args: Wrong number of arguments: (lambda nil "Save list of >> attachments to ORG_ATTACH_FILES property." (when-let* ((dir >> (org-attach-dir)) (files (org-attach-file-list dir))) (org-set-property >> "ORG_ATTACH_FILES" (mapconcat #'identity files ", ")))), 1 >> >> Can you help me with this? > > You can try: > > (defun org-attach-save-file-list-to-property (dir) > "Save list of attachments to ORG_ATTACH_FILES property." > (when-let* ((files (org-attach-file-list dir))) > (org-set-property "ORG_ATTACH_FILES" (mapconcat #'identity files ", ")))) > (add-hook 'org-attach-after-change-hook #'org-attach-save-file-list-to-property) > > Also, note that the list of files will only be updated if you > attach/delete files calling org-attach. If you change the attachment > folder manually, you will need to run M-x org-attach-sync. > > Best, > Ihor With your permission can I post your solution to stack-exchange, crediting you? Kindest regards, Raoul Comninos