From: Richard M. Stallman Date: Fri, 20 Oct 1995 20:30:22 +0000 (+0000) Subject: (dabbrev-expand): When no more expansions, X-Git-Tag: emacs-19.34~2604 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3132e11599f4b3792f1a0dfebf91a1d52422160e;p=emacs.git (dabbrev-expand): When no more expansions, Put back the original abbrev with its original case pattern. --- 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