emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] ol-info: Define :insert-description function


From: Ihor Radchenko
Subject: Re: [PATCH v2] ol-info: Define :insert-description function
Date: Mon, 22 Aug 2022 12:10:01 +0800

Max Nikulin <manikulin@gmail.com> writes:

>>> It returns a cons, doesn't it? Is it confusing that separator for
>>> components is related to the argument?
>> 
>> It is confusing that cons consist of _file name_ and node name.
>> However, the function may return non-file as car of the cons.
>
> "dir" should not appear in well-formed links <info:file#node>. If a user 
> adds "info:" links then it is unlikely that their has never used info 
> and has never seen directory index. Moreover I do not see real problem 
> since it is considered as a virtual info file:
>
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/info.el#n2344
> (add-to-list 'Info-virtual-files
>            '("\\`dir\\'" ; ...

I do not see ("dir" . "etc") as a problematic return value.
The only issue is that docstring is a bit confusing.

Maybe, in addition to "Return cons consisting of file name and node name",
you can put something like "File name may also be a virtual file name
(see `Info-virtual-files')."

> After all, it is an internal function and I am still unsure that I have 
> chosen the best variant. I believed that underspecified behavior here 
> may give less harm than making some 3rd party code relying on the 
> proposed variant.
>
> I can drop "(dir)" special case to consider incomplete links as invalid 
> ones. The only problem is test cases for escaping of various characters 
> since they use links without file name as the input, but they may be 
> easily adjusted by adding some file name.

I am ok with current behavior. It is only the docstring that I find
slightly confusing.

> There is huge room for improvements in "ol-info.el", e.g. other virtual 
> files such as "(*History*)" may signal an error during HTML export.

May you open a separate bug report about this?

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]