emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Kepa <gnu.cognition199@slmails.com>
Cc: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87a5mrlnsa.fsf@localhost> (raw)
In-Reply-To: <171096963729.7.13315176883660452357.290626130@slmails.com>

[ 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>


  parent reply	other threads:[~2024-03-21 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-17 20:22 Org-attach risks Kepa
2024-03-20 12:20 ` Ihor Radchenko
     [not found]   ` <171096963729.7.13315176883660452357.290626130@slmails.com>
2024-03-21 13:25     ` Ihor Radchenko [this message]
2024-03-25  9:01       ` [FR] Add whitespace option for :noweb-prefix Chen Mingzheng
  -- strict thread matches above, loose matches on Subject: below --
2024-03-30 12:09 [FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks) Kepa

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=87a5mrlnsa.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=gnu.cognition199@slmails.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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 read-only IMAP folder(s) and NNTP newsgroup(s).