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: Max Nikulin
Subject: Re: [PATCH v2] ol-info: Define :insert-description function
Date: Sun, 21 Aug 2022 21:49:05 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 20/08/2022 14:29, Ihor Radchenko wrote:
Max Nikulin writes:

On 19/08/2022 11:28, Ihor Radchenko wrote:
Max Nikulin writes:

+(defun org-info--link-file-node (path)
+  "Extract file name and node from info link PATH.
+
+Return cons consisting of file name and node name or \"Top\" if node
+part is not specified. Components may be separated by \":\" or by \"#\"."

It looks like the docstring does not match what the function actually
returns.

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\\'" ; ...

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.

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.




reply via email to

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