[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#684: 23.0.60; text-mode redefines "\es", the new search-map prefix
From: |
Juri Linkov |
Subject: |
bug#684: 23.0.60; text-mode redefines "\es", the new search-map prefix |
Date: |
Thu, 21 Aug 2008 23:43:28 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) |
>> > Text-Mode redefines the new search-map prefix "\es" with
>> > center-line. Maybe this needs to be changed too.
>>
>> Instead of removing these useful commands from key bindings,
>> I think we should find a good replacement.
>>
>> Starting from Emacs 22 we dedicated a special prefix map M-o
>> just for such formatting commands. So I propose to move these
>> commands to the following keys:
>>
>> M-o M-s center-line
>> M-o M-S center-paragraph
>
> Isn't the M-o prefix key used for text properties? I don't think it's
> such a good fit. Maybe M-g would be better. WDYT?
M-g was intended for navigation commands ("goto" mnemonics), and
M-o for formatting commands (see (emacs) Formatted Text).
I think center-line and center-paragraph are more formatting
than navigation commands.
If this is ok then the following patch implements this.
It binds `M-o M-s' and `M-o M-S' globally after loading
text-mode.el. This is perfectly fine since these bindings
have no conflicts with other modes.
Index: lisp/textmodes/text-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/text-mode.el,v
retrieving revision 1.55
diff -c -r1.55 text-mode.el
*** lisp/textmodes/text-mode.el 6 May 2008 04:33:13 -0000 1.55
--- lisp/textmodes/text-mode.el 21 Aug 2008 20:43:55 -0000
***************
*** 50,62 ****
(defvar text-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\e\t" 'ispell-complete-word)
- (define-key map "\es" 'center-line)
- (define-key map "\eS" 'center-paragraph)
map)
"Keymap for `text-mode'.
Many other modes, such as `mail-mode', `outline-mode' and
`indented-text-mode',
inherit all the commands defined in this map.")
(define-derived-mode text-mode nil "Text"
"Major mode for editing text written for humans to read.
--- 50,63 ----
(defvar text-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\e\t" 'ispell-complete-word)
map)
"Keymap for `text-mode'.
Many other modes, such as `mail-mode', `outline-mode' and
`indented-text-mode',
inherit all the commands defined in this map.")
+ (define-key facemenu-keymap "\es" 'center-line)
+ (define-key facemenu-keymap "\eS" 'center-paragraph)
+
(define-derived-mode text-mode nil "Text"
"Major mode for editing text written for humans to read.
--
Juri Linkov
http://www.jurta.org/emacs/