diff options
| author | Allen Li | 2017-03-02 07:56:53 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2017-03-02 19:01:18 -0500 |
| commit | c733d9169ce44f5600d41cf0e67e021371954c8e (patch) | |
| tree | a6b7f9db31b33f4f8bbdbdc5864cc2340abbe0e9 /lisp | |
| parent | 6a9ba271a956127e566192b33fc811e802d2d475 (diff) | |
| download | emacs-c733d9169ce44f5600d41cf0e67e021371954c8e.tar.gz emacs-c733d9169ce44f5600d41cf0e67e021371954c8e.zip | |
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 "-".
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/abbrev.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index cbc604c23d6..01ad3d478fc 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -720,9 +720,10 @@ then ABBREV is looked up in that table only." | |||
| 720 | (setq start abbrev-start-location) | 720 | (setq start abbrev-start-location) |
| 721 | (setq abbrev-start-location nil) | 721 | (setq abbrev-start-location nil) |
| 722 | ;; Remove the hyphen inserted by `abbrev-prefix-mark'. | 722 | ;; Remove the hyphen inserted by `abbrev-prefix-mark'. |
| 723 | (if (and (< start (point-max)) | 723 | (when (and (< start (point-max)) |
| 724 | (eq (char-after start) ?-)) | 724 | (eq (char-after start) ?-)) |
| 725 | (delete-region start (1+ start))) | 725 | (delete-region start (1+ start)) |
| 726 | (setq pos (1- pos))) | ||
| 726 | (skip-syntax-backward " ") | 727 | (skip-syntax-backward " ") |
| 727 | (setq end (point)) | 728 | (setq end (point)) |
| 728 | (when (> end start) | 729 | (when (> end start) |