Mercurial > emacs
changeset 85920:e5cfe61bd903
(expand-abbrev): Move point back to expansion's end.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 04 Nov 2007 02:57:52 +0000 |
parents | b2be0877a9f3 |
children | 1915d983e65a |
files | lisp/ChangeLog lisp/abbrev.el |
diffstat | 2 files changed, 16 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sun Nov 04 01:26:09 2007 +0000 +++ b/lisp/ChangeLog Sun Nov 04 02:57:52 2007 +0000 @@ -1,3 +1,7 @@ +2007-11-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * abbrev.el (expand-abbrev): Move point back to expansion's end. + 2007-11-04 Glenn Morris <rgm@gnu.org> * net/tls.el: Don't require rx when compiling. @@ -18,8 +22,8 @@ 2007-11-03 Michael Olson <mwolson@gnu.org> - * textmodes/remember.el (remember-buffer): Use - define-obsolete-function-alias rather than defalias. + * textmodes/remember.el (remember-buffer): + Use define-obsolete-function-alias rather than defalias. 2007-11-03 Ulrich Mueller <ulm@gentoo.org> (tiny change) @@ -35,8 +39,8 @@ uncomment-region-function and comment-insert-comment-function. (fortran-uncomment-region): New function. - * textmodes/nroff-mode.el (nroff-mode): Set - comment-insert-comment-function rather than indent-line-function. + * textmodes/nroff-mode.el (nroff-mode): + Set comment-insert-comment-function rather than indent-line-function. (nroff-indent-line-function): Remove. (nroff-insert-comment-function): New function.
--- a/lisp/abbrev.el Sun Nov 04 01:26:09 2007 +0000 +++ b/lisp/abbrev.el Sun Nov 04 02:57:52 2007 +0000 @@ -753,9 +753,11 @@ ;; If this abbrev has an expansion, delete the abbrev ;; and insert the expansion. (when (stringp (symbol-value sym)) - (goto-char wordend) + (goto-char wordstart) + ;; Insert at beginning so that markers at the end (e.g. point) + ;; are preserved. (insert (symbol-value sym)) - (delete-region wordstart wordend) + (delete-char (- wordend wordstart)) (let ((case-fold-search nil)) ;; If the abbrev's name is different from the buffer text (the ;; only difference should be capitalization), then we may want @@ -778,7 +780,10 @@ (goto-char wordstart) (skip-syntax-forward "^w" (1- end)) ;; Change just that. - (upcase-initials-region (point) (1+ (point)))))))) + (upcase-initials-region (point) (1+ (point))) + (goto-char end)))))) + ;; Now point is at the end of the expansion and the beginning is + ;; in last-abbrev-location. (when (symbol-function sym) (let* ((hook (symbol-function sym)) (expanded