From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Anthony Newsgroups: gmane.emacs.bugs Subject: bug#15562: [PATCH] Text Mode Menu Date: Tue, 8 Oct 2013 18:53:05 +0400 Message-ID: <20131008145305.GA3853@jo.hnanthony.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" X-Trace: ger.gmane.org 1381248681 5602 80.91.229.3 (8 Oct 2013 16:11:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2013 16:11:21 +0000 (UTC) To: 15562@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 08 18:11:26 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VTZsa-0002Hc-AC for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2013 18:11:24 +0200 Original-Received: from localhost ([::1]:37765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTZsZ-0006iE-Pg for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2013 12:11:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTZsN-0006Vu-Aj for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 12:11:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTZsE-0007or-RX for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 12:11:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTZsE-0007oI-OC for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 12:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VTZsD-0000jp-W0 for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 12:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Anthony Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Oct 2013 16:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15562 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.13812486572824 (code B ref -1); Tue, 08 Oct 2013 16:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Oct 2013 16:10:57 +0000 Original-Received: from localhost ([127.0.0.1]:35169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTZs8-0000jT-Ll for submit@debbugs.gnu.org; Tue, 08 Oct 2013 12:10:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50629) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTZ6v-0007zX-5m for submit@debbugs.gnu.org; Tue, 08 Oct 2013 11:22:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTZ6m-0007fO-Gl for submit@debbugs.gnu.org; Tue, 08 Oct 2013 11:22:08 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTZ6m-0007fH-DI for submit@debbugs.gnu.org; Tue, 08 Oct 2013 11:22:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTZ6g-00080p-Ag for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 11:22:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTZ6Z-0007bA-6c for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 11:21:54 -0400 Original-Received: from [198.46.132.138] (port=48523 helo=jo.hnanthony.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTZ6Z-0007b1-1U for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 11:21:47 -0400 Original-Received: from jo.hnanthony.com (localhost.localdomain [127.0.0.1]) by jo.hnanthony.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id r98Er7Uo004004 for ; Tue, 8 Oct 2013 18:53:07 +0400 Original-Received: (from john@localhost) by jo.hnanthony.com (8.14.3/8.14.3/Submit) id r98Er6N9004003 for bug-gnu-emacs@gnu.org; Tue, 8 Oct 2013 18:53:06 +0400 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Tue, 08 Oct 2013 12:10:54 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79038 Archived-At: --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hey there, everybody. My first patch here. I noticed in etc/TODO that all major modes should really have an appropriate menu, so I thought I'd run through them and add all the missing ones. I'm a first-time contributor and have been informed (through etc/CONTRIBUTE) that if I'm intending to supply over ~15LOC I will need to sign some paperwork and return it - I am interested in doing this and continuing to contribute to Emacs as a steady thing for a long time. I don't know how to go about requesting this. Should I continue to supply patches here even whilst this is not sorted? Patch is attached for Text Mode and I hope it's acceptable. I completely aped the existing implementations from modes that manually make the menu (rather than use easy-menu-define) so hopefully it's nothing too controversial. * lisp/textmode/text-mode.el: Added menu bindings to text-mode-map -- John Anthony --Q68bSM7Ycu6FN28Q Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="text-mode-menu.patch" diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index d9ff04c..8ffa820 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -51,6 +51,27 @@ Use (derived-mode-p 'text-mode) instead.") (defvar text-mode-map (let ((map (make-sparse-keymap))) (define-key map "\e\t" 'ispell-complete-word) + (define-key map [menu-bar text] + (cons "Text" (make-sparse-keymap "Text"))) + (bindings--define-key map [menu-bar text toggle-text-mode-auto-fill] + '(menu-item "Auto Fill" toggle-text-mode-auto-fill + :button (:toggle . (memq 'turn-on-auto-fill text-mode-hook)) + :help "Toggle auto fill within text modes")) + (bindings--define-key map [menu-bar text paragraph-indent-minor-mode] + '(menu-item "Paragraph Indent" paragraph-indent-minor-mode + :button (:toggle . (bound-and-true-p paragraph-indent-minor-mode)) + :help "Toggle paragraph indent minor mode")) + (bindings--define-key map [menu-bar text sep] menu-bar-separator) + (bindings--define-key map [menu-bar text center-region] + '(menu-item "Center Region" center-region + :help "Center the marked region" + :enable (region-active-p))) + (bindings--define-key map [menu-bar text center-paragraph] + '(menu-item "Center Paragraph" center-paragraph + :help "Center the current paragraph")) + (bindings--define-key map [menu-bar text center-line] + '(menu-item "Center Line" center-line + :help "Center the current line")) map) "Keymap for `text-mode'. Many other modes, such as `mail-mode', `outline-mode' and `indented-text-mode', --Q68bSM7Ycu6FN28Q--