summaryrefslogtreecommitdiff
path: root/lisp/dabbrev.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-10-20 20:30:22 +0000
committerRichard M. Stallman <rms@gnu.org>1995-10-20 20:30:22 +0000
commit3132e11599f4b3792f1a0dfebf91a1d52422160e (patch)
tree168269f287536e04387f2c14a4961e91308b4cf1 /lisp/dabbrev.el
parent6dfa1d83fd3c647784d41c7561848daec5ddb29a (diff)
downloademacs-3132e11599f4b3792f1a0dfebf91a1d52422160e.tar.gz
(dabbrev-expand): When no more expansions,
Put back the original abbrev with its original case pattern.
Diffstat (limited to 'lisp/dabbrev.el')
-rw-r--r--lisp/dabbrev.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index a28c9023571..8dbe0629239 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -490,8 +490,10 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
(if old
(save-excursion
(setq buffer-undo-list (cons orig-point buffer-undo-list))
- (search-backward (substring old (length abbrev)))
- (delete-region (match-beginning 0) (match-end 0))))
+ ;; Put back the original abbrev with its original case pattern.
+ (search-backward old)
+ (insert abbrev)
+ (delete-region (point) (+ (point) (length old)))))
(error "No%s dynamic expansion for `%s' found"
(if old " further" "") abbrev))
(t