From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Anthony Newsgroups: gmane.emacs.devel Subject: Text Mode Menu Date: Sat, 5 Oct 2013 06:14:56 +0400 Message-ID: <20131005021456.GA22666@jo.hnanthony.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1380939379 25897 80.91.229.3 (5 Oct 2013 02:16:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Oct 2013 02:16:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 05 04:16:22 2013 Return-path: Envelope-to: ged-emacs-devel@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 1VSHPq-0002pp-G2 for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2013 04:16:22 +0200 Original-Received: from localhost ([::1]:50393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSHPp-0007mx-Gv for ged-emacs-devel@m.gmane.org; Fri, 04 Oct 2013 22:16:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSHPh-0007mq-BE for emacs-devel@gnu.org; Fri, 04 Oct 2013 22:16:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSHPb-0007Nt-B2 for emacs-devel@gnu.org; Fri, 04 Oct 2013 22:16:13 -0400 Original-Received: from [198.46.132.138] (port=44333 helo=jo.hnanthony.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSHPb-0007Lx-67 for emacs-devel@gnu.org; Fri, 04 Oct 2013 22:16:07 -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 r952EuCA022677 for ; Sat, 5 Oct 2013 06:14:57 +0400 Original-Received: (from john@localhost) by jo.hnanthony.com (8.14.3/8.14.3/Submit) id r952EuVA022676 for emacs-devel@gnu.org; Sat, 5 Oct 2013 06:14:56 +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-Received-From: 198.46.132.138 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163866 Archived-At: Hello, everybody. I'm preparing to bundle up my first patch (hopefully of many) to send off to bug-gnu-emacs and I thought I'd ask for any style advice or really any advice in general I can get before doing so in the hopes of being successful. Here's the patch: diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index d9ff04c..d4e65a7 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -51,6 +51,26 @@ 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 "Text Mode 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 Minor Mode" 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 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', I aped the style of lisp-mode.el, so hopefully I won't have gone too far wrong. Please do tell me if I'm about to do something totally wrong and feel free to ignore me if I'm being unnecessarily cautious. If I'm being so cautious that I'm wasting peoples' time by asking about this here rather than just sending it to bug-gnu-emacs then please do tell me. Thanks in advance, everyone. -- JA