Max Nikulin <maniku...@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