# HG changeset patch # User Richard M. Stallman # Date 838875291 0 # Node ID 63076f19cbc5bbd390c935e6dff0e70110148949 # Parent 08e349d3fa146d88c0ba967fab438b308732272b (dabbrev-expand): When snarfing consecutive words, if previous one was upcased, upcase this one too. (dabbrev--substitute-expansion): When snarfing consecutive words, don't case convert here. diff -r 08e349d3fa14 -r 63076f19cbc5 lisp/dabbrev.el --- a/lisp/dabbrev.el Wed Jul 31 23:18:49 1996 +0000 +++ b/lisp/dabbrev.el Thu Aug 01 04:54:51 1996 +0000 @@ -438,7 +438,14 @@ (markerp dabbrev--last-abbrev-location) (marker-position dabbrev--last-abbrev-location) (= (point) (1+ dabbrev--last-abbrev-location))) - (progn + (let* ((prev-expansion + (buffer-substring-no-properties + (- dabbrev--last-abbrev-location (length dabbrev--last-expansion)) + dabbrev--last-abbrev-location)) + ;; If the previous expansion was upcased. + ;; upcase this one too. + (upcase-it + (equal prev-expansion (upcase prev-expansion)))) ;; The "abbrev" to expand is just the space. (setq abbrev " ") (save-excursion @@ -459,6 +466,8 @@ (setq expansion (buffer-substring dabbrev--last-expansion-location (point))) + (if upcase-it + (setq expansion (upcase expansion))) ;; Record the end of this expansion, in case we repeat this. (setq dabbrev--last-expansion-location (point))) @@ -756,9 +765,11 @@ (substring expansion 0 (length abbrev))) (not (string= abbrev (downcase abbrev))) (not (string= abbrev (upcase abbrev)))) - (setq use-case-replace nil) - (if use-case-replace - (setq expansion (downcase expansion)))) + (setq use-case-replace nil)) + (if (equal abbrev " ") + (setq use-case-replace nil)) + (if use-case-replace + (setq expansion (downcase expansion))) (if old (save-excursion (search-backward old))