unofficial mirror of bug-gnu-emacs@gnu.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

* bug#15562: [PATCH] Text Mode Menu
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2013-10-08 17:19 UTC (permalink / raw)
  To: John Anthony; +Cc: 15562

John Anthony wrote:

> 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.

Thanks and welcome! I will send you a form off-list to get started with
this.

>  Should I continue to supply patches here even whilst this is not
> sorted?

Yes please.

(IMO, bug-gnu-emacs is better for (finished) patches than emacs-devel,
since they are less likely to get lost here.)





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

* bug#15562: [PATCH] Text Mode Menu
  2013-10-08 17:19 ` Glenn Morris
@ 2013-10-08 17:45   ` John Anthony
  0 siblings, 0 replies; 4+ messages in thread
From: John Anthony @ 2013-10-08 17:45 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 15562

> Thanks and welcome! I will send you a form off-list to get started with
> this.

Thankyou -- I've completed and sent the form. Glad to be involved.

> (IMO, bug-gnu-emacs is better for (finished) patches than emacs-devel,
> since they are less likely to get lost here.)

I thought as much. I did take some time to try and become more
familiar with the lists before contributing and I think I have a feel
for how each should be used. I went to emacs-devel in an attempt to be
too cautious rather than too brash.

-- 
John Anthony





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

* bug#15562: [PATCH] Text Mode Menu
  2013-10-08 14:53 bug#15562: [PATCH] Text Mode Menu John Anthony
  2013-10-08 17:19 ` Glenn Morris
@ 2013-10-10  0:28 ` Glenn Morris
  1 sibling, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2013-10-10  0:28 UTC (permalink / raw)
  To: 15562-done

Version: 24.4

Applied, thanks.





^ permalink raw reply	[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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).