[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Text Mode Menu

From: John Anthony
Subject: Text Mode Menu
Date: Sat, 5 Oct 2013 06:14:56 +0400
User-agent: Mutt/1.5.20 (2009-06-14)

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 
+                  :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"))
   "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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]