emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Org-attach risks
@ 2024-03-17 20:22 Kepa
  2024-03-20 12:20 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Kepa @ 2024-03-17 20:22 UTC (permalink / raw)
  To: Ihor Radchenko, emacs-orgmode

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

> Kepa<gnu.cognition199@slmails.com>  writes:
>
> >/Each time I change the DIR property for attachments, I have to answer /
> >/correctly two questions: if I want to move every file to the new 
> path, and if /
> >/I want to delete the old folder./
> >
> >/Is it possible to not receive these questions?/
> >/For me, it's a big risk I don't want to take every time./
>
> May you elaborate on what other behavior you would prefer to see?
>
> -- 
> Ihor Radchenko // yantar92,
Hi Ihor.

It would be enough to have the option to not having those prompt.

If I could set it to don't offer to copy files, and the option to don't 
offer to delete old folder, it would be enough.

Best regards,

Kepa



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

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

* Re: Org-attach risks
  2024-03-17 20:22 Org-attach risks Kepa
@ 2024-03-20 12:20 ` Ihor Radchenko
       [not found]   ` <171096963729.7.13315176883660452357.290626130@slmails.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2024-03-20 12:20 UTC (permalink / raw)
  To: Kepa; +Cc: emacs-orgmode

Kepa <gnu.cognition199@slmails.com> writes:

> It would be enough to have the option to not having those prompt.
>
> If I could set it to don't offer to copy files, and the option to don't 
> offer to delete old folder, it would be enough.

Would you be interested to submit a patch?
See https://orgmode.org/worg/org-contribute.html

-- 
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] 5+ messages in thread

* [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
  2024-03-25  9:01       ` [FR] Add whitespace option for :noweb-prefix Chen Mingzheng
  0 siblings, 1 reply; 5+ 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] 5+ messages in thread

* [FR] Add whitespace option for :noweb-prefix
  2024-03-21 13:25     ` [FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks) Ihor Radchenko
@ 2024-03-25  9:01       ` Chen Mingzheng
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Mingzheng @ 2024-03-25  9:01 UTC (permalink / raw)
  To: emacs-orgmode


Hi


For :noweb-prefix of noweb feature, now we have "yes" or "no" option.
Can we add a new "whitespace" option so that we can:

Giving following fragments,
  #+begin_src elisp :noweb-ref varable-bindings
  (a 0)
  (b 1)
  #+end_src

  #+begin_src elisp :noweb-ref do-something
  `(,a ,b)
  #+end_src

we use the "whitespace" option here
  #+name: a-fragment
  #+begin_src elisp :noweb yes :noweb-prefix whitespace
    (let (<<varable-bindings>>)
      <<do-something>>)
  #+end_src

to produce the follow code:
  #+begin_src elisp
  (let ((a 0)
        (b 1))
    `(,a ,b))
  #+end_src


Here is a try:
  #+begin_src elisp :exports results :wrap src elisp
  (org-babel--expand-body (org-babel-lob--src-info "a-fragment"))
  #+end_src
BTW, I'm curious if there's an public API that can output the code expansion of an noweb src block by it's name like above?


Best regards,

Chen


^ permalink raw reply	[flat|nested] 5+ 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; 5+ 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] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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     ` [FR] Add customization for default answers to `org-attach-set/unset-directory' prompt (was: Org-attach risks) Ihor Radchenko
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

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