On 04/05/2024 04:41, Bruno Cardoso wrote:
On 2024-05-02, 17:41 +0700, Max Nikulin wrote:
<shortdoc:file::#find-file>
[...]
I implemented the search option by borrowing the regexp from `ol-info':
It is necessary to maintain backward compatibility for `ol-info'. I do
not know what kind of separator was added earlier: "::" or "#". I
suppose, for new link type, rules more close to file: links may be used, see
(info "(org) Search Options")
https://orgmode.org/manual/Search-Options.html
That is why I suggested shortdoc:GROUP::#FUNCTION. This way
shrotdoc:GROUP::SEARCH_STRING is possible as well.
(shortdoc-display-group group)
(when fn
(re-search-forward (concat "^(" (string-remove-prefix "#" fn))
nil t)
Notice that `shortdoc-display-group' has optional FUNCTION argument.
(beginning-of-line)))
(error (message "Unknown shortdoc group: %s" group)))))
It works, but I'm not quite sure if this is the best approach.
I do not have strong opinion as well. Some points to consider:
- Unambiguous parsing of link target.
- Flexibility it respect to later improvements.