Due to a recent texinfo thread on emacs-devel, I have added RMS to Cc.

On 20/12/2024 04:37, Joseph Turner wrote:
Max Nikulin writes:
(info "(emacs) Specifying File Variables")
By the way, is there a built-in command to copy that (info ...) sexp
when viewing that info page?

TLDR;

"C-0 c" or "C-0 w"

Actually to get the reference above I copied and edited the file part of the HTTP URL

<https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html>

Autocompletion from browsing history in address bar is a rather convenient feature to quickly open some document visited earlier.

Unfortunately HTML page metadata does not contain manual and node names, so a browser extension that copies info references, while possible, would not be reliable. (I have noticed that HTML links may have extra data-manual="elisp" attributes without data-node conterpart.)

Back to Emacs, `org-store-link' allows to save an info link for insertion into an Org mode document.

However I am unaware of any command that allows to create a more precise reference. Enough nodes have index anchors and it may be more convenient:
<https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-_005f>
An issue with Org links to index anchors that they can not be easily exported to html_node variant of the texinfo document, especially if the manual is not installed on the machine. (E.g. sphinx puts machine-readable index of sections and anchors along with HTML files.)

Earlier I have not tries to find if it is possible to copy info node name as *a command*. Actually neither (info "(info)"), nor (info "(info-stnd"), nor (info "(emacs)") describe how to copy current node name, so the feature is a part of hidden UI. I still had an impression that I have seen a keybinding somewhere. This time I found it in "C-h m" list, it is present in "?" info help as well (of course, without details related to sexp).

The final step is the docstring for the "c" and "w" key bindings.

`Info-copy-current-node-name'

An advantage of the

    (info "(emacs) Specifying File Variables")

form is that it usually can be used to open specific part of the document in a standalone info browser. (Eli believes they are dead.)

Another feature I missed in info browsers is equivalent of browser "copy link" context menu option for links. It is handy to copy link for notes without leaving the current document.

I am not surprised that people use any option (HTTP URL, etc.), but not "(emacs) Specifying File Variables" form (or some dedicated URL scheme). The feature is hidden (and incompatible with yelp and khelpcenter).

Reply via email to