aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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."
128 (const :tag "off" nil)) 128 (const :tag "off" nil))
129 :group 'dabbrev) 129 :group 'dabbrev)
130 130
131(defcustom dabbrev--eliminate-newlines t 131(defcustom dabbrev-eliminate-newlines t
132 "*Non-nil means dabbrev should not insert newlines. 132 "*Non-nil means dabbrev should not insert newlines.
133Instead it converts them to spaces." 133Instead it converts them to spaces."
134 :type 'boolean 134 :type 'boolean
@@ -913,10 +913,12 @@ to record whether we upcased the expansion, downcased it, or did neither."
913 ((equal abbrev (downcase abbrev)) 'downcase))))) 913 ((equal abbrev (downcase abbrev)) 'downcase)))))
914 914
915 ;; Convert whitespace to single spaces. 915 ;; Convert whitespace to single spaces.
916 (if dabbrev--eliminate-newlines 916 (if dabbrev-eliminate-newlines
917 ;; Start searching at end of ABBREV so that any whitespace 917 (let ((pos
918 ;; carried over from the existing text is not changed. 918 (if (equal abbrev " ") 0 (length abbrev))))
919 (let ((pos (length abbrev))) 919 ;; If ABBREV is real, search after the end of it.
920 ;; If ABBREV is space and we are copying successive words,
921 ;; search starting at the front.
920 (while (string-match "[\n \t]+" expansion pos) 922 (while (string-match "[\n \t]+" expansion pos)
921 (setq pos (1+ (match-beginning 0))) 923 (setq pos (1+ (match-beginning 0)))
922 (setq expansion (replace-match " " nil nil expansion))))) 924 (setq expansion (replace-match " " nil nil expansion)))))