emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks)
       [not found]   ` <171096963729.7.13315176883660452357.290626130@slmails.com>
@ 2024-03-21 13:25     ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-03-21 13:25 UTC (permalink / raw)
  To: Kepa; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks)
@ 2024-03-30 12:09 Kepa
  0 siblings, 0 replies; 2+ messages in thread
From: Kepa @ 2024-03-30 12:09 UTC (permalink / raw)
  To: Ihor Radchenko, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

Hi Ihor


> 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)
It would solve it. Thanks.

[-- Attachment #2: Type: text/html, Size: 916 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-30 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-30 12:09 [FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks) Kepa
     [not found] <PR3P193MB094240F9BF9D15BCBFC9BAB3D82E2@PR3P193MB0942.EURP193.PROD.OUTLOOK.COM>
2024-03-20 12:20 ` Org-attach risks Ihor Radchenko
     [not found]   ` <171096963729.7.13315176883660452357.290626130@slmails.com>
2024-03-21 13:25     ` [FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks) Ihor Radchenko

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).