unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 684@emacsbugs.donarmstrong.com, emacs-devel@gnu.org
Subject: Re: bug#684: 23.0.60; text-mode redefines "\es", the new search-map prefix
Date: Thu, 21 Aug 2008 23:43:28 +0300	[thread overview]
Message-ID: <87od3mt7yn.fsf@jurta.org> (raw)
In-Reply-To: <878wuq5rgy.fsf@cyd.mit.edu> (Chong Yidong's message of "Thu, 21 Aug 2008 11:15:57 -0400")

>> > 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.")
  
  \f
  (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)
+ 
  \f
  (define-derived-mode text-mode nil "Text"
    "Major mode for editing text written for humans to read.

-- 
Juri Linkov
http://www.jurta.org/emacs/




  reply	other threads:[~2008-08-21 20:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21 15:15 bug#684: 23.0.60; text-mode redefines "\es", the new search-map prefix Chong Yidong
2008-08-21 20:43 ` Juri Linkov [this message]
2008-08-21 22:18   ` Chong Yidong
2008-08-25 15:45     ` Juri Linkov
2008-08-25 16:29       ` Chong Yidong
2008-08-25 20:33         ` Juri Linkov
2008-08-25 20:52           ` center-line on region (was: bug#684: 23.0.60; text-mode redefines "\es", the new search-map prefix) Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87od3mt7yn.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=684@emacsbugs.donarmstrong.com \
    --cc=cyd@stupidchicken.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 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).