Re: Properly handle defaults in org-set-property

2023-02-03 Thread Ihor Radchenko
Janek F  writes:

> 1. Put the cursor on a heading that does not have an id
> 2. Invoke (org-set-property "ID" (org-read-property-value "ID" nil 
> "default-value")) via keybind or Alt-:
> 3. default-value is not within the list of suggestions

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0522c1850

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Properly handle defaults in org-set-property

2023-02-02 Thread Janek F
1. Put the cursor on a heading that does not have an id
2. Invoke (org-set-property "ID" (org-read-property-value "ID" nil 
"default-value")) via keybind or Alt-:
3. default-value is not within the list of suggestions

~ Janek


--- Original Message ---
Ihor Radchenko  schrieb am Donnerstag, 2. Februar 2023 um 
12:14:


> Janek F xer...@pm.me writes:
> 
> > That is exactly what I use, as you can see in my dotfiles:
> > https://code.ftt.gmbh/janek/dotfiles/src/branch/main/.config/doom/config.el#L293
> > 
> > But it leads to the exact aforementioned problem...
> 
> 
> May you please elaborate? What exactly did you do? What did you expect
> to happen? What actually happened? (See
> https://orgmode.org/manual/Feedback.html#Feedback)
> 
> 
> --
> 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



Re: Properly handle defaults in org-set-property

2023-02-02 Thread Ihor Radchenko
Janek F  writes:

> That is exactly what I use, as you can see in my dotfiles:
> https://code.ftt.gmbh/janek/dotfiles/src/branch/main/.config/doom/config.el#L293
>
> But it leads to the exact aforementioned problem...

May you please elaborate? What exactly did you do? What did you expect
to happen? What actually happened? (See
https://orgmode.org/manual/Feedback.html#Feedback)


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Properly handle defaults in org-set-property

2023-02-01 Thread Janek F
That is exactly what I use, as you can see in my dotfiles:
https://code.ftt.gmbh/janek/dotfiles/src/branch/main/.config/doom/config.el#L293

But it leads to the exact aforementioned problem...


--- Original Message ---
Ihor Radchenko  schrieb am Dienstag, 20. September 2022 um 
10:10:


> Janek F xer...@pm.me writes:
> 
> > As discussed in 
> > https://emacs.stackexchange.com/questions/71774/pass-default-value-to-org-set-property/71777,
> >  providing a default to org-set-property does not always work.
> > 
> > It calls `org-read-property-value`, which only uses the supplied default 
> > value if it can compute a list of allowed values for the property. But 
> > then, the default value has to be part of that `_ALL` list.
> > 
> > Can this be changed so it always uses the given default?
> 
> 
> Why don't you just use
> 
> (map! :desc "Set ID property" "lI"
> '(lambda ()
> (interactive)
> (org-set-property "ID" (org-read-property-value "ID" nil "default-value"
> 
> ?
> 
> --
> Ihor Radchenko,
> 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



Re: Properly handle defaults in org-set-property

2022-09-20 Thread Ihor Radchenko
Janek F  writes:

> As discussed in 
> https://emacs.stackexchange.com/questions/71774/pass-default-value-to-org-set-property/71777,
>  providing a default to org-set-property does not always work.
>
> It calls `org-read-property-value`, which only uses the supplied default 
> value if it can compute a list of allowed values for the property. But then, 
> the default value has to be part of that `_ALL` list.
>
> Can this be changed so it always uses the given default?

Why don't you just use

(map! :desc "Set ID property" "lI"
  '(lambda ()
 (interactive)
 (org-set-property "ID" (org-read-property-value "ID" nil 
"default-value"

?

-- 
Ihor Radchenko,
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



Properly handle defaults in org-set-property

2022-09-16 Thread Janek F
As discussed in 
https://emacs.stackexchange.com/questions/71774/pass-default-value-to-org-set-property/71777,
 providing a default to org-set-property does not always work.

It calls `org-read-property-value`, which only uses the supplied default value 
if it can compute a list of allowed values for the property. But then, the 
default value has to be part of that `_ALL` list.

Can this be changed so it always uses the given default?


Thanks everyone for the great work!
~ Janek