From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.bugs Subject: bug#60190: 29.0.50; Improve `Info-goto-node-web' Date: Mon, 19 Dec 2022 04:02:47 -0300 Message-ID: References: <87a63jdi8r.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7490"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60190@debbugs.gnu.org To: Marcin Borkowski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 19 08:04:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7AC6-0001kF-UD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Dec 2022 08:04:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7ABv-0001km-UL; Mon, 19 Dec 2022 02:04:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7ABu-0001ka-TP for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 02:04:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7ABu-0007I5-L1 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 02:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7ABt-0001Cc-TS for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 02:04:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eduardo Ochs Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Dec 2022 07:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60190 X-GNU-PR-Package: emacs Original-Received: via spool by 60190-submit@debbugs.gnu.org id=B60190.16714333894608 (code B ref 60190); Mon, 19 Dec 2022 07:04:01 +0000 Original-Received: (at 60190) by debbugs.gnu.org; 19 Dec 2022 07:03:09 +0000 Original-Received: from localhost ([127.0.0.1]:38008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7AB3-0001CG-CD for submit@debbugs.gnu.org; Mon, 19 Dec 2022 02:03:09 -0500 Original-Received: from mail-io1-f41.google.com ([209.85.166.41]:34783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7AB0-0001Bw-Sq for 60190@debbugs.gnu.org; Mon, 19 Dec 2022 02:03:08 -0500 Original-Received: by mail-io1-f41.google.com with SMTP id p66so1842974iof.1 for <60190@debbugs.gnu.org>; Sun, 18 Dec 2022 23:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Iho4LRXcXYZ8gljyOf5GYE8R7c869wE+MRbs5M75oJI=; b=TVtW2BUYAg4egB/DFFNkS89Qd5ksrVe45D30UA/QSkXxJw3Rpz1YM0GatzIzzYwrhs B8bC+RF+FrWI226LewhrrKJ5FwVl/yOx8g+gUaUC2cPMygdEfj5X0ewmry2/d+7yF2zT QIJ8GG+t/IMIyXDENsaSRL9iPKE179CPCwSbaO1gfQLtgrsXti480YQcwYewTYMj7WVm 15jz0AlJK3PhG3suGBaQ+ir6rR/WpiveR9zjYpnT00wTBCcahIY1bzyZiUIXzzJrtT/M ZCSrRPynhon7k1lQSceD7YBpE9S0ygeCFTyugOJB/qG5qSkLDqG+YaN6/PYDZn8DwrIZ 8pLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Iho4LRXcXYZ8gljyOf5GYE8R7c869wE+MRbs5M75oJI=; b=z6mWxxaazIvg8JnYNj8fj/2sE24yRADoZSsYZLgSdXagdRpJJZGNErzZTOT9mpi4CD aR3NRW+ClFpKtMt0I4y4C6EDDbBJ/818m2S1t+7TEg6+VFyYRnw9pUUYGdu2mq3jJ03c l4yUs/FXuZKvIKoEbxzqBT3FP67hU2gU+hV7C7wPez4nKccYj8dpWokkushQPxCWeJ3l CyMeE6Ek1XYGcL/zD6J9sr2L3o0KsTIrBWQG4XkI1/Jo01POinpaRgIBR36yMZa6bX85 JxhBXR1ERT5Mf0GPGRtE4lRZNXm7ij10MW1D/QVMeqqhmce6BSp+lhRb5FsqYRlRFFUY T9Mg== X-Gm-Message-State: ANoB5pkbsbDZPmkR89ktS1ONLpzGxnMHpUuAdTnbMjjsrjBOaDicOQbl JSPVqSFiuViEnddX4L9AqPZHwB4WXtLkHCsOqAA= X-Google-Smtp-Source: AA0mqf6nAO5D9ZXaYmcrbZ1YfZA4/qZKknkxIFyD4RK3I5rCTtXkPVER6URkXlZAGDgKjuPSP0ybszFU0yiMWZbX16c= X-Received: by 2002:a05:6638:450e:b0:38a:c40f:371e with SMTP id bs14-20020a056638450e00b0038ac40f371emr2570149jab.299.1671433380055; Sun, 18 Dec 2022 23:03:00 -0800 (PST) In-Reply-To: <87a63jdi8r.fsf@mbork.pl> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251401 Archived-At: On Mon, 19 Dec 2022 at 03:24, Marcin Borkowski 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