help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strange dabbrev for whole lines and double spaces in cvs Emacs 23


From: Peter Tury
Subject: strange dabbrev for whole lines and double spaces in cvs Emacs 23
Date: Wed, 7 Jan 2009 15:37:07 -0800 (PST)
User-agent: G2/1.0

Hi,

in a file I many times have to repeat the same line again an again.
They might have longer whitespace sequences (like e.g. double space:
"  ").

For this I customized `dabbrev-abbrev-char-regexp' to be a period (.)
meaning "any single character except a newline" will be counted as a
word constituent for dabbrev. It works inperfectly(?) for first time,
and this might result weird result after a repeated M-/ (dabbrev-
expand).

As I see double spaces makes M-/ crazy: first time it doesn't copy
them (just a simple one instead)...

Here is an example to reproduce the situation:

Try this text in a file
Try a second line with same starters and some  double spaces

Now I want to insert the first line ("Try this...") again as a new,
3rd line. If I type `T r M-/' it inserts "Try a second ..." almost
correctly, i.e. inserts "...some double..." instead of "...some
double...". (I think this contradicts to (info "(emacs) Dynamic
Abbrevs"), since it states: "The spacing and punctuation between words
is copied along with the words.")

But repeating M-/ (to insert the other matching line instead) leaves
the newly inserted 3rd line unchanged (="Try a second...") but
replaces the original 2nd line (="Try a second...") instead with the
first line (="Try this..."), so finally I get a complete mess, the
buffer has this:

Try this text in a file
Try this text in a file
Try a second line with same starters and some double spaces

It seems as if second M-/ would "continue" replacing from the wrong
point.

Please note:
1) if no double space is in the lines, everything is fine!
2) spacing is not kept anyway, i.e. without any customization (of
`dabbrev-abbrev-char-regexp') it neither works. Try this:

one  two  three

Then type o n M-/ <SPC> M-/
It gives
"one two" instead of "one  two". (Though punctiation is preserved if
exists well.)

Is this a bug?

Thanks,
P


reply via email to

[Prev in Thread] Current Thread [Next in Thread]