GNU bug report logs -
#60190
29.0.50; Improve `Info-goto-node-web'
Previous Next
Full log
Message #8 received at 60190 <at> debbugs.gnu.org (full text, mbox):
On Mon, 19 Dec 2022 at 03:24, Marcin Borkowski <mbork <at> mbork.pl> wrote:
>
> Hi all,
>
> I am extremely happy because of `Info-goto-node-web', but it would be
> even better if two changes were made.
>
> 1. It could work in "An Introduction to Programming in Emacs Lisp" and
> Org mode manual, too.
>
> 2. It could put the URL on the kill ring when called with a prefix
> argument.
>
> I would code these myself, but I changed jobs since I signed the FSF
> paperwork long time ago, and I don't want to contribute to Emacs since
> then because it could be a legal gray area then. I think these two
> changes are pretty low hanging fruit anyway.
>
> Thanks!
>
> PS. Please CC me on any replies to this request - I'm no longer
> subscribed to the bug-gnu-emacs list.
Hi Marcin and all,
what about this?
(defvar Info-url-base
'(("emacs" . "http://www.gnu.org/software/emacs/manual/html_node/emacs/")
("elisp" . "http://www.gnu.org/software/emacs/manual/html_node/elisp/")
("eintr" .
"http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/")
("efaq" . "https://www.gnu.org/software/emacs/manual/html_node/efaq/")
("cl" . "http://www.gnu.org/software/emacs/manual/html_node/cl/")
("eshell" . "https://www.gnu.org/software/emacs/manual/html_node/eshell/")
("org" . "http://www.gnu.org/software/emacs/manual/html_node/org/")))
(defun Info-get-base-url (manual)
(alist-get manual Info-url-base nil nil 'equal))
(defun Info-url-for-node (node)
"Return a URL for NODE, a node in the GNU Emacs or Elisp manual.
NODE should be a string on the form \"(manual)Node\". Only emacs
and elisp manuals are supported."
(unless (string-match "\\`(\\(.+\\))\\(.+\\)\\'" node)
(error "Invalid node name %s" node))
(let* ((manual (match-string 1 node))
(node (match-string 2 node))
(base-url (Info-get-base-url manual))) ; <- new
;; Old:
;; (unless (member manual '("emacs" "elisp"))
;; (error "Only emacs/elisp manuals are supported"))
;; New:
(if (not base-url)
(error "Unsupported manual"))
;;
;; Encode a bunch of characters the way that makeinfo does.
(setq node
(mapconcat (lambda (ch)
(if (or (< ch 32) ; ^@^A-^Z^[^\^]^^^-
(<= 33 ch 47) ; !"#$%&'()*+,-./
(<= 58 ch 64) ; :;<=>?@
(<= 91 ch 96) ; [\]_`
(<= 123 ch 127)) ; {|}~ DEL
(format "_00%x" ch)
(char-to-string ch)))
node
""))
(concat base-url ; new
(url-hexify-string (string-replace " " "-" node))
".html")))
Now the fruit hangs a little bit lower...
Cheers =),
Eduardo Ochs
http://angg.twu.net/eepitch.html
This bug report was last modified 1 year and 289 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.