all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Default value and docstring of org-attach-store-link-p
@ 2020-08-29  4:19 Ihor Radchenko
  2020-09-03 10:33 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2020-08-29  4:19 UTC (permalink / raw)
  To: emacs-orgmode


The default value of org-attach-store-link-p is nil for now.
Would it make more sense to set it to something else (say, 'attach)?
I believe that 'attach or t would be better as a default.

Thoughts?

Also, the docstring does not mention that there may be several different
non-nil values. It is only reflected in the :type field of defcustom.

Best,
Ihor



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

* Re: Default value and docstring of org-attach-store-link-p
  2020-08-29  4:19 Default value and docstring of org-attach-store-link-p Ihor Radchenko
@ 2020-09-03 10:33 ` Bastien
  2020-09-03 13:32   ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2020-09-03 10:33 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi Ihor,

Ihor Radchenko <yantar92@gmail.com> writes:

> The default value of org-attach-store-link-p is nil for now.
> Would it make more sense to set it to something else (say, 'attach)?
> I believe that 'attach or t would be better as a default.
>
> Thoughts?

I don't have a strong opinion here.

Why do you think it would it be a better as a default?

> Also, the docstring does not mention that there may be several different
> non-nil values. It is only reflected in the :type field of defcustom.

Feel free to propose a patch for this and the suggested switch, we can
apply it after Org 9.4.

Best,

-- 
 Bastien


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

* Re: Default value and docstring of org-attach-store-link-p
  2020-09-03 10:33 ` Bastien
@ 2020-09-03 13:32   ` Ihor Radchenko
  2024-01-20 15:21     ` [PATCH] Change the default value of org-attach-store-link-p to 'attached Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2020-09-03 13:32 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

> I don't have a strong opinion here.
>
> Why do you think it would it be a better as a default?

It seems that other people expect it to be default [1]. Also, I am using
org-attach heavily in my workflows. Most of the time I found myself
inserting the link to attachment right after attaching a file. Finally,
it do not see any drawback adding the link to history vs not adding.

I personally would prefer 'attached as a default, but it is mostly
because I use org-attach already and attach: link would be shorter.
Probably, 'file as default is safer if the user changes the :DIR:
property for some reason.

[1] https://www.reddit.com/r/emacs/comments/ihzh9r/orgmode_quicker_way_to_create_link_to_attachment/

> Feel free to propose a patch for this and the suggested switch, we can
> apply it after Org 9.4.

I will add it to my todo list. This should be lower priority than org-fold.el

Best,
Ihor

Bastien <bzg@gnu.org> writes:

> Hi Ihor,
>
> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> The default value of org-attach-store-link-p is nil for now.
>> Would it make more sense to set it to something else (say, 'attach)?
>> I believe that 'attach or t would be better as a default.
>>
>> Thoughts?
>
> I don't have a strong opinion here.
>
> Why do you think it would it be a better as a default?
>
>> Also, the docstring does not mention that there may be several different
>> non-nil values. It is only reflected in the :type field of defcustom.
>
> Feel free to propose a patch for this and the suggested switch, we can
> apply it after Org 9.4.
>
> Best,
>
> -- 
>  Bastien


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

* [PATCH] Change the default value of org-attach-store-link-p to 'attached
  2020-09-03 13:32   ` Ihor Radchenko
@ 2024-01-20 15:21     ` Ihor Radchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-01-20 15:21 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Bastien, emacs-orgmode

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

Ihor Radchenko <yantar92@gmail.com> writes:

>> Feel free to propose a patch for this and the suggested switch, we can
>> apply it after Org 9.4.
>
> I will add it to my todo list. This should be lower priority than org-fold.el

See the attached patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-attach-store-link-p-Change-default-value-to-atta.patch --]
[-- Type: text/x-patch, Size: 1845 bytes --]

From 175937da259fe0b29057d69055bf3469aa1a8679 Mon Sep 17 00:00:00 2001
Message-ID: <175937da259fe0b29057d69055bf3469aa1a8679.1705764051.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Sat, 20 Jan 2024 16:20:20 +0100
Subject: [PATCH] org-attach-store-link-p: Change default value to 'attached

* lisp/org-attach.el (org-attach-store-link-p): Change the default
value.
* etc/ORG-NEWS (The default value of ~org-attach-store-link-p~ is now
~attached~): Announce the change.
---
 etc/ORG-NEWS       | 5 +++++
 lisp/org-attach.el | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 847ddf614..ea456c67b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -371,6 +371,11 @@ The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
 
 The =TEST= parameter is better served by Emacs debugging tools.
 ** New and changed options
+*** The default value of ~org-attach-store-link-p~ is now ~attached~
+
+Now, after attaching a file, =[[attach:...]]= link to the attached file
+is stored.  It can later be inserted using =M-x org-insert-link=.
+
 *** New option ~org-fast-tag-selection-maximum-tags~
 
 You can now limit the total number of tags displayed in the fast tag
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 58bfcf9ba..81ce9a73c 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -142,7 +142,7 @@ (defcustom org-attach-use-inheritance 'selective
 	  (const :tag "Inherit parent node attachments" t)
 	  (const :tag "Respect org-use-property-inheritance" selective)))
 
-(defcustom org-attach-store-link-p nil
+(defcustom org-attach-store-link-p 'attached
   "Non-nil means store a link to a file when attaching it.
 When t, store the link to original file location.
 When `file', store link to the attached file location.
-- 
2.43.0


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


-- 
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 related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-20 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-29  4:19 Default value and docstring of org-attach-store-link-p Ihor Radchenko
2020-09-03 10:33 ` Bastien
2020-09-03 13:32   ` Ihor Radchenko
2024-01-20 15:21     ` [PATCH] Change the default value of org-attach-store-link-p to 'attached Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.