Mercurial > emacs
comparison lisp/dabbrev.el @ 80894:47f2f1844e89
(dabbrev-eliminate-newlines): Renamed from
dabbrev--eliminate-newlines. All uses changed.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 10 May 2007 14:46:52 +0000 |
parents | e3694f1cb928 |
children | 09cf7476abec d7172f202ab8 |
comparison
equal
deleted
inserted
replaced
80893:0ac6776ef7f7 | 80894:47f2f1844e89 |
---|---|
126 Set this to nil if no characters should be skipped." | 126 Set this to nil if no characters should be skipped." |
127 :type '(choice regexp | 127 :type '(choice regexp |
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. |
133 Instead it converts them to spaces." | 133 Instead it converts them to spaces." |
134 :type 'boolean | 134 :type 'boolean |
135 :group 'dabbrev) | 135 :group 'dabbrev) |
136 | 136 |
911 (and use-case-replace | 911 (and use-case-replace |
912 (cond ((equal abbrev (upcase abbrev)) 'upcase) | 912 (cond ((equal abbrev (upcase abbrev)) 'upcase) |
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))))) |
923 | 925 |
924 (if old | 926 (if old |