unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* improve the behavior of overwrite mode (mainly for CJK users)
@ 2015-05-02  2:10 K. Handa
  2015-05-02  6:43 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: K. Handa @ 2015-05-02  2:10 UTC (permalink / raw)
  To: emacs-devel

I've got a report from a Japanese Emacs user proposing to change the
behavior of self-insert-command in overwrite mode.  Provided that we
have something like the following line (CJK double-width characters),
   あいうえお
point is at 'あ', and we are in overwrite mode, typing "aaaa" results in:
   a a a a お
but typing "\C-uaaaa" results in:
   aaaaうえお

The proposal is to make the former attempt result in the same as the
latter.  I too agree that it is more intuitive.  Attached is the patch
for that.  Shall I install it?




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

* improve the behavior of overwrite mode (mainly for CJK users)
@ 2015-05-02  2:13 K. Handa
  0 siblings, 0 replies; 4+ messages in thread
From: K. Handa @ 2015-05-02  2:13 UTC (permalink / raw)
  To: emacs-devel

Oops, I forgot to attach the patch in my previuos mail.  Here it is.

2015-05-02  K. Handa  <handa@gnu.org>

	* cmds.c (internal_self_insert): When we insert spaces for
	padding, set point before the padding spaces, not after them.

--- a/src/cmds.c
+++ b/src/cmds.c
@@ -473,7 +473,7 @@ internal_self_insert (int c, EMACS_INT n)
 	}
 
       replace_range (PT, PT + chars_to_delete, string, 1, 1, 1);
-      Fforward_char (make_number (n + spaces_to_insert));
+      Fforward_char (make_number (n));
     }
   else if (n > 1)
     {

---
K. Handa
handa@gnu.org

I wrote;
> I've got a report from a Japanese Emacs user proposing to change the
> behavior of self-insert-command in overwrite mode.  Provided that we
> have something like the following line (CJK double-width characters),
>    あいうえお
> point is at 'あ', and we are in overwrite mode, typing "aaaa" results in:
>    a a a a お
> but typing "\C-uaaaa" results in:
>    aaaaうえお
> 
> The proposal is to make the former attempt result in the same as the
> latter.  I too agree that it is more intuitive.  Attached is the patch
> for that.  Shall I install it?




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

* Re: improve the behavior of overwrite mode (mainly for CJK users)
  2015-05-02  2:10 improve the behavior of overwrite mode (mainly for CJK users) K. Handa
@ 2015-05-02  6:43 ` Stefan Monnier
  2015-05-02 13:43   ` K. Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2015-05-02  6:43 UTC (permalink / raw)
  To: K. Handa; +Cc: emacs-devel

> for that.  Shall I install it?

Yes, please,


        Stefan



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

* Re: improve the behavior of overwrite mode (mainly for CJK users)
  2015-05-02  6:43 ` Stefan Monnier
@ 2015-05-02 13:43   ` K. Handa
  0 siblings, 0 replies; 4+ messages in thread
From: K. Handa @ 2015-05-02 13:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

In article <jwvegmziin7.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > for that.  Shall I install it?
> Yes, please,

Ok, done.

---
K. Handa
handa@gnu.org



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

end of thread, other threads:[~2015-05-02 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-02  2:10 improve the behavior of overwrite mode (mainly for CJK users) K. Handa
2015-05-02  6:43 ` Stefan Monnier
2015-05-02 13:43   ` K. Handa
  -- strict thread matches above, loose matches on Subject: below --
2015-05-02  2:13 K. Handa

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