# HG changeset patch # User Richard M. Stallman # Date 807088129 0 # Node ID c3cb2b06e05f7466b75814d0662b1e5a32c594b4 # Parent 48786c683506ac44557037b76c83af7027a5c9b2 (dabbrev-expand): Save previous point for undo. diff -r 48786c683506 -r c3cb2b06e05f lisp/dabbrev.el --- a/lisp/dabbrev.el Sun Jul 30 07:07:39 1995 +0000 +++ b/lisp/dabbrev.el Sun Jul 30 07:08:49 1995 +0000 @@ -415,7 +415,7 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." (interactive "*P") - (let (abbrev expansion old direction) + (let (abbrev expansion old direction (orig-point (point))) ;; abbrev -- the abbrev to expand ;; expansion -- the expansion found (eventually) or nil until then ;; old -- the text currently in the buffer @@ -489,6 +489,7 @@ (dabbrev--reset-global-variables) (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)))) (error "No%s dynamic expansion for `%s' found" @@ -507,6 +508,7 @@ (setq dabbrev--last-expansion-location (copy-marker dabbrev--last-expansion-location))) ;; Success: stick it in and return. + (setq buffer-undo-list (cons orig-point buffer-undo-list)) (dabbrev--substitute-expansion old abbrev expansion) ;; Save state for re-expand. (setq dabbrev--last-expansion expansion)