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



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



Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]

2022-08-12 Thread Janek F
I use org-roam which creates links between org-files using the ID, and I would 
like to be able to manually add such links to common pages even if 
autocompletion doesn't work smoothly.

Considering the other messages, let's not get lost in details, the default 
function does not need to consider all edge cases. It simply should not error 
out on ids in a different format.

--- Original Message ---
Max Nikulin  schrieb am Freitag, 12. August 2022 um 17:35:


> On 21/07/2022 02:12, Janek F wrote:
>
> > However I tend to customize IDs for important files by hand,
> > causing any attempt to use org-attach on that file to fail
> > if the ID is shorter than six characters:
> >
> > org-attach-id-ts-folder-format: Args out of range: "ftt", 0, 6
> >
> > This method should be adjusted to handle non-ts-ids just as well,
> > as org-id-method does not dictate the format of existing ids.
>
>
> There are should be no such restriction for CUSTOM_ID links (referenced
> using #anchor). IDs used for attachments assume particular format and
> consistent layout of files. Janek, could you, please, provide some
> details concerning your use case. I am interested why you decided to
> avoid CUSTOM_ID for headings important to you.
>
> As I wrote yesterday, you can customize Org to use directories for
> attachments you like.



Re: [PATCH] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]

2022-08-02 Thread Janek F
Just now had a closer look at your patch,
and I don't like the hashing.
My whole idea customizing ids is to make the file structure useful by itself, 
too.
This is how I patched it for me:

  (defun xf/org-attach-id-folder-format (id)
"Translate any ID into a folder-path."
(format "%s/%s"
(substring id 0 2)
(if (> (seq-length id) 2) (substring id 2) id))
)
  (setq org-attach-id-to-path-function-list '(xf/org-attach-id-folder-format))


--- Original Message ---
Ihor Radchenko  schrieb am Samstag, 23. Juli 2022 um 07:21:


> Janek F xer...@pm.me writes:
>
> > When setting org-id-method to 'ts or 'org,
> > org-attach seems to use org-attach-id-ts-folder-format
> > to create its hierarchy.
> >
> > However I tend to customize IDs for important files by hand,
> > causing any attempt to use org-attach on that file to fail
> > if the ID is shorter than six characters:
> >
> > org-attach-id-ts-folder-format: Args out of range: "ftt", 0, 6
> >
> > This method should be adjusted to handle non-ts-ids just as well,
> > as org-id-method does not dictate the format of existing ids.
>
>
> Thanks for reporting!
> Tentative patch is attached.
>
> I have added some fallbacks for the default attach folder formatters, so
> that they can work when the ID does not conform to specific format.
>
> This change is somewhat opinionated, so feel free to suggest alternative
> solutions/fallback options.
>
> Best,
> Ihor



image-file-name-regexp: Wrong type argument: characterp

2022-08-02 Thread Janek F
Hello,

I wanted to mark certain filenames as images and added this to my config.el:

(add-to-list 'image-file-name-regexps "/preview/")

But when I run `org-toggle-inline-images` now, I get the following error.

image-file-name-regexp: Wrong type argument: characterp, "/preview/"

Even though it says:
```lisp
image-file-name-regexps is a variable defined in image-file.el.gz.

Value
("/preview/")

Documentation
List of regexps matching image-file filenames.
```And the variable is clearly a list.

As posted in 
[https://emacs.stackexchange.com/questions/72902/image-file-name-regexp-wrong-type-argument-characterp](https://emacs.stackexchange.com/questions/72902/image-file-name-regexp-wrong-type-argument-characterp?noredirect=1#comment118105_72902)

Best,
Janek

[BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]

2022-07-20 Thread Janek F
When setting org-id-method to 'ts or 'org,
org-attach seems to use org-attach-id-ts-folder-format
to create its hierarchy.

However I tend to customize IDs for important files by hand,
causing any attempt to use org-attach on that file to fail
if the ID is shorter than six characters:

    org-attach-id-ts-folder-format: Args out of range: "ftt", 0, 6

This method should be adjusted to handle non-ts-ids just as well,
as org-id-method does not dictate the format of existing ids.

Regards,
Janek



[BUG] Markdown export broken without toc and with broken links [9.6 (9.6-??-e9da29b)]

2022-07-20 Thread Janek F
Hello,

With the following configuration (on top of vanilla Doom, but that doesn't seem 
to be related), when trying to export to Markdown an org-mode file with broken 
links, the export omits all content under headlines:

(setq org-export-with-toc nil
  org-export-with-broken-links 't)

For Example:

Test [[id:broken]]
* Headline
This is not exported

exports to:

Test

The position of the broken link does not matter, just that there is one.

Regards,
Janek



Scrolling through features on website doesn't work properly

2020-04-05 Thread Janek F
Hey,

Trying to scroll through the features of org mode on 
https://orgmode.org/features.html# with the buttons didn't work for me, neither 
on Firefox nor Chromium.
On other subpages, such as https://orgmode.org/#docs, it did work.

Regards,
Janek