emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/abbrev.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/abbrev.el,v
Date: Sun, 04 Nov 2007 02:57:54 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/11/04 02:57:53

Index: abbrev.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/abbrev.el,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- abbrev.el   31 Oct 2007 15:47:02 -0000      1.58
+++ abbrev.el   4 Nov 2007 02:57:51 -0000       1.59
@@ -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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]