Subject: Re: bug#44895: Add Info-copy-permalink

From: Jean Louis <[email-masked]>
Date: Fri, 27 Nov 2020 11:14:18 +0300

* Eli Zaretskii <[email-masked]> [2020-11-27 10:30]:
> severity 44895 wishlist
> thanks
> 
> > From: 積丹尼 Dan Jacobson
> >  <[email-masked]>
> > Date: Fri, 27 Nov 2020 05:39:35 +0800
> > 
> > c runs the command Info-copy-current-node-name.
> > 
> > That's great but not powerful enough.
> > 
> > Let's say I am reading
> > (info "(emacs) Optional Mode Line")
> > and stumble upon the fact that
> >    On graphical displays, the mode line is drawn as a 3D box.
> > 
> > I think, "This is great. I'll be sure to tell Mrs. Nerblefield. She'll
> > switch editors right away."
> > 
> > Well, most other programs' manuals have a "share" or "copy permalink"
> > button, most alas except for emacs.
> 
> How do you "share" a section in a manual? compose an email that
> includes the text of the section in the attachment? something else?

I can understand this demand of Dan as I have the same. 

This is similar to partial functions of `org-store-link' and to key
`w' in *eww*, or to `c' to copy Node name in the Info buffer, with
addition that capturing the hyperlink to the reference would construct
the shareable link or could invoke integration to quickly send it to
somebody.

If it is meant to obtain quick reference to be shared with somebody,
partial construction of URL could be obtained with:

User could press let us say: `C' on the "14.18 Optional Mode Line
Features" page, then the WWW hyperlink could be constructed in memory
pointing to:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Optional-Mode-Line.html
or snippet could be constructed with the title and URL such as:

Emacs Manual: 14.18 Optional Mode Line Features
https://www.gnu.org/software/emacs/manual/html_node/emacs/Optional-Mode-Line.html

then by yanking snippet into email it can be shared easily with
third party.

If person is reading email through Emacs and knows how to evaluate
functions, one can also share it by using `c' and then constructing this:

(info "(emacs) Optional Mode Line")

it is little more tedious, then if there is option to quickly obtain
human readable hyperlink.

More integration could be achieved by just pressing `C' or other key
that would invoke email to be constructed with:

Subject: Emacs Manual: 14.18 Optional Mode Line Features

and body being:

Emacs Manual: 14.18 Optional Mode Line Features
https://www.gnu.org/software/emacs/manual/html_node/emacs/Optional-Mode-Line.html

Because all of this may be complicated and demands efforts in
implementation, I am suggesting that before ever is such implemented
that Dan can try using GNU Hyperbole package by:

{M-x package-install RET hyperbole RET}

As then it becomes easy to share Info links to other users also using
GNU Hyperbole by using this workflow:

- find the info node you wish to share

- press `c' to obtain reference in memory, or {C-u 0 c}

- enclose the link in double quotes "(emacs) Registers"

- send the link and user will be able to invoke action key M-RET on
  the above to open the info page on Registers.

To automate everything one could use this function below that serves
as a concept but lacks the actual URL. If URL can be figured out from
the node name then it would be easy to share info node corresponding
WWW hyperlinks by email or by XMPP or by chat, etc.

(defun info-node-share-by-email ()
 "Send info node as email"
  (interactive)
  (Info-copy-current-node-name)
  (let ((node (pop kill-ring))
	(email (read-from-minibuffer "Email: ")))
    (compose-mail email)
    (mail-position-on-field "Subject" t)
    (insert node)
    (rfc822-goto-eoh)
    (forward-line 1)
    (insert "Here is info node reference for you: \n\n")
    (insert (format "\"%s\"\n" node))))