On 2024-05-08, 18:20 +0700, Max Nikulin wrote: > I have not managed to get all known groups with `shortdoc-display-group' > in Emacs-28. Is it a feature of `shortdoc' in Emacs-29? In Emacs-29 `shortdoc' is an alias for `shortdoc-display-group'. Interactvely, it prompts the user for a group from `shortdoc--groups' (that's what I meant by "all known groups"). I'm unsure if `shortdoc-display-group' behaves differently in Emacs-28. > Likely it is better to not allow empty group or function, so "+" instead > of "*" > > "\\`\\([^:]+\\)\\(?:::\\(.+\\)\\'\\)?" > > since is hardly a valid link. However it might be > search text link in the list of all groups (Emacs-29+ only?). > > It is related to corner cases, so I do not insist. `shortdoc-display-group' already handles empty group or function. Replacing "*" by "+" will throw an "Args out of range" error in the corner case you mentioned ("shortdoc:::file"). So I think it's fine to keep "*" there. > Nitpick, feel free to ignore: > - `when' is redundant here due to `and' inside its condition. > - `string-patch-p' would not affect match groups, so it is a bit cheaper. > - Since it is already known that first character is "#", `substring' > instead of `string-remove-prefix' is an extra step in microoptimization Noted. Thank you for all your comments and suggestions, Max!