]> git.eshelyaron.com Git - emacs.git/commitdiff
(dabbrev-expand): When no more expansions,
authorRichard M. Stallman <rms@gnu.org>
Fri, 20 Oct 1995 20:30:22 +0000 (20:30 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 20 Oct 1995 20:30:22 +0000 (20:30 +0000)
Put back the original abbrev with its original case pattern.

lisp/dabbrev.el

index a28c90235711516fdeee38b851266dfb21a4d867..8dbe0629239ce3c6222b2e3e081fc42ec1021263 100644 (file)
@@ -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