[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dabbrev--eliminate-newlines
From: |
Johan Bockgård |
Subject: |
dabbrev--eliminate-newlines |
Date: |
Tue, 24 Apr 2007 11:19:57 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (gnu/linux) |
1. dabbrev--eliminate-newlines is a defcustom--should it really have a
double-dash name?
2. It doesn't work correctly for SPC M-/.
Assume that the buffer contains this text (and
dabbrev--eliminate-newlines is t (the default)):
aaa
bbb
Then the sequence `a M-/ SPC M-/' produces this text:
aaa
bbb
(In Emacs 21 the result was "aaa bbb".)
In this case ABBREV is " ", i.e. POS = 1, in the code below
[dabbrev--substitute-expansion]. This has the effect that any
whitespace characters are converted, except the first one:
;; Convert whitespace to single spaces.
(if dabbrev--eliminate-newlines
;; Start searching at end of ABBREV so that any whitespace
;; carried over from the existing text is not changed.
(let ((pos (length abbrev)))
(while (string-match "[\n \t]+" expansion pos)
(setq pos (1+ (match-beginning 0)))
(setq expansion (replace-match " " nil nil expansion)))))
2003-01-05 Richard M. Stallman <address@hidden>
* dabbrev.el (dabbrev--substitute-expansion):
Convert all whitespace to single spaces,
except when it's carried over from the existing text.
--
Johan Bockgård
- dabbrev--eliminate-newlines,
Johan Bockgård <=