summaryrefslogtreecommitdiff
path: root/lisp/dabbrev.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2007-05-10 14:46:52 +0000
committerRichard M. Stallman <rms@gnu.org>2007-05-10 14:46:52 +0000
commite2e7506851231cb87c2e025dc8ba06ad95053de9 (patch)
tree78d641f9a6e5f67b2e901fa86f963011ec34203e /lisp/dabbrev.el
parentb52efb9fafe39ea3370a4a30d046915666e9ad2c (diff)
downloademacs-e2e7506851231cb87c2e025dc8ba06ad95053de9.tar.gz
(dabbrev-eliminate-newlines): Renamed from
dabbrev--eliminate-newlines. All uses changed.
Diffstat (limited to 'lisp/dabbrev.el')
-rw-r--r--lisp/dabbrev.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index ae16b52ee7d..1cfad105a95 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -128,7 +128,7 @@ Set this to nil if no characters should be skipped."
(const :tag "off" nil))
:group 'dabbrev)
-(defcustom dabbrev--eliminate-newlines t
+(defcustom dabbrev-eliminate-newlines t
"*Non-nil means dabbrev should not insert newlines.
Instead it converts them to spaces."
:type 'boolean
@@ -913,10 +913,12 @@ to record whether we upcased the expansion, downcased it, or did neither."
((equal abbrev (downcase abbrev)) 'downcase)))))
;; 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)))
+ (if dabbrev-eliminate-newlines
+ (let ((pos
+ (if (equal abbrev " ") 0 (length abbrev))))
+ ;; If ABBREV is real, search after the end of it.
+ ;; If ABBREV is space and we are copying successive words,
+ ;; search starting at the front.
(while (string-match "[\n \t]+" expansion pos)
(setq pos (1+ (match-beginning 0)))
(setq expansion (replace-match " " nil nil expansion)))))