[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[FR] Add customization for default answers to `org-attach-set/unset-dire
From: |
Ihor Radchenko |
Subject: |
[FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks) |
Date: |
Thu, 21 Mar 2024 13:25:41 +0000 |
[ Adding Org mailing list back to CC. Please use "Reply all" to keep the
discussion public ]
Kepa <gnu.cognition199@slmails.com> writes:
> I don't know enough to upload a patch, I barely know what is a patch...
No problem. Then, I will turn this discussion into a feature request.
It may be eventually implemented by other interested users.
> I was thinking, and if the default answer is (No) it could work: just
> clicking ENTER ENTER, no file moving or deleting would take place.
> The danger would be if someday the default is (Yes) and people mechanically
> send ENTER ENTER ...
We use yes/no prompt rather than (y/n) for a reason - it is a
destructive file operation.
What we may do instead is the following:
In addition to the sequence of prompts when changing the attachment
directory:
1. Copy over attachments from old attachment directory to new one?
2. Delete old attachment directory?
we can introduce a custom variable `org-attach-move-attachments' with
the following values:
1. 'ask (default) - display the prompts
2. 'move - move the attachments form old to new directory (same as yes,
yes answer)
3. 'copy - copy the attachments, keeping the old directory (yes, no answer)
4. 'keep or nil - keep the attachments in the old directory (no, no answer)
I guess that no, yes answer that would delete the attachments is not
something we want to allow as automatic behavior.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>