From unknown Tue Jun 24 15:45:10 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#1643: [patch] convert footnote.el to use define-minor-mode Reply-To: Eduard Wiebe , 1643-quiet@debbugs.gnu.org Resent-From: Eduard Wiebe Original-Sender: Glenn Morris Resent-To: Resent-Date: Fri, 19 Dec 2008 20:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 1643 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by quiet@emacsbugs.donarmstrong.com id=Q.122971846323818 (code Q ref -1); Fri, 19 Dec 2008 20:35:02 +0000 Received: (at quiet) by emacsbugs.donarmstrong.com; 19 Dec 2008 20:27:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=FVGT_m_MULTI_ODD, IMPRONONCABLE_2,MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBJKRZTc023808 for ; Fri, 19 Dec 2008 12:27:36 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LDlvq-0005bO-JK for quiet@emacsbugs.donarmstrong.com; Fri, 19 Dec 2008 15:26:46 -0500 From: Eduard Wiebe To: quiet@debbugs.gnu.org Date: Sun, 14 Dec 2008 00:46:14 +0100 Lines: 163 References: <86d4fx82jd.fsf@nirvana.pusto.de> X-From-Line: emacs-devel-bounces+rgm=gnu.org@gnu.org Sat Dec 13 18:47:27 2008 Received: from mx10.gnu.org ([199.232.76.166]:40187) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LBeCl-0006fT-8o for rgm@gnu.org; Sat, 13 Dec 2008 18:47:27 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LBeDO-0005lD-FA for rgm@gnu.org; Sat, 13 Dec 2008 18:48:07 -0500 Received: from lists.gnu.org ([199.232.76.165]:36208) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBeDO-0005l9-At for rgm@gnu.org; Sat, 13 Dec 2008 18:48:06 -0500 Received: from localhost ([127.0.0.1]:59990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBeDO-0007O7-7c for rgm@gnu.org; Sat, 13 Dec 2008 18:48:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBeBs-0006QW-Uu for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBeBr-0006OM-Iw for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:32 -0500 Received: from [199.232.76.173] (port=44913 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBeBr-0006O4-Aq for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:31 -0500 Received: from main.gmane.org ([80.91.229.2]:43250 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBeBq-0005e9-MP for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:31 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LBeBk-0000BN-Gv for emacs-devel@gnu.org; Sat, 13 Dec 2008 23:46:24 +0000 Received: from e182125144.adsl.alicedsl.de ([85.182.125.144]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Dec 2008 23:46:24 +0000 Received: from usenet by e182125144.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Dec 2008 23:46:24 +0000 X-Injected-Via-Gmane: http://gmane.org/ X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e182125144.adsl.alicedsl.de Cancel-Lock: sha1:tY+Q84XRAZ+YLVOlZ3eXAIGZfgw= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+rgm=gnu.org@gnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: Glenn Morris --=-=-= Severity: wishlist [ resent from http://lists.gnu.org/archive/html/emacs-devel/2008-12/msg00534.html ] Stefan Monnier writes: >> * mail/footnote.el (footnote-mode): Use define-minor-mode >> (footnote-prefix): Use defcustom > > Looks very good, thank you. Except you've renamed footnote-prefix to > footnote-mode-prefix, which doesn't seem to be worth the trouble (of > and ChangeLog text should end with "."). Stefan, thank you for comments. 2008-12-14 Eduard Wiebe * mail/footnote.el (footnote-mode): Use define-minor-mode. (footnote-prefix): Use defcustom. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=footnote.el.diff diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index 506f6e7..a7b372b 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -45,15 +45,6 @@ :version "21.1" :group 'message) -(defcustom footnote-mode-line-string " FN" - "String to display in modes section of the mode-line." - :group 'footnote) - -(defcustom footnote-mode-hook nil - "Hook functions run when footnote-mode is activated." - :type 'hook - :group 'footnote) - (defcustom footnote-narrow-to-footnotes-when-editing nil "If non-nil, narrow to footnote text body while editing a footnote." :type 'boolean @@ -84,8 +75,12 @@ displaying footnotes." :type 'integer :group 'footnote) -(defvar footnote-prefix [(control ?c) ?!] - "*When not using `message-mode', the prefix to bind in `mode-specific-map'") +(defcustom footnote-prefix "\C-c!" + "Prefix key to use for Footnote command in Footnote minor mode. +The value of this variable is checked as part of loading Footnote mode. +After that, changing the prefix key requires manipulating keymaps." + :type 'string + :group 'footnote) ;;; Interface variables that probably shouldn't be changed @@ -143,10 +138,6 @@ has no effect on buffers already displaying footnotes." (defvar footnote-mouse-highlight 'highlight "Text property name to enable mouse over highlight.") -(defvar footnote-mode nil - "Variable indicating whether footnote minor mode is active.") -(make-variable-buffer-local 'footnote-mode) - ;;; Default styles ;;; NUMERIC (defconst footnote-numeric-regexp "[0-9]+" @@ -743,47 +734,31 @@ being set it is automatically widened." (widen)) (goto-char (cadr (assq note footnote-pointer-marker-alist)))))) -(defvar footnote-mode-map nil - "Keymap used for footnote minor mode.") - -;; Set up our keys -(unless footnote-mode-map - (setq footnote-mode-map (make-sparse-keymap)) - (define-key footnote-mode-map "a" 'Footnote-add-footnote) - (define-key footnote-mode-map "b" 'Footnote-back-to-message) - (define-key footnote-mode-map "c" 'Footnote-cycle-style) - (define-key footnote-mode-map "d" 'Footnote-delete-footnote) - (define-key footnote-mode-map "g" 'Footnote-goto-footnote) - (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes) - (define-key footnote-mode-map "s" 'Footnote-set-style)) - -(defvar footnote-minor-mode-map nil - "Keymap used for binding footnote minor mode.") - -(unless footnote-minor-mode-map - (define-key global-map footnote-prefix footnote-mode-map)) +(defvar footnote-mode-map + (let ((map (make-sparse-keymap)) + (prefix-map (make-sparse-keymap))) + (define-key map footnote-prefix prefix-map) + (define-key prefix-map "a" 'Footnote-add-footnote) + (define-key prefix-map "b" 'Footnote-back-to-message) + (define-key prefix-map "c" 'Footnote-cycle-style) + (define-key prefix-map "d" 'Footnote-delete-footnote) + (define-key prefix-map "g" 'Footnote-goto-footnote) + (define-key prefix-map "r" 'Footnote-renumber-footnotes) + (define-key prefix-map "s" 'Footnote-set-style) + map)) ;;;###autoload -(defun footnote-mode (&optional arg) +(define-minor-mode footnote-mode "Toggle footnote minor mode. -\\ This minor mode provides footnote support for `message-mode'. To get started, play around with the following keys: -key binding ---- ------- -\\[Footnote-add-footnote] Footnote-add-footnote -\\[Footnote-back-to-message] Footnote-back-to-message -\\[Footnote-delete-footnote] Footnote-delete-footnote -\\[Footnote-goto-footnote] Footnote-goto-footnote -\\[Footnote-renumber-footnotes] Footnote-renumber-footnotes -\\[Footnote-cycle-style] Footnote-cycle-style -\\[Footnote-set-style] Footnote-set-style +\\{footnote-mode-map} " - (interactive "*P") + :init-value nil + :lighter " FN" + :keymap footnote-mode-map + :group 'footnote ;; (filladapt-mode t) - (setq footnote-mode - (if (null arg) (not footnote-mode) - (> (prefix-numeric-value arg) 0))) (when footnote-mode ;; (Footnote-setup-keybindings) (make-local-variable 'footnote-style) @@ -808,14 +783,7 @@ key binding (unless (assoc bullet-regexp filladapt-token-table) (setq filladapt-token-table (append filladapt-token-table - (list (list bullet-regexp 'bullet))))))) - - (run-hooks 'footnote-mode-hook))) - -(unless (assq 'footnote-mode minor-mode-alist) - (setq minor-mode-alist - (cons '(footnote-mode footnote-mode-line-string) - minor-mode-alist))) + (list (list bullet-regexp 'bullet))))))))) (provide 'footnote) --=-=-= -- Eduard Wiebe --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 20 10:58:12 2009 Received: (at control) by debbugs.gnu.org; 20 Dec 2009 15:58:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NMOAe-0006FH-7M for submit@debbugs.gnu.org; Sun, 20 Dec 2009 10:58:12 -0500 Received: from colin-baker-v0.ics.uci.edu ([128.195.1.153]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NMOAc-0006FB-OB for control@debbugs.gnu.org; Sun, 20 Dec 2009 10:58:11 -0500 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by colin-baker-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nBKFvug3004692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 20 Dec 2009 07:57:56 -0800 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nBKFvuig021746; Sun, 20 Dec 2009 07:57:56 -0800 (PST) Date: Sun, 20 Dec 2009 07:57:56 -0800 (PST) Message-Id: <200912201557.nBKFvuig021746@godzilla.ics.uci.edu> From: Dan Nicolaescu To: control@debbugs.gnu.org Subject: X-Debbugs-No-Ack: yes Lines: 16 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nBKFvug3004692 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.155, required 5, autolearn=disabled, ALL_TRUSTED -1.44, MISSING_SUBJECT 1.28) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-Spam-Status: No X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org tags 3597 + patch tags 3904 + patch tags 4142 + patch tags 4951 + patch tags 4448 + patch tags 4286 + patch tags 2159 + patch tags 2746 + patch tags 1643 + patch tags 1933 + patch tags 3175 + patch tags 3887 + patch tags 4310 + patch tags 4546 + patch quit From unknown Tue Jun 24 15:45:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#1643: please close this pr References: In-Reply-To: Resent-From: Eduard Wiebe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Apr 2010 09:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1643 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 1643@debbugs.gnu.org Received: via spool by 1643-submit@debbugs.gnu.org id=B1643.127028832228019 (code B ref 1643); Sat, 03 Apr 2010 09:53:02 +0000 Received: (at 1643) by debbugs.gnu.org; 3 Apr 2010 09:52:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ny01J-0007Hs-W1 for submit@debbugs.gnu.org; Sat, 03 Apr 2010 05:52:02 -0400 Received: from wp093.webpack.hosteurope.de ([80.237.132.100]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ny01H-0007HX-Sm for 1643@debbugs.gnu.org; Sat, 03 Apr 2010 05:52:00 -0400 Received: from g226236232.adsl.alicedsl.de ([92.226.236.232] helo=nirvana.pusto.de); authenticated by wp093.webpack.hosteurope.de running ExIM with esmtpsa (TLSv1:DES-CBC3-SHA:168) id 1Ny01E-0000Qa-GF; Sat, 03 Apr 2010 11:51:56 +0200 Received: from ew by nirvana.pusto.de with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Ny01D-0003za-7u for 1643@debbugs.gnu.org; Sat, 03 Apr 2010 11:51:55 +0200 From: Eduard Wiebe User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (berkeley-unix) Date: Sat, 03 Apr 2010 11:51:55 +0200 Message-ID: <86vdc87tj8.fsf@nirvana.pusto.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-bounce-key: webpack.hosteurope.de;ew@pusto.de;1270288322;95622b90; X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) Hi all, please close this PR, while already merged in. 2009-09-03 Eduard Wiebe Stefan Monnier * mail/footnote.el (footnote-prefix): Make it a defcustom. (footnote-mode-map): Move initialization into the declaration. (footnote-minor-mode-map): Define it rather than changing global-map. (footnote-mode): Use define-minor-mode. Thanks. -- Eduard Wiebe From unknown Tue Jun 24 15:45:10 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Eduard Wiebe Subject: bug#1643 closed by Stefan Monnier (Re: bug#1643: please close this pr) Message-ID: References: X-Gnu-PR-Message: they-closed 1643 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 1643@debbugs.gnu.org Date: Sat, 03 Apr 2010 14:22:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1270304522-3807-1" This is a multi-part message in MIME format... ------------=_1270304522-3807-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #1643: [patch] convert footnote.el to use define-minor-mode It has been closed by Stefan Monnier . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Stefan Monnier by replying to this email. --=20 1643: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D1643 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1270304522-3807-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 1643-done) by debbugs.gnu.org; 3 Apr 2010 14:22:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ny4Ea-0000z4-37 for submit@debbugs.gnu.org; Sat, 03 Apr 2010 10:22:00 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ny4Cy-0000yI-0p for 1643-done@debbugs.gnu.org; Sat, 03 Apr 2010 10:20:20 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAKrrtktFpZE8/2dsb2JhbACbS3K1OYUHBIsq X-IronPort-AV: E=Sophos;i="4.51,356,1267419600"; d="scan'208";a="60155587" Received: from 69-165-145-60.dsl.teksavvy.com (HELO ceviche.home) ([69.165.145.60]) by ironport2-out.pppoe.ca with ESMTP; 03 Apr 2010 10:20:14 -0400 Received: by ceviche.home (Postfix, from userid 20848) id BA37A660BF; Sat, 3 Apr 2010 10:20:14 -0400 (EDT) From: Stefan Monnier To: Eduard Wiebe Subject: Re: bug#1643: please close this pr Message-ID: References: <86vdc87tj8.fsf@nirvana.pusto.de> Date: Sat, 03 Apr 2010 10:20:14 -0400 In-Reply-To: <86vdc87tj8.fsf@nirvana.pusto.de> (Eduard Wiebe's message of "Sat, 03 Apr 2010 11:51:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 1643-done X-Mailman-Approved-At: Sat, 03 Apr 2010 10:21:58 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > please close this PR, while already merged in. Thanks, done. Stefan ------------=_1270304522-3807-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at quiet) by emacsbugs.donarmstrong.com; 19 Dec 2008 20:27:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=FVGT_m_MULTI_ODD, IMPRONONCABLE_2,MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBJKRZTc023808 for ; Fri, 19 Dec 2008 12:27:36 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LDlvq-0005bO-JK for quiet@emacsbugs.donarmstrong.com; Fri, 19 Dec 2008 15:26:46 -0500 From: Eduard Wiebe To: quiet@debbugs.gnu.org Subject: Re: [patch] convert footnote.el to use define-minor-mode Date: Sun, 14 Dec 2008 00:46:14 +0100 Lines: 163 References: <86d4fx82jd.fsf@nirvana.pusto.de> X-From-Line: emacs-devel-bounces+rgm=gnu.org@gnu.org Sat Dec 13 18:47:27 2008 Received: from mx10.gnu.org ([199.232.76.166]:40187) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LBeCl-0006fT-8o for rgm@gnu.org; Sat, 13 Dec 2008 18:47:27 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LBeDO-0005lD-FA for rgm@gnu.org; Sat, 13 Dec 2008 18:48:07 -0500 Received: from lists.gnu.org ([199.232.76.165]:36208) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBeDO-0005l9-At for rgm@gnu.org; Sat, 13 Dec 2008 18:48:06 -0500 Received: from localhost ([127.0.0.1]:59990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBeDO-0007O7-7c for rgm@gnu.org; Sat, 13 Dec 2008 18:48:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBeBs-0006QW-Uu for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBeBr-0006OM-Iw for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:32 -0500 Received: from [199.232.76.173] (port=44913 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBeBr-0006O4-Aq for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:31 -0500 Received: from main.gmane.org ([80.91.229.2]:43250 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBeBq-0005e9-MP for emacs-devel@gnu.org; Sat, 13 Dec 2008 18:46:31 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LBeBk-0000BN-Gv for emacs-devel@gnu.org; Sat, 13 Dec 2008 23:46:24 +0000 Received: from e182125144.adsl.alicedsl.de ([85.182.125.144]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Dec 2008 23:46:24 +0000 Received: from usenet by e182125144.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Dec 2008 23:46:24 +0000 X-Injected-Via-Gmane: http://gmane.org/ X-Debbugs-No-Ack: yes X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e182125144.adsl.alicedsl.de Cancel-Lock: sha1:tY+Q84XRAZ+YLVOlZ3eXAIGZfgw= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+rgm=gnu.org@gnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: Glenn Morris --=-=-= Severity: wishlist [ resent from http://lists.gnu.org/archive/html/emacs-devel/2008-12/msg00534.html ] Stefan Monnier writes: >> * mail/footnote.el (footnote-mode): Use define-minor-mode >> (footnote-prefix): Use defcustom > > Looks very good, thank you. Except you've renamed footnote-prefix to > footnote-mode-prefix, which doesn't seem to be worth the trouble (of > and ChangeLog text should end with "."). Stefan, thank you for comments. 2008-12-14 Eduard Wiebe * mail/footnote.el (footnote-mode): Use define-minor-mode. (footnote-prefix): Use defcustom. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=footnote.el.diff diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index 506f6e7..a7b372b 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -45,15 +45,6 @@ :version "21.1" :group 'message) -(defcustom footnote-mode-line-string " FN" - "String to display in modes section of the mode-line." - :group 'footnote) - -(defcustom footnote-mode-hook nil - "Hook functions run when footnote-mode is activated." - :type 'hook - :group 'footnote) - (defcustom footnote-narrow-to-footnotes-when-editing nil "If non-nil, narrow to footnote text body while editing a footnote." :type 'boolean @@ -84,8 +75,12 @@ displaying footnotes." :type 'integer :group 'footnote) -(defvar footnote-prefix [(control ?c) ?!] - "*When not using `message-mode', the prefix to bind in `mode-specific-map'") +(defcustom footnote-prefix "\C-c!" + "Prefix key to use for Footnote command in Footnote minor mode. +The value of this variable is checked as part of loading Footnote mode. +After that, changing the prefix key requires manipulating keymaps." + :type 'string + :group 'footnote) ;;; Interface variables that probably shouldn't be changed @@ -143,10 +138,6 @@ has no effect on buffers already displaying footnotes." (defvar footnote-mouse-highlight 'highlight "Text property name to enable mouse over highlight.") -(defvar footnote-mode nil - "Variable indicating whether footnote minor mode is active.") -(make-variable-buffer-local 'footnote-mode) - ;;; Default styles ;;; NUMERIC (defconst footnote-numeric-regexp "[0-9]+" @@ -743,47 +734,31 @@ being set it is automatically widened." (widen)) (goto-char (cadr (assq note footnote-pointer-marker-alist)))))) -(defvar footnote-mode-map nil - "Keymap used for footnote minor mode.") - -;; Set up our keys -(unless footnote-mode-map - (setq footnote-mode-map (make-sparse-keymap)) - (define-key footnote-mode-map "a" 'Footnote-add-footnote) - (define-key footnote-mode-map "b" 'Footnote-back-to-message) - (define-key footnote-mode-map "c" 'Footnote-cycle-style) - (define-key footnote-mode-map "d" 'Footnote-delete-footnote) - (define-key footnote-mode-map "g" 'Footnote-goto-footnote) - (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes) - (define-key footnote-mode-map "s" 'Footnote-set-style)) - -(defvar footnote-minor-mode-map nil - "Keymap used for binding footnote minor mode.") - -(unless footnote-minor-mode-map - (define-key global-map footnote-prefix footnote-mode-map)) +(defvar footnote-mode-map + (let ((map (make-sparse-keymap)) + (prefix-map (make-sparse-keymap))) + (define-key map footnote-prefix prefix-map) + (define-key prefix-map "a" 'Footnote-add-footnote) + (define-key prefix-map "b" 'Footnote-back-to-message) + (define-key prefix-map "c" 'Footnote-cycle-style) + (define-key prefix-map "d" 'Footnote-delete-footnote) + (define-key prefix-map "g" 'Footnote-goto-footnote) + (define-key prefix-map "r" 'Footnote-renumber-footnotes) + (define-key prefix-map "s" 'Footnote-set-style) + map)) ;;;###autoload -(defun footnote-mode (&optional arg) +(define-minor-mode footnote-mode "Toggle footnote minor mode. -\\ This minor mode provides footnote support for `message-mode'. To get started, play around with the following keys: -key binding ---- ------- -\\[Footnote-add-footnote] Footnote-add-footnote -\\[Footnote-back-to-message] Footnote-back-to-message -\\[Footnote-delete-footnote] Footnote-delete-footnote -\\[Footnote-goto-footnote] Footnote-goto-footnote -\\[Footnote-renumber-footnotes] Footnote-renumber-footnotes -\\[Footnote-cycle-style] Footnote-cycle-style -\\[Footnote-set-style] Footnote-set-style +\\{footnote-mode-map} " - (interactive "*P") + :init-value nil + :lighter " FN" + :keymap footnote-mode-map + :group 'footnote ;; (filladapt-mode t) - (setq footnote-mode - (if (null arg) (not footnote-mode) - (> (prefix-numeric-value arg) 0))) (when footnote-mode ;; (Footnote-setup-keybindings) (make-local-variable 'footnote-style) @@ -808,14 +783,7 @@ key binding (unless (assoc bullet-regexp filladapt-token-table) (setq filladapt-token-table (append filladapt-token-table - (list (list bullet-regexp 'bullet))))))) - - (run-hooks 'footnote-mode-hook))) - -(unless (assq 'footnote-mode minor-mode-alist) - (setq minor-mode-alist - (cons '(footnote-mode footnote-mode-line-string) - minor-mode-alist))) + (list (list bullet-regexp 'bullet))))))))) (provide 'footnote) --=-=-= -- Eduard Wiebe --=-=-=-- ------------=_1270304522-3807-1--