all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Anthony <john@jo.hnanthony.com>
To: emacs-devel@gnu.org
Subject: Text Mode Menu
Date: Sat, 5 Oct 2013 06:14:56 +0400	[thread overview]
Message-ID: <20131005021456.GA22666@jo.hnanthony.com> (raw)

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



             reply	other threads:[~2013-10-05  2:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-05  2:14 John Anthony [this message]
2013-10-05 14:24 ` Text Mode Menu Drew Adams
2013-10-07 15:47   ` John Anthony
2013-10-07 17:22     ` Drew Adams
2013-10-07 17:41       ` Davis Herring
2013-10-07 17:49         ` Drew Adams
2013-10-07 19:41       ` John Anthony
2013-10-07 20:44         ` Drew Adams
2013-10-07 21:52           ` John Anthony

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131005021456.GA22666@jo.hnanthony.com \
    --to=john@jo.hnanthony.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.