emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master c733d91 1/3: Stop abbrev-prefix-mark from adding ex


From: Noam Postavsky
Subject: [Emacs-diffs] master c733d91 1/3: Stop abbrev-prefix-mark from adding extra newline (Bug#25767)
Date: Thu, 2 Mar 2017 19:03:57 -0500 (EST)

branch: master
commit c733d9169ce44f5600d41cf0e67e021371954c8e
Author: Allen Li <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Stop abbrev-prefix-mark from adding extra newline (Bug#25767)
    
    `abbrev--before-point' does not adjust `pos' to account for when it
    deletes the "-" left by abbrev-prefix-mark.  Therefore, when
    `abbrev-before-point' goes to restore point, it moves point one
    character too far forward.
    
    * lisp/abbrev.el (abbrev--before-point): Adjust pos when deleting "-".
---
 lisp/abbrev.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index cbc604c..01ad3d4 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -720,9 +720,10 @@ then ABBREV is looked up in that table only."
           (setq start abbrev-start-location)
           (setq abbrev-start-location nil)
           ;; Remove the hyphen inserted by `abbrev-prefix-mark'.
-          (if (and (< start (point-max))
-                   (eq (char-after start) ?-))
-              (delete-region start (1+ start)))
+          (when (and (< start (point-max))
+                     (eq (char-after start) ?-))
+            (delete-region start (1+ start))
+            (setq pos (1- pos)))
           (skip-syntax-backward " ")
           (setq end (point))
           (when (> end start)



reply via email to

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