From 3132e11599f4b3792f1a0dfebf91a1d52422160e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 20 Oct 1995 20:30:22 +0000 Subject: [PATCH] (dabbrev-expand): When no more expansions, Put back the original abbrev with its original case pattern. --- lisp/dabbrev.el | 6 ++++-- 1 file 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