all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15562: [PATCH] Text Mode Menu
@ 2013-10-08 14:53 John Anthony
  2013-10-08 17:19 ` Glenn Morris
  2013-10-10  0:28 ` Glenn Morris
  0 siblings, 2 replies; 4+ messages in thread
From: John Anthony @ 2013-10-08 14:53 UTC (permalink / raw)
  To: 15562

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

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

[-- Attachment #2: text-mode-menu.patch --]
[-- Type: text/x-diff, Size: 1729 bytes --]

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',

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-10  0:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 14:53 bug#15562: [PATCH] Text Mode Menu John Anthony
2013-10-08 17:19 ` Glenn Morris
2013-10-08 17:45   ` John Anthony
2013-10-10  0:28 ` Glenn Morris

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.