emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Raoul Comninos <revrari@mweb.co.za>
Cc: emacs-orgmode@gnu.org
Subject: Re: Feature request
Date: Sun, 17 Jan 2021 17:01:53 +0800	[thread overview]
Message-ID: <87sg70vsvy.fsf@localhost> (raw)
In-Reply-To: <86im7w3ro6.fsf@mweb.co.za>

Raoul Comninos <revrari@mweb.co.za> 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



  reply	other threads:[~2021-01-17  8:58 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 17:01 Raoul Comninos
2021-01-17  5:30 ` Ihor Radchenko
2021-01-17  5:33   ` Raoul Comninos
2021-01-17  6:12     ` Ihor Radchenko
2021-01-17  6:18       ` Ihor Radchenko
2021-01-17  8:15         ` Raoul Comninos
2021-01-17  9:01           ` Ihor Radchenko [this message]
2021-01-17  9:20             ` Raoul Comninos
2021-01-18  2:17               ` Ihor Radchenko
2021-01-18  8:19                 ` Detlef Steuer
2021-01-18  1:46             ` Raoul Comninos
2021-01-18  2:19               ` Ihor Radchenko
2021-01-17  5:31 ` Ihor Radchenko
  -- strict thread matches above, loose matches on Subject: below --
2013-06-25 15:22 feature request 42 147
2013-06-25 16:11 ` Christian Moe
2013-06-25 16:29   ` François Pinard
2013-06-25 18:31     ` Michael Brand
2011-07-18 21:36 Jude DaShiell
2011-07-18 23:13 ` Bastien
2011-07-19 12:10 ` MidLifeXis at PerlMonks
2010-10-10 13:50 Feature request David Abrahams
2010-10-10 15:43 ` Bernt Hansen
2010-10-10 18:03   ` David Abrahams
2010-10-10 16:30 ` Memnon Anon
2010-10-10 18:12 ` Juan Pechiar
2010-10-11  7:21 ` Carsten Dominik
2010-10-11 14:18   ` David Abrahams
2011-01-15 12:13   ` Bastien
2009-03-23  2:14 feature request Robert D. Crawford
2009-03-23  2:44 ` Matthew Lundin
2009-03-23 13:56   ` Robert D. Crawford
2009-03-23 11:24 ` Sebastian Rose
2009-03-24 16:53   ` Robert D. Crawford
2009-03-25 13:50     ` Charles Philip Chan
2009-03-25 14:51       ` Robert D. Crawford
2009-03-26  4:09 ` Carsten Dominik
2009-03-26 16:43   ` Robert D. Crawford
2007-11-18 18:13 Raimund Kohl-Füchsle
2007-11-19  3:14 ` Bastien
2006-09-25 23:58 Feature Request Russell Adams
2006-09-26 12:37 ` Carsten Dominik
2006-09-27 15:09   ` Russell Adams
2007-02-08 16:05     ` Russell Adams
2007-02-08 16:46       ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sg70vsvy.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=revrari@mweb.co.za \
    --subject='Re: Feature request' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).