1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-01 11:14:55 +00:00

(expand-abbrev): Move point back to expansion's end.

This commit is contained in:
Stefan Monnier 2007-11-04 02:57:52 +00:00
parent cd6db47c64
commit 1449012d63
2 changed files with 16 additions and 7 deletions

View File

@ -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.

View File

@ -753,9 +753,11 @@ Returns the abbrev symbol, if expansion took place."
;; 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 @@ Returns the abbrev symbol, if expansion took place."
(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