From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#37184: Browser-like Info-history button menu Date: Sun, 25 Aug 2019 23:50:28 +0300 Organization: LINKOV.NET Message-ID: <87k1b1km0b.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="114071"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) To: 37184@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 25 22:54:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i1zWj-000TVc-8q for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Aug 2019 22:54:17 +0200 Original-Received: from localhost ([::1]:47950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1zWc-0005Xn-Jo for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Aug 2019 16:54:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52715) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1zWV-0005XR-JT for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2019 16:54:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1zWU-00026d-CG for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2019 16:54:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i1zWU-00026R-8W for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2019 16:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i1zWU-00032v-50 for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2019 16:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Aug 2019 20:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37184 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156676643111681 (code B ref -1); Sun, 25 Aug 2019 20:54:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Aug 2019 20:53:51 +0000 Original-Received: from localhost ([127.0.0.1]:45181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1zWI-00032J-Eb for submit@debbugs.gnu.org; Sun, 25 Aug 2019 16:53:50 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1zWG-000328-L9 for submit@debbugs.gnu.org; Sun, 25 Aug 2019 16:53:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52653) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1zWF-0005Rv-Ef for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2019 16:53:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1zWE-0001vs-1P for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2019 16:53:47 -0400 Original-Received: from bonobo.elm.relay.mailchannels.net ([23.83.212.22]:60499) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i1zWD-0001um-Nz for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2019 16:53:45 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EAECA2C14AA for ; Sun, 25 Aug 2019 20:53:43 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a15.g.dreamhost.com (100-96-85-40.trex.outbound.svc.cluster.local [100.96.85.40]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 907C52C15E9 for ; Sun, 25 Aug 2019 20:53:43 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a15.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.5); Sun, 25 Aug 2019 20:53:43 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Cold-Madly: 322be7ed293a8f1e_1566766423802_1558274385 X-MC-Loop-Signature: 1566766423802:3202541926 X-MC-Ingress-Time: 1566766423802 Original-Received: from pdx1-sub0-mail-a15.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a15.g.dreamhost.com (Postfix) with ESMTP id 59CB1831F8 for ; Sun, 25 Aug 2019 13:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=7ZgIcA7y/ZucethsqOmSkOsQvUc=; b=jhaMxodKRb6dSHOEi zp5bp2yrmFXSJg9jp3mMAUg4BoIgsNBfvDw+VjYroa8YEjVlYVfiK7NbgJj/Ip84 vmqbMKY1KATN2tEG7abZJYE0/mxsTS1aX3kr76J3elDRp77aq+V5pzfNma1Oastd rp2cOKwMJUTb4U2W/C3L9157UY= Original-Received: from mail.jurta.org (m91-129-109-163.cust.tele2.ee [91.129.109.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 34A6A831FA for ; Sun, 25 Aug 2019 13:53:36 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a15 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudehvddgudehiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofffkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrdduieefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrudeifedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165859 Archived-At: --=-=-= Content-Type: text/plain Severity: wishlist Tags: patch Clicking on the history back button with mouse-3 or holding mouse-1 in web browsers displays a menu with a list of previous/next visited pages. The following patch implements the same in the tool-bar of Info-mode: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=Info-history-menu.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/info.el b/lisp/info.el index 17a2d63e6d..b914e2a813 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4059,6 +4059,8 @@ Info-mode-map (define-key map [follow-link] 'mouse-face) (define-key map [XF86Back] 'Info-history-back) (define-key map [XF86Forward] 'Info-history-forward) + (define-key map [tool-bar C-Back\ in\ history] 'Info-history-back-me= nu) + (define-key map [tool-bar C-Forward\ in\ history] 'Info-history-forw= ard-menu) map) "Keymap containing Info commands.") =20 @@ -4151,6 +4153,36 @@ info-tool-bar-map :vert-only t) map)) =20 +(defun Info-history-menu (e name history command) + (let* ((i (length history)) + (map (make-sparse-keymap name))) + (mapc (lambda (history) + (let ((file (nth 0 history)) + (node (nth 1 history))) + (when (stringp file) + (setq file (file-name-sans-extension + (file-name-nondirectory file)))) + (define-key map (vector (intern (format "history-%i" i))) + `(menu-item ,(format "(%s) %s" file node) + (lambda () + (interactive) + (dotimes (_ ,i) (call-interactively ',comm= and)))))) + (setq i (1- i))) + (reverse history)) + (let* ((selection (x-popup-menu e map)) + (binding (and selection (lookup-key map (vector (car selection)))))) + (if binding (call-interactively binding))))) + +(defun Info-history-back-menu (e) + "Pop up the menu with a list of previously visited Info nodes." + (interactive "e") + (Info-history-menu e "Back in history" Info-history 'Info-history-back= )) + +(defun Info-history-forward-menu (e) + "Pop up the menu with a list of Info nodes visited with =E2=80=98Info-= history-back=E2=80=99." + (interactive "e") + (Info-history-menu e "Forward in history" Info-history-forward 'Info-h= istory-forward)) + (defvar Info-menu-last-node nil) ;; Last node the menu was created for. ;; Value is a list, (FILE-NAME NODE-NAME). --=-=-=--