unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44895: Add Info-copy-permalink
@ 2020-11-26 21:39 積丹尼 Dan Jacobson
  2020-11-26 23:06 ` Drew Adams
  2020-11-27  7:23 ` Eli Zaretskii
  0 siblings, 2 replies; 30+ messages in thread
From: 積丹尼 Dan Jacobson @ 2020-11-26 21:39 UTC (permalink / raw)
  To: 44895

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.

> We don't keep track of our URLs. Google is your friend.

Sure, but I'll probably end up finding Bill Snortfield's 1989 copy of
that page, and sending her the link to that.

> Well, find the search result with "gnu.org" in it.

Yeah, but there are more than one.

> Well then don't use Google. Just copy and paste the page's text, and
> send her that.

Yes, but she used to work at Wikipedia, so she will ask for proof.

> Well, go to gnu.org and put the title in the search box. Maybe that
> will find the link you need.

Maybe, but how about instead, along with Info-copy-current-node-name,
there was a command, Info-copy-current-node-permalink, or just
Info-copy-permalink. that would copy it for us?

> We don't hardwire https URLs into the manual. Sorry.

Yes you do. (info "(emacs) Distrib") has plenty. And that page even
knows about itself:
   (1) This manual is itself...

As a bonus, mid-page anchor # fragments could even go directly to the
places in the page there online, just like they do in the offline manual.

emacs-version "27.1"





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-26 21:39 bug#44895: Add Info-copy-permalink 積丹尼 Dan Jacobson
@ 2020-11-26 23:06 ` Drew Adams
  2020-11-26 23:20   ` 積丹尼 Dan Jacobson
  2020-11-27 10:44   ` Stefan Kangas
  2020-11-27  7:23 ` Eli Zaretskii
  1 sibling, 2 replies; 30+ messages in thread
From: Drew Adams @ 2020-11-26 23:06 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson, 44895

If you use Info+ then `G' (`Info-goto-node-web')
takes you to the Web version of the current node.

It uses function `Info-url-for-node' (also from
Info+) to get the URL for that.

,----
| Info-url-for-node is an interactive compiled Lisp function in
| ‘info+.el’.
| 
| (Info-url-for-node NODE)
| 
| Return a URL for NODE, a node in the GNU Emacs or Elisp manual.
| Alternatively, NODE can have the form (MANUAL)NODE, where MANUAL is
| "emacs" or "elisp" and NODE is the name of the node in that
| manual.  Empty NODE in (MANUAL) defaults to the `Top' node.
`----





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-26 23:06 ` Drew Adams
@ 2020-11-26 23:20   ` 積丹尼 Dan Jacobson
  2020-11-27  0:29     ` Drew Adams
                       ` (2 more replies)
  2020-11-27 10:44   ` Stefan Kangas
  1 sibling, 3 replies; 30+ messages in thread
From: 積丹尼 Dan Jacobson @ 2020-11-26 23:20 UTC (permalink / raw)
  To: Drew Adams; +Cc: 44895

If I have to use non-standard / non-default features to tell Mrs.
Nerblefield how great emacs is, then perhaps emacs is not that great.

>>>>> "DA" == Drew Adams <drew.adams@oracle.com> writes:
DA> If you use Info+ then `G' (`Info-goto-node-web')...





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-26 23:20   ` 積丹尼 Dan Jacobson
@ 2020-11-27  0:29     ` Drew Adams
  2020-11-27  5:34     ` Richard Stallman
  2020-11-27  7:24     ` Eli Zaretskii
  2 siblings, 0 replies; 30+ messages in thread
From: Drew Adams @ 2020-11-27  0:29 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 44895

If you can easily create a feature, yourself,
to tell Mrs N. how great Emacs is, that in
itself speaks to that greatness.

And of course vanilla Emacs can decide to add
any such feature as a standard, default feature.

In this case it's trivial, and I pointed to
free code that does it.  Feel free to deny
yourself use of it.

> If I have to use non-standard / non-default features to tell Mrs.
> Nerblefield how great emacs is, then perhaps emacs is not that great.
> 
> >>>>> "DA" == Drew Adams <drew.adams@oracle.com> writes:
> DA> If you use Info+ then `G' (`Info-goto-node-web')...





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-26 23:20   ` 積丹尼 Dan Jacobson
  2020-11-27  0:29     ` Drew Adams
@ 2020-11-27  5:34     ` Richard Stallman
  2020-11-27  7:24     ` Eli Zaretskii
  2 siblings, 0 replies; 30+ messages in thread
From: Richard Stallman @ 2020-11-27  5:34 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 44895

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > If I have to use non-standard / non-default features to tell Mrs.
  > Nerblefield how great emacs is, then perhaps emacs is not that great.

This is an amusing and harmless side topic, but it's still a tangent.
Would people not continue it for very long on this list?

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-26 21:39 bug#44895: Add Info-copy-permalink 積丹尼 Dan Jacobson
  2020-11-26 23:06 ` Drew Adams
@ 2020-11-27  7:23 ` Eli Zaretskii
  2020-11-27  8:14   ` Jean Louis
  2021-11-11  7:11   ` Lars Ingebrigtsen
  1 sibling, 2 replies; 30+ messages in thread
From: Eli Zaretskii @ 2020-11-27  7:23 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 44895

severity 44895 wishlist
thanks

> From: 積丹尼 Dan Jacobson
>  <jidanni@jidanni.org>
> 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?

IOW, please be more specific about the feature you'd like to see; just
using buzzwords from elsewhere doesn't help, because Emacs is not a
smartphone nor a Web browser.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-26 23:20   ` 積丹尼 Dan Jacobson
  2020-11-27  0:29     ` Drew Adams
  2020-11-27  5:34     ` Richard Stallman
@ 2020-11-27  7:24     ` Eli Zaretskii
  2 siblings, 0 replies; 30+ messages in thread
From: Eli Zaretskii @ 2020-11-27  7:24 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 44895

> From: 積丹尼 Dan Jacobson
>  <jidanni@jidanni.org>
> Date: Fri, 27 Nov 2020 07:20:56 +0800
> Cc: 44895@debbugs.gnu.org
> 
> If I have to use non-standard / non-default features to tell Mrs.
> Nerblefield how great emacs is, then perhaps emacs is not that great.

Not jidanni's high standards, anyway.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  7:23 ` Eli Zaretskii
@ 2020-11-27  8:14   ` Jean Louis
  2020-11-27  8:40     ` Eli Zaretskii
  2020-11-27  9:45     ` Stephen Berman
  2021-11-11  7:11   ` Lars Ingebrigtsen
  1 sibling, 2 replies; 30+ messages in thread
From: Jean Louis @ 2020-11-27  8:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 44895, 積丹尼 Dan Jacobson

* Eli Zaretskii <eliz@gnu.org> [2020-11-27 10:30]:
> severity 44895 wishlist
> thanks
> 
> > From: 積丹尼 Dan Jacobson
> >  <jidanni@jidanni.org>
> > 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))))






^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  8:14   ` Jean Louis
@ 2020-11-27  8:40     ` Eli Zaretskii
  2020-11-27  8:47       ` Jean Louis
  2020-11-27 20:19       ` Tomas Nordin
  2020-11-27  9:45     ` Stephen Berman
  1 sibling, 2 replies; 30+ messages in thread
From: Eli Zaretskii @ 2020-11-27  8:40 UTC (permalink / raw)
  To: Jean Louis; +Cc: 44895, jidanni

> Date: Fri, 27 Nov 2020 11:14:18 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: 積丹尼 Dan Jacobson <jidanni@jidanni.org>,
>   44895@debbugs.gnu.org
> 
> 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.

Are we talking only about "sharing" stuff in manuals related to Emacs?
What about any other Info manual?  And what about manuals that don't
have a Web site?

IOW, this proposed feature needs more detailed specification, IMO.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  8:40     ` Eli Zaretskii
@ 2020-11-27  8:47       ` Jean Louis
  2020-11-27 20:19       ` Tomas Nordin
  1 sibling, 0 replies; 30+ messages in thread
From: Jean Louis @ 2020-11-27  8:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 44895, jidanni

* Eli Zaretskii <eliz@gnu.org> [2020-11-27 11:41]:
> > Date: Fri, 27 Nov 2020 11:14:18 +0300
> > From: Jean Louis <bugs@gnu.support>
> > Cc: 積丹尼 Dan Jacobson <jidanni@jidanni.org>,
> >   44895@debbugs.gnu.org
> > 
> > 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.
> 
> Are we talking only about "sharing" stuff in manuals related to Emacs?
> What about any other Info manual?  And what about manuals that don't
> have a Web site?
> 
> IOW, this proposed feature needs more detailed specification, IMO.

In general it would be good for info files to get the feature where
author could specify if info is published on the WWW and then to
relate info nodes to WWW nodes. That may be external to Emacs. But if
this relation would be implemented in the fundamental info structure
then it would reflect on all info manuals.






^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  8:14   ` Jean Louis
  2020-11-27  8:40     ` Eli Zaretskii
@ 2020-11-27  9:45     ` Stephen Berman
  2020-11-27 10:21       ` Jean Louis
  2020-11-27 18:46       ` Drew Adams
  1 sibling, 2 replies; 30+ messages in thread
From: Stephen Berman @ 2020-11-27  9:45 UTC (permalink / raw)
  To: Jean Louis; +Cc: 44895, 積丹尼 Dan Jacobson

On Fri, 27 Nov 2020 11:14:18 +0300 Jean Louis <bugs@gnu.support> wrote:

> 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")

Typing `C-0 c' in the node adds just that to the kill-ring.

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

In Gnus that is a human readable hyperlink (to the local Info manual,
not to the HTML version at gnu.org).

Steve Berman





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  9:45     ` Stephen Berman
@ 2020-11-27 10:21       ` Jean Louis
  2020-11-27 18:46       ` Drew Adams
  1 sibling, 0 replies; 30+ messages in thread
From: Jean Louis @ 2020-11-27 10:21 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 44895, 積丹尼 Dan Jacobson

* Stephen Berman <stephen.berman@gmx.net> [2020-11-27 12:45]:
> On Fri, 27 Nov 2020 11:14:18 +0300 Jean Louis <bugs@gnu.support> wrote:
> 
> > 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")
> 
> Typing `C-0 c' in the node adds just that to the kill-ring.
> 
> > it is little more tedious, then if there is option to quickly obtain
> > human readable hyperlink.
> 
> In Gnus that is a human readable hyperlink (to the local Info manual,
> not to the HTML version at gnu.org).

I have expressed me wrongly.

All those info hyperlinks are well readable.









^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-26 23:06 ` Drew Adams
  2020-11-26 23:20   ` 積丹尼 Dan Jacobson
@ 2020-11-27 10:44   ` Stefan Kangas
  2020-11-27 10:57     ` Jean Louis
                       ` (2 more replies)
  1 sibling, 3 replies; 30+ messages in thread
From: Stefan Kangas @ 2020-11-27 10:44 UTC (permalink / raw)
  To: Drew Adams; +Cc: 44895, 積丹尼 Dan Jacobson

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

Drew Adams <drew.adams@oracle.com> writes:

> If you use Info+ then `G' (`Info-goto-node-web')
> takes you to the Web version of the current node.
>
> It uses function `Info-url-for-node' (also from
> Info+) to get the URL for that.

I think this looks useful for Emacs itself.  A rough attempt at doing
so attached.

Thoughts?

[-- Attachment #2: info-goto-web.diff --]
[-- Type: application/octet-stream, Size: 5918 bytes --]

diff --git a/lisp/info.el b/lisp/info.el
index c3684deb96..a3715942aa 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1781,7 +1781,92 @@ Info-goto-node
       (if trim (setq nodename (substring nodename 0 trim))))
     (if transient-mark-mode (deactivate-mark))
     (Info-find-node (if (equal filename "") nil filename)
-		    (if (equal nodename "") "Top" nodename) nil strict-case)))
+                    (if (equal nodename "") "Top" nodename) nil strict-case)))
+
+;;;###autoload
+(defun Info-goto-node-web (node &optional flip-new-win)
+  "Use `browse-url' to go to Info node NODE using a Web browser.
+With a prefix arg, reverse the effect of option
+`browse-url-new-window-flag'.
+
+NODE is the name of a node in the GNU Emacs or Elisp manual.
+Alternatively, NODE can have the form (MANUAL)NODE, where MANUAL is
+\"emacs\" or \"elisp\" and NODE is the name of the node in that
+manual.  Empty NODE in (MANUAL) defaults to the `Top' node."
+  (interactive (list (Info-read-node-name "Go to node: " Info-current-node) current-prefix-arg))
+  (require 'browse-url)
+  (unless Info-current-file (error "This command must be invoked from Info"))
+  (browse-url (Info-url-for-node node) (list (if flip-new-win
+                                                 (not browse-url-new-window-flag)
+                                               browse-url-new-window-flag))))
+
+;; See https://www.gnu.org/software/texinfo/manual/texinfo/html_node/
+;;             HTML-Xref-Node-Name-Expansion.html
+;;
+;; 1. The standard ASCII letters (a-z and A-Z) are not modified. All
+;;    other characters may be changed as specified below.
+;;
+;; 2. The standard ASCII numbers (0-9) are not modified except when a
+;;    number is the first character of the node name. In that case, see
+;;    below.
+;;
+;; 3. Multiple consecutive space, tab and newline characters are
+;;    transformed into just one space. (It’s not possible to have
+;;    newlines in node names with the current implementation, but we
+;;    specify it anyway, just in case.)
+;;
+;; 4. Leading and trailing spaces are removed.
+;;
+;; 5. After the above has been applied, each remaining space character is
+;;    converted into a ‘-’ character.
+;;
+;; 6. Other ASCII 7-bit characters are transformed into ‘_00xx’, where xx
+;;    is the ASCII character code in (lowercase) hexadecimal. This includes
+;;    ‘_’, which is mapped to ‘_005f’.
+;;
+;; 7. If the node name does not begin with a letter, the literal string
+;;    ‘g_t’ is prefixed to the result. (Due to the rules above, that
+;;    string can never occur otherwise; it is an arbitrary choice,
+;;    standing for “GNU Texinfo”.) This is necessary because XHTML
+;;    requires that identifiers begin with a letter.
+;;
+;;;###autoload
+(defun Info-url-for-node (node)
+  "Return a URL for NODE, a node in the GNU Emacs or Elisp manual.
+Alternatively, NODE can have the form (MANUAL)NODE, where MANUAL is
+\"emacs\" or \"elisp\" and NODE is the name of the node in that
+manual.  Empty NODE in (MANUAL) defaults to the `Top' node."
+  (interactive (list (Info-read-node-name "Node: " Info-current-node)))
+  (unless Info-current-file (error "This command must be invoked from Info"))
+  (let (file url)
+    (string-match "\\s *\\((\\s *\\([^\t)]*\\)\\s *)\\s *\\|\\)\\(.*\\)" node)
+    (setq file  (if (= (match-beginning 1) (match-end 1)) "" (match-string 2 node))
+          node  (match-string 3 node))
+    (when (equal node "") (setq node  "index")) ; `Top' node.
+    (let ((trim  (string-match "\\s +\\'" file)))
+      (when trim (setq file (substring file 0 trim))))
+    (let ((trim  (string-match "\\s +\\'" node)))
+      (when trim (setq node (substring node 0 trim))))
+    (when (equal file "") (setq file  Info-current-file))
+    (setq file  (file-name-sans-extension (file-name-nondirectory file)))
+    (unless (member file '("emacs" "elisp"))
+      (error "Manual cannot be `%s'; it can only be `emacs' or `elisp'" file))
+    (setq node  (mapconcat (lambda (ch)
+                             (if (or (< ch 32) ; ^@^A-^Z^[^\^]^^^-
+                                     (and (<= 33 ch)   (<= ch 47)) ; !"#$%&'()*+,-./
+                                     (and (<= 58 ch)   (<= ch 64)) ; :;<=>?@
+                                     (and (<= 91 ch)   (<= ch 96)) ; [\]_`
+                                     (and (<= 123 ch)  (<= ch 127))) ; {|}~ DEL
+                                 (format "_00%x" ch)
+                               (char-to-string ch)))
+                           node
+                           ""))
+    (setq node  (replace-regexp-in-string "[ \t]+" "-" node t t))
+    (unless (string-match-p "[[:alpha:]]" node) (setq node  (concat "g_t" node)))
+    (setq url  (concat "https://www.gnu.org/software/emacs/manual/html_node/"
+                       file "/" node ".html"))
+    (message "URL: %s" url)
+    url))
 
 (defvar Info-read-node-completion-table)
 
@@ -1865,7 +1950,7 @@ Info-read-node-name-1
        code Info-read-node-completion-table string predicate))))
 
 ;; Arrange to highlight the proper letters in the completion list buffer.
-(defun Info-read-node-name (prompt)
+(defun Info-read-node-name (prompt &optional default)
   "Read an Info node name with completion, prompting with PROMPT.
 A node name can have the form \"NODENAME\", referring to a node
 in the current Info file, or \"(FILENAME)NODENAME\", referring to
@@ -1873,7 +1958,8 @@ Info-read-node-name
 the Top node in FILENAME."
   (let* ((completion-ignore-case t)
 	 (Info-read-node-completion-table (Info-build-node-completions))
-	 (nodename (completing-read prompt #'Info-read-node-name-1 nil t)))
+         (nodename (completing-read prompt #'Info-read-node-name-1 nil t nil
+                                    'Info-minibuf-history default)))
     (if (equal nodename "")
 	(Info-read-node-name prompt)
       nodename)))

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27 10:44   ` Stefan Kangas
@ 2020-11-27 10:57     ` Jean Louis
  2020-11-27 12:32     ` Eli Zaretskii
  2020-11-27 18:51     ` Drew Adams
  2 siblings, 0 replies; 30+ messages in thread
From: Jean Louis @ 2020-11-27 10:57 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 44895, 積丹尼 Dan Jacobson

* Stefan Kangas <stefan@marxist.se> [2020-11-27 13:46]:
> Drew Adams <drew.adams@oracle.com> writes:
> 
> > If you use Info+ then `G' (`Info-goto-node-web')
> > takes you to the Web version of the current node.
> >
> > It uses function `Info-url-for-node' (also from
> > Info+) to get the URL for that.
> 
> I think this looks useful for Emacs itself.  A rough attempt at doing
> so attached.

What Drew said and provided should be built-in into Emacs, and if not
for all info files, at least for Emacs based info files.

Myself I would even like collecting hyperlinks into a ring to be able
to easier give them as reference several of them at once with title
and URL, not just URL.






^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27 10:44   ` Stefan Kangas
  2020-11-27 10:57     ` Jean Louis
@ 2020-11-27 12:32     ` Eli Zaretskii
  2020-11-28  7:47       ` Stefan Kangas
  2020-11-27 18:51     ` Drew Adams
  2 siblings, 1 reply; 30+ messages in thread
From: Eli Zaretskii @ 2020-11-27 12:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 44895, jidanni

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 27 Nov 2020 11:44:10 +0100
> Cc: 44895@debbugs.gnu.org,
>  積丹尼 Dan Jacobson <jidanni@jidanni.org>
> 
> Drew Adams <drew.adams@oracle.com> writes:
> 
> > If you use Info+ then `G' (`Info-goto-node-web')
> > takes you to the Web version of the current node.
> >
> > It uses function `Info-url-for-node' (also from
> > Info+) to get the URL for that.
> 
> I think this looks useful for Emacs itself.  A rough attempt at doing
> so attached.
> 
> Thoughts?

I guess my response was ignored?





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  9:45     ` Stephen Berman
  2020-11-27 10:21       ` Jean Louis
@ 2020-11-27 18:46       ` Drew Adams
  1 sibling, 0 replies; 30+ messages in thread
From: Drew Adams @ 2020-11-27 18:46 UTC (permalink / raw)
  To: Stephen Berman, Jean Louis; +Cc: 44895, 積丹尼 Dan Jacobson

> In Gnus that is a human readable hyperlink (to the local Info manual,
> not to the HTML version at gnu.org).

Being able to obtain each kind of hyperlink
is useful: Info link and web link.  The use
cases are orthogonal.

FWIW, I use my `G' (`Info-goto-node-web') all
the time, to point users to a node from an
email or in some online forum.

I often also tell them how to get to the same
node from within Emacs.  But the two kinds of
access information are different.  Both are
useful.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27 10:44   ` Stefan Kangas
  2020-11-27 10:57     ` Jean Louis
  2020-11-27 12:32     ` Eli Zaretskii
@ 2020-11-27 18:51     ` Drew Adams
  2 siblings, 0 replies; 30+ messages in thread
From: Drew Adams @ 2020-11-27 18:51 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 44895, 積丹尼 Dan Jacobson

> > If you use Info+ then `G' (`Info-goto-node-web')
> > takes you to the Web version of the current node.
> >
> > It uses function `Info-url-for-node' (also from
> > Info+) to get the URL for that.
> 
> I think this looks useful for Emacs itself.  A rough attempt at doing
> so attached.
> 
> Thoughts?

Eyeballing it, I didn't notice changes from my
code, so LGTM.  (I see there's now a doc string
for `Info-read-node-name', which is good.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  8:40     ` Eli Zaretskii
  2020-11-27  8:47       ` Jean Louis
@ 2020-11-27 20:19       ` Tomas Nordin
  2020-11-27 23:27         ` 積丹尼 Dan Jacobson
  1 sibling, 1 reply; 30+ messages in thread
From: Tomas Nordin @ 2020-11-27 20:19 UTC (permalink / raw)
  To: Eli Zaretskii, Jean Louis; +Cc: 44895, jidanni

Eli Zaretskii <eliz@gnu.org> writes:

> Are we talking only about "sharing" stuff in manuals related to Emacs?
> What about any other Info manual?  And what about manuals that don't
> have a Web site?
>
> IOW, this proposed feature needs more detailed specification, IMO.

A specification could be that where

w runs the command Info-copy-current-node-name

W ? would run something like Info-copy-current-node-url, with a
documentation explaining that if an online equivalent can be
established, a link to it is put into the kill ring. Else a friendly
message is given explaining that an online equivalent could not be
derived.

As a next step some sort of convention could be established for Info
manuals to declare its prefix online URL or something.

--
Tomas





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27 20:19       ` Tomas Nordin
@ 2020-11-27 23:27         ` 積丹尼 Dan Jacobson
  0 siblings, 0 replies; 30+ messages in thread
From: 積丹尼 Dan Jacobson @ 2020-11-27 23:27 UTC (permalink / raw)
  To: 44895

All I know is it seems my bug is in good hands. Thank you everybody. All
I know is I was reading the emacs manual and looked at the buttons that
I could click and there was one that said copy or something but not
something that could copy a https link. And then some fellow suggested
some command that I found was actually in an add-on but he didn't
mention that vital fact. And it even had a "+" in the title, so dlocate
thought it was a regexp, etc. etc.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27 12:32     ` Eli Zaretskii
@ 2020-11-28  7:47       ` Stefan Kangas
  2020-11-28  8:21         ` Eli Zaretskii
  0 siblings, 1 reply; 30+ messages in thread
From: Stefan Kangas @ 2020-11-28  7:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 44895, 積丹尼 Dan Jacobson

Eli Zaretskii <eliz@gnu.org> writes:

> > > If you use Info+ then `G' (`Info-goto-node-web')
> > > takes you to the Web version of the current node.
> > >
> > > It uses function `Info-url-for-node' (also from
> > > Info+) to get the URL for that.
> >
> > I think this looks useful for Emacs itself.  A rough attempt at doing
> > so attached.
> >
> > Thoughts?
>
> I guess my response was ignored?

No, that was not my intention.  Maybe I didn't understand what you
were saying.  I thought you asked for a better specification of the
feature?





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-28  7:47       ` Stefan Kangas
@ 2020-11-28  8:21         ` Eli Zaretskii
  0 siblings, 0 replies; 30+ messages in thread
From: Eli Zaretskii @ 2020-11-28  8:21 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 44895, jidanni

> From: Stefan Kangas <stefan@marxist.se>
> Date: Sat, 28 Nov 2020 08:47:07 +0100
> Cc: Drew Adams <drew.adams@oracle.com>, 44895@debbugs.gnu.org, 
> 	積丹尼 Dan Jacobson <jidanni@jidanni.org>
> 
> > > Thoughts?
> >
> > I guess my response was ignored?
> 
> No, that was not my intention.  Maybe I didn't understand what you
> were saying.  I thought you asked for a better specification of the
> feature?

I meant what I wrote here:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44895#29





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: Add Info-copy-permalink
  2020-11-27  7:23 ` Eli Zaretskii
  2020-11-27  8:14   ` Jean Louis
@ 2021-11-11  7:11   ` Lars Ingebrigtsen
  2021-11-11 17:26     ` bug#44895: [External] : " Drew Adams
  1 sibling, 1 reply; 30+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-11  7:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 44895, 積丹尼 Dan Jacobson

Eli Zaretskii <eliz@gnu.org> writes:

> How do you "share" a section in a manual? compose an email that
> includes the text of the section in the attachment? something else?
>
> IOW, please be more specific about the feature you'd like to see; just
> using buzzwords from elsewhere doesn't help, because Emacs is not a
> smartphone nor a Web browser.

He meant that you should be able to go to the gnu.org version of the
info page, which seems reasonable to me.

Stefan Kangas <stefan@marxist.se> writes:

> I think this looks useful for Emacs itself.  A rough attempt at doing
> so attached.

I've er simplified a bit and pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-11  7:11   ` Lars Ingebrigtsen
@ 2021-11-11 17:26     ` Drew Adams
  2021-11-11 17:40       ` Juri Linkov
  0 siblings, 1 reply; 30+ messages in thread
From: Drew Adams @ 2021-11-11 17:26 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Eli Zaretskii
  Cc: 44895@debbugs.gnu.org, 積丹尼 Dan Jacobson

> Stefan Kangas <stefan@marxist.se> writes:
> 
> > I think this looks useful for Emacs itself.
> > A rough attempt at doing so attached.

Er, all of that code is taken verbatim from info+.el.
How is it your rough attempt?

> I've er simplified a bit and pushed to Emacs 29.

Why did you "simplify" a bit?  What did you leave out?

Did you bind it to a key?  Info+ binds it to `G', and
that'd be my suggestion for Emacs also.  It goes to a
node, just like `g'; it just goes to it in the manual
on the web.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-11 17:26     ` bug#44895: [External] : " Drew Adams
@ 2021-11-11 17:40       ` Juri Linkov
  2021-11-11 17:58         ` Drew Adams
  2021-11-12  3:32         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 30+ messages in thread
From: Juri Linkov @ 2021-11-11 17:40 UTC (permalink / raw)
  To: Drew Adams
  Cc: 44895@debbugs.gnu.org, Lars Ingebrigtsen,
	積丹尼 Dan Jacobson

> Did you bind it to a key?  Info+ binds it to `G', and
> that'd be my suggestion for Emacs also.  It goes to a
> node, just like `g'; it just goes to it in the manual
> on the web.

For symmetry we could use such keybindings:

  "g" 'Info-goto-node
  "G" 'Info-goto-node-web

  "w" 'Info-copy-current-node-name
  "W" 'Info-url-for-node





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-11 17:40       ` Juri Linkov
@ 2021-11-11 17:58         ` Drew Adams
  2021-11-12  3:32         ` Lars Ingebrigtsen
  1 sibling, 0 replies; 30+ messages in thread
From: Drew Adams @ 2021-11-11 17:58 UTC (permalink / raw)
  To: Juri Linkov
  Cc: 44895@debbugs.gnu.org, Lars Ingebrigtsen,
	積丹尼 Dan Jacobson

> > Did you bind it to a key?  Info+ binds it to `G', and
> > that'd be my suggestion for Emacs also.  It goes to a
> > node, just like `g'; it just goes to it in the manual
> > on the web.
> 
> For symmetry we could use such keybindings:
> 
>   "g" 'Info-goto-node
>   "G" 'Info-goto-node-web
> 
>   "w" 'Info-copy-current-node-name
>   "W" 'Info-url-for-node

Good idea for W.  (I've added that binding now to Info+.)





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-11 17:40       ` Juri Linkov
  2021-11-11 17:58         ` Drew Adams
@ 2021-11-12  3:32         ` Lars Ingebrigtsen
  2021-11-12  7:41           ` Robert Pluim
  1 sibling, 1 reply; 30+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-12  3:32 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 44895@debbugs.gnu.org, 積丹尼 Dan Jacobson

Juri Linkov <juri@linkov.net> writes:

> For symmetry we could use such keybindings:
>
>   "g" 'Info-goto-node
>   "G" 'Info-goto-node-web

Good idea; now done.

>   "w" 'Info-copy-current-node-name
>   "W" 'Info-url-for-node

I'm not sure I see the utility of exposing Info-url-for-node as a
command.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-12  3:32         ` Lars Ingebrigtsen
@ 2021-11-12  7:41           ` Robert Pluim
  2021-11-12  7:48             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 30+ messages in thread
From: Robert Pluim @ 2021-11-12  7:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen
  Cc: 44895@debbugs.gnu.org, Juri Linkov,
	積丹尼 Dan Jacobson

>>>>> On Fri, 12 Nov 2021 04:32:08 +0100, Lars Ingebrigtsen <larsi@gnus.org> said:

    Lars> Juri Linkov <juri@linkov.net> writes:
    >> For symmetry we could use such keybindings:
    >> 
    >> "g" 'Info-goto-node
    >> "G" 'Info-goto-node-web

    Lars> Good idea; now done.

    >> "w" 'Info-copy-current-node-name
    >> "W" 'Info-url-for-node

    Lars> I'm not sure I see the utility of exposing Info-url-for-node as a
    Lars> command.

Itʼs useful when posting to stackexchange, since the people reading
your answers might not be using emacs to do so (Iʼll agree thatʼs
probably a rarity).

Robert
-- 





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-12  7:41           ` Robert Pluim
@ 2021-11-12  7:48             ` Lars Ingebrigtsen
  2021-11-12 17:17               ` Drew Adams
  0 siblings, 1 reply; 30+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-12  7:48 UTC (permalink / raw)
  To: Robert Pluim
  Cc: 44895@debbugs.gnu.org, Juri Linkov,
	積丹尼 Dan Jacobson

Robert Pluim <rpluim@gmail.com> writes:

> Itʼs useful when posting to stackexchange, since the people reading
> your answers might not be using emacs to do so (Iʼll agree thatʼs
> probably a rarity).

I think the people that want to do that can just `G' (and confirm that
that's the page they wanted to post about) and then clip the URL from
the browser.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-12  7:48             ` Lars Ingebrigtsen
@ 2021-11-12 17:17               ` Drew Adams
  2021-11-14  0:06                 ` 積丹尼 Dan Jacobson
  0 siblings, 1 reply; 30+ messages in thread
From: Drew Adams @ 2021-11-12 17:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Robert Pluim
  Cc: 44895@debbugs.gnu.org, Juri Linkov,
	積丹尼 Dan Jacobson

> > Itʼs useful when posting to stackexchange, since the people reading
> > your answers might not be using emacs to do so (Iʼll agree thatʼs
> > probably a rarity).
> 
> I think the people that want to do that can just `G' (and confirm that
> that's the page they wanted to post about) and then clip the URL from
> the browser.

FWIW, that's what I've been doing.  I agree
that it's not a big deal to do that.

But I also think it wouldn't hurt to bind the
URL command as well.

Certainly that's not a super-important command.
And I'm generally against binding new keys by
default willy nilly.

If it were I, I'd bind that command to `W', but
I also wouldn't be afraid to later remove or
change that binding if a better use were found
for `W' in Info mode.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#44895: [External] : bug#44895: Add Info-copy-permalink
  2021-11-12 17:17               ` Drew Adams
@ 2021-11-14  0:06                 ` 積丹尼 Dan Jacobson
  0 siblings, 0 replies; 30+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-11-14  0:06 UTC (permalink / raw)
  To: Drew Adams
  Cc: 44895@debbugs.gnu.org, Lars Ingebrigtsen, Robert Pluim,
	Juri Linkov

>> I think the people that want to do that can just `G' (and confirm that
>> that's the page they wanted to post about) and then clip the URL from
>> the browser.

Some people (rms) don't use browsers, or don't want to connect to the
Internet and start a browser.  Also we trust the URL you are providing
is the same as the page we are looking at. Else we will submit a bug report.





^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2021-11-14  0:06 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-26 21:39 bug#44895: Add Info-copy-permalink 積丹尼 Dan Jacobson
2020-11-26 23:06 ` Drew Adams
2020-11-26 23:20   ` 積丹尼 Dan Jacobson
2020-11-27  0:29     ` Drew Adams
2020-11-27  5:34     ` Richard Stallman
2020-11-27  7:24     ` Eli Zaretskii
2020-11-27 10:44   ` Stefan Kangas
2020-11-27 10:57     ` Jean Louis
2020-11-27 12:32     ` Eli Zaretskii
2020-11-28  7:47       ` Stefan Kangas
2020-11-28  8:21         ` Eli Zaretskii
2020-11-27 18:51     ` Drew Adams
2020-11-27  7:23 ` Eli Zaretskii
2020-11-27  8:14   ` Jean Louis
2020-11-27  8:40     ` Eli Zaretskii
2020-11-27  8:47       ` Jean Louis
2020-11-27 20:19       ` Tomas Nordin
2020-11-27 23:27         ` 積丹尼 Dan Jacobson
2020-11-27  9:45     ` Stephen Berman
2020-11-27 10:21       ` Jean Louis
2020-11-27 18:46       ` Drew Adams
2021-11-11  7:11   ` Lars Ingebrigtsen
2021-11-11 17:26     ` bug#44895: [External] : " Drew Adams
2021-11-11 17:40       ` Juri Linkov
2021-11-11 17:58         ` Drew Adams
2021-11-12  3:32         ` Lars Ingebrigtsen
2021-11-12  7:41           ` Robert Pluim
2021-11-12  7:48             ` Lars Ingebrigtsen
2021-11-12 17:17               ` Drew Adams
2021-11-14  0:06                 ` 積丹尼 Dan Jacobson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).