From unknown Sat Aug 16 16:23:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15722: [PATCH] Man: Add menu. Resent-From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Oct 2013 12:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15722 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 15722@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.138279042112466 (code B ref -1); Sat, 26 Oct 2013 12:27:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Oct 2013 12:27:01 +0000 Received: from localhost ([127.0.0.1]:44918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va2xI-0003Ez-26 for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:27:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52273) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va2xF-0003Ef-90 for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:26:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Va2x3-0008Ul-4q for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:26:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2x3-0008Uh-2I for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:26:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2ww-0005WV-Lq for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 08:26:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Va2wq-0008UH-Ln for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 08:26:38 -0400 Received: from ptmx.org ([178.63.28.110]:52247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2wq-0008Tx-GJ for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 08:26:32 -0400 Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 13A472B157; Sat, 26 Oct 2013 14:26:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7kz56oMjJBUu; Sat, 26 Oct 2013 14:26:29 +0200 (CEST) Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id E983226A36; Sat, 26 Oct 2013 14:26:28 +0200 (CEST) From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Date: Sat, 26 Oct 2013 14:26:20 +0200 Message-ID: <1863547.6Ofn9Y3M5J@descartes> User-Agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I wasn't sure if it is acceptable to use `cl-lib'. The check whether there is a "SEE ALSO" section could be simplified to (cl-member Man-see-also-regexp Man--sections :test #'string-match-p) * lisp/man.el (man-imenu-title): New defcustom. (Man-mode-map): Add menu entry. (Man-mode): Add imenu to menu. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/man.el | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lisp/man.el b/lisp/man.el index 5619803..a9dcd98 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -368,6 +368,12 @@ (defvar Man-support-local-filenames 'auto-detect Otherwise, the value is whatever the function `Man-support-local-filenames' should return.") =20 +(defcustom man-imenu-title "Contents" + "The title to use if man adds a Contents menu to the menubar. +Default is \"Contents\"." + :type 'string + :group 'man) + =0C ;; other variables and keymap initializations (defvar Man-original-frame) @@ -446,6 +452,31 @@ (defvar Man-mode-map ;; manual page can contain references to other man pages (define-key map "\r" 'man-follow) (define-key map "?" 'describe-mode) + + (easy-menu-define nil map + "`Man-mode' menu." + '("Man" + ["Next Section" Man-next-section t] + ["Previous Section" Man-previous-section t] + ["Go To Section..." Man-goto-section t] + ["Go To \"SEE ALSO\" Section" Man-goto-see-also-section + :active (let (m) + (dolist (sec Man--sections m) + (when (and (not m) + (string-match-p Man-see-also-regexp se= c)) + (setq m t))))] + ["Follow Reference..." Man-follow-manual-reference + :active Man--refpages + :help "Go to a manpage referred to in the \"SEE ALSO\" sectio= n"] + "--" + ["Next Manpage" Man-next-manpage + :active (> (length Man-page-list) 1)] + ["Previous Manpage" Man-previous-manpage + :active (> (length Man-page-list) 1)] + "--" + ["Man..." man t] + ["Kill Buffer" Man-kill t] + ["Quit" Man-quit t])) map) "Keymap for Man mode.") =20 @@ -1396,6 +1427,7 @@ (define-derived-mode Man-mode fundamental-mode "M= an" (buffer-disable-undo) (auto-fill-mode -1) (setq imenu-generic-expression (list (list nil Man-heading-regexp 0)= )) + (imenu-add-to-menubar man-imenu-title) (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'bookmark-make-record-function) --=20 1.8.4.1 From unknown Sat Aug 16 16:23:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15722: [PATCH] Man: Add menu. Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Oct 2013 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15722 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Cc: 15722@debbugs.gnu.org Received: via spool by 15722-submit@debbugs.gnu.org id=B15722.138281448019004 (code B ref 15722); Sat, 26 Oct 2013 19:08:01 +0000 Received: (at 15722) by debbugs.gnu.org; 26 Oct 2013 19:08:00 +0000 Received: from localhost ([127.0.0.1]:45918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va9DM-0004wR-1m for submit@debbugs.gnu.org; Sat, 26 Oct 2013 15:08:00 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:48907 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va9DJ-0004wI-PE for 15722@debbugs.gnu.org; Sat, 26 Oct 2013 15:07:58 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Va9DI-0003tm-2S; Sat, 26 Oct 2013 15:07:56 -0400 From: Glenn Morris References: <1863547.6Ofn9Y3M5J@descartes> X-Spook: IRA Mossad freedom spy Roswell AGT. AMME subversive X-Ran: "+{3,U>KdUL`D.@l%3?%woIfR-6`xLA[1F3y%A&ZEXT5(fzm0[_N@2w}SxoUoA^vD2)hPm X-Hue: green X-Attribution: GM Date: Sat, 26 Oct 2013 15:07:55 -0400 In-Reply-To: <1863547.6Ofn9Y3M5J@descartes> ("=?UTF-8?Q?R=C3=BCdiger?= Sonderfeld"'s message of "Sat, 26 Oct 2013 14:26:20 +0200") Message-ID: <7z61sjsvec.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.4 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.4 (-----) R=C3=BCdiger Sonderfeld wrote: > I wasn't sure if it is acceptable to use `cl-lib'. It is. From unknown Sat Aug 16 16:23:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15722: [PATCH] Man: Add menu. Resent-From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Oct 2013 19:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15722 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Glenn Morris Cc: 15722@debbugs.gnu.org Received: via spool by 15722-submit@debbugs.gnu.org id=B15722.138281503019997 (code B ref 15722); Sat, 26 Oct 2013 19:18:02 +0000 Received: (at 15722) by debbugs.gnu.org; 26 Oct 2013 19:17:10 +0000 Received: from localhost ([127.0.0.1]:45946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va9MD-0005CS-Mc for submit@debbugs.gnu.org; Sat, 26 Oct 2013 15:17:10 -0400 Received: from ptmx.org ([178.63.28.110]:45179) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va9MB-0005CK-Ah for 15722@debbugs.gnu.org; Sat, 26 Oct 2013 15:17:08 -0400 Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 1AC7F2B1B6; Sat, 26 Oct 2013 21:17:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tWwrKj7PJSoT; Sat, 26 Oct 2013 21:17:04 +0200 (CEST) Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id BB4E72A728; Sat, 26 Oct 2013 21:17:03 +0200 (CEST) From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Date: Sat, 26 Oct 2013 21:16:54 +0200 Message-ID: <10639495.1VFYxECAcK@descartes> User-Agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; ) In-Reply-To: <7z61sjsvec.fsf@fencepost.gnu.org> References: <7z61sjsvec.fsf@fencepost.gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * lisp/man.el (man-imenu-title): New defcustom. (Man-mode-map): Add menu entry. (Man-mode): Add imenu to menu. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/man.el | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lisp/man.el b/lisp/man.el index 5619803..76ce6c3 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -89,6 +89,7 @@ ;;; Code: =20 (require 'ansi-color) +(require 'cl-lib) (require 'button) =20 (defgroup man nil @@ -368,6 +369,12 @@ (defvar Man-support-local-filenames 'auto-detect Otherwise, the value is whatever the function `Man-support-local-filenames' should return.") =20 +(defcustom man-imenu-title "Contents" + "The title to use if man adds a Contents menu to the menubar. +Default is \"Contents\"." + :type 'string + :group 'man) + =0C ;; other variables and keymap initializations (defvar Man-original-frame) @@ -446,6 +453,28 @@ (defvar Man-mode-map ;; manual page can contain references to other man pages (define-key map "\r" 'man-follow) (define-key map "?" 'describe-mode) + + (easy-menu-define nil map + "`Man-mode' menu." + '("Man" + ["Next Section" Man-next-section t] + ["Previous Section" Man-previous-section t] + ["Go To Section..." Man-goto-section t] + ["Go To \"SEE ALSO\" Section" Man-goto-see-also-section + :active (cl-member Man-see-also-regexp Man--sections + :test #'string-match-p)] + ["Follow Reference..." Man-follow-manual-reference + :active Man--refpages + :help "Go to a manpage referred to in the \"SEE ALSO\" sectio= n"] + "--" + ["Next Manpage" Man-next-manpage + :active (> (length Man-page-list) 1)] + ["Previous Manpage" Man-previous-manpage + :active (> (length Man-page-list) 1)] + "--" + ["Man..." man t] + ["Kill Buffer" Man-kill t] + ["Quit" Man-quit t])) map) "Keymap for Man mode.") =20 @@ -1396,6 +1425,7 @@ (define-derived-mode Man-mode fundamental-mode "M= an" (buffer-disable-undo) (auto-fill-mode -1) (setq imenu-generic-expression (list (list nil Man-heading-regexp 0)= )) + (imenu-add-to-menubar man-imenu-title) (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'bookmark-make-record-function) --=20 1.8.4.1 From unknown Sat Aug 16 16:23:36 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Subject: bug#15722: closed (Re: [PATCH] Man: Add menu.) Message-ID: References: <1863547.6Ofn9Y3M5J@descartes> X-Gnu-PR-Message: they-closed 15722 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 15722@debbugs.gnu.org Date: Sun, 27 Oct 2013 02:05:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1382839503-30867-1" This is a multi-part message in MIME format... ------------=_1382839503-30867-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #15722: [PATCH] Man: Add menu. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 15722@debbugs.gnu.org. --=20 15722: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D15722 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1382839503-30867-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 15722-done) by debbugs.gnu.org; 27 Oct 2013 02:04:19 +0000 Received: from localhost ([127.0.0.1]:46615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaFiE-00080f-NU for submit@debbugs.gnu.org; Sat, 26 Oct 2013 22:04:18 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:52525 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaFiC-00080V-9x for 15722-done@debbugs.gnu.org; Sat, 26 Oct 2013 22:04:16 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1VaFiB-0001kJ-AD; Sat, 26 Oct 2013 22:04:15 -0400 From: Glenn Morris To: 15722-done@debbugs.gnu.org Subject: Re: [PATCH] Man: Add menu. References: <7z61sjsvec.fsf@fencepost.gnu.org> <10639495.1VFYxECAcK@descartes> X-Spook: USCODE TWA Freeh target SEAL Team 6 secure data haven X-Ran: ^_//)T&$(NSvp6J'V&QmnFtBBa.Efsc;`!Tl38\&KuAVu9Etr8ej8"]tm`&7bV$.B?K!.X X-Hue: cyan X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sat, 26 Oct 2013 22:04:14 -0400 In-Reply-To: <10639495.1VFYxECAcK@descartes> (=?utf-8?Q?=22R=C3=BCdiger?= Sonderfeld"'s message of "Sat, 26 Oct 2013 21:16:54 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: 15722-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.4 (-----) Version: 24.4 Thank you, applied. Trivial comments follow: R=C3=BCdiger Sonderfeld wrote: > +(defcustom man-imenu-title "Contents" > + "The title to use if man adds a Contents menu to the menubar. > +Default is \"Contents\"." No need to say what the default is, since that information is automatically available. New defcustoms need :version tags. BTW, I suggest you create a Savannah account and request membership of the Emacs project so that you can commit these things yourself. ------------=_1382839503-30867-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Oct 2013 12:27:01 +0000 Received: from localhost ([127.0.0.1]:44918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va2xI-0003Ez-26 for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:27:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52273) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va2xF-0003Ef-90 for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:26:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Va2x3-0008Ul-4q for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:26:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2x3-0008Uh-2I for submit@debbugs.gnu.org; Sat, 26 Oct 2013 08:26:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2ww-0005WV-Lq for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 08:26:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Va2wq-0008UH-Ln for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 08:26:38 -0400 Received: from ptmx.org ([178.63.28.110]:52247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Va2wq-0008Tx-GJ for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 08:26:32 -0400 Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 13A472B157; Sat, 26 Oct 2013 14:26:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7kz56oMjJBUu; Sat, 26 Oct 2013 14:26:29 +0200 (CEST) Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id E983226A36; Sat, 26 Oct 2013 14:26:28 +0200 (CEST) From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld To: bug-gnu-emacs@gnu.org Subject: [PATCH] Man: Add menu. Date: Sat, 26 Oct 2013 14:26:20 +0200 Message-ID: <1863547.6Ofn9Y3M5J@descartes> User-Agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I wasn't sure if it is acceptable to use `cl-lib'. The check whether there is a "SEE ALSO" section could be simplified to (cl-member Man-see-also-regexp Man--sections :test #'string-match-p) * lisp/man.el (man-imenu-title): New defcustom. (Man-mode-map): Add menu entry. (Man-mode): Add imenu to menu. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/man.el | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lisp/man.el b/lisp/man.el index 5619803..a9dcd98 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -368,6 +368,12 @@ (defvar Man-support-local-filenames 'auto-detect Otherwise, the value is whatever the function `Man-support-local-filenames' should return.") =20 +(defcustom man-imenu-title "Contents" + "The title to use if man adds a Contents menu to the menubar. +Default is \"Contents\"." + :type 'string + :group 'man) + =0C ;; other variables and keymap initializations (defvar Man-original-frame) @@ -446,6 +452,31 @@ (defvar Man-mode-map ;; manual page can contain references to other man pages (define-key map "\r" 'man-follow) (define-key map "?" 'describe-mode) + + (easy-menu-define nil map + "`Man-mode' menu." + '("Man" + ["Next Section" Man-next-section t] + ["Previous Section" Man-previous-section t] + ["Go To Section..." Man-goto-section t] + ["Go To \"SEE ALSO\" Section" Man-goto-see-also-section + :active (let (m) + (dolist (sec Man--sections m) + (when (and (not m) + (string-match-p Man-see-also-regexp se= c)) + (setq m t))))] + ["Follow Reference..." Man-follow-manual-reference + :active Man--refpages + :help "Go to a manpage referred to in the \"SEE ALSO\" sectio= n"] + "--" + ["Next Manpage" Man-next-manpage + :active (> (length Man-page-list) 1)] + ["Previous Manpage" Man-previous-manpage + :active (> (length Man-page-list) 1)] + "--" + ["Man..." man t] + ["Kill Buffer" Man-kill t] + ["Quit" Man-quit t])) map) "Keymap for Man mode.") =20 @@ -1396,6 +1427,7 @@ (define-derived-mode Man-mode fundamental-mode "M= an" (buffer-disable-undo) (auto-fill-mode -1) (setq imenu-generic-expression (list (list nil Man-heading-regexp 0)= )) + (imenu-add-to-menubar man-imenu-title) (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'bookmark-make-record-function) --=20 1.8.4.1 ------------=_1382839503-30867-1--