emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request


From: Raoul Comninos
Subject: Re: Feature request
Date: Sun, 17 Jan 2021 11:20:31 +0200

Ihor Radchenko <yantar92@gmail.com> writes:

> 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

It works now and its awesome! I cannot believe that they had this
feature and removed it. I am a very happy man and I cannot thank you enough.

If you have time please add your answer and function to the original
post. I feel others will make use of it too.

https://emacs.stackexchange.com/questions/62761/seeing-file-names-in-todo-entries-when-using-org-attach/62792#62792

Kindest regards,
Raoul Comninos 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]