diff options
| author | Richard M. Stallman | 1996-08-01 04:54:51 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-08-01 04:54:51 +0000 |
| commit | 07e47d0b701f8dd07b6352c87ac1dee4da5b2d79 (patch) | |
| tree | 33fa25f834c009981963b5bc800d3139c0070812 | |
| parent | 09af8ae6afa3d3a59b7f49de2aa375d601f74a82 (diff) | |
| download | emacs-07e47d0b701f8dd07b6352c87ac1dee4da5b2d79.tar.gz emacs-07e47d0b701f8dd07b6352c87ac1dee4da5b2d79.zip | |
(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.
| -rw-r--r-- | lisp/dabbrev.el | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index ed17557170f..3396ef34564 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el | |||
| @@ -438,7 +438,14 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." | |||
| 438 | (markerp dabbrev--last-abbrev-location) | 438 | (markerp dabbrev--last-abbrev-location) |
| 439 | (marker-position dabbrev--last-abbrev-location) | 439 | (marker-position dabbrev--last-abbrev-location) |
| 440 | (= (point) (1+ dabbrev--last-abbrev-location))) | 440 | (= (point) (1+ dabbrev--last-abbrev-location))) |
| 441 | (progn | 441 | (let* ((prev-expansion |
| 442 | (buffer-substring-no-properties | ||
| 443 | (- dabbrev--last-abbrev-location (length dabbrev--last-expansion)) | ||
| 444 | dabbrev--last-abbrev-location)) | ||
| 445 | ;; If the previous expansion was upcased. | ||
| 446 | ;; upcase this one too. | ||
| 447 | (upcase-it | ||
| 448 | (equal prev-expansion (upcase prev-expansion)))) | ||
| 442 | ;; The "abbrev" to expand is just the space. | 449 | ;; The "abbrev" to expand is just the space. |
| 443 | (setq abbrev " ") | 450 | (setq abbrev " ") |
| 444 | (save-excursion | 451 | (save-excursion |
| @@ -459,6 +466,8 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." | |||
| 459 | (setq expansion | 466 | (setq expansion |
| 460 | (buffer-substring dabbrev--last-expansion-location | 467 | (buffer-substring dabbrev--last-expansion-location |
| 461 | (point))) | 468 | (point))) |
| 469 | (if upcase-it | ||
| 470 | (setq expansion (upcase expansion))) | ||
| 462 | 471 | ||
| 463 | ;; Record the end of this expansion, in case we repeat this. | 472 | ;; Record the end of this expansion, in case we repeat this. |
| 464 | (setq dabbrev--last-expansion-location (point))) | 473 | (setq dabbrev--last-expansion-location (point))) |
| @@ -756,9 +765,11 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." | |||
| 756 | (substring expansion 0 (length abbrev))) | 765 | (substring expansion 0 (length abbrev))) |
| 757 | (not (string= abbrev (downcase abbrev))) | 766 | (not (string= abbrev (downcase abbrev))) |
| 758 | (not (string= abbrev (upcase abbrev)))) | 767 | (not (string= abbrev (upcase abbrev)))) |
| 759 | (setq use-case-replace nil) | 768 | (setq use-case-replace nil)) |
| 760 | (if use-case-replace | 769 | (if (equal abbrev " ") |
| 761 | (setq expansion (downcase expansion)))) | 770 | (setq use-case-replace nil)) |
| 771 | (if use-case-replace | ||
| 772 | (setq expansion (downcase expansion))) | ||
| 762 | (if old | 773 | (if old |
| 763 | (save-excursion | 774 | (save-excursion |
| 764 | (search-backward old)) | 775 | (search-backward old)) |