unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Allen Li <vianchielfaura@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 25767@debbugs.gnu.org
Subject: bug#25767: [PATCH] 25.1.91; abbrev-prefix-mark expansion inserts newline
Date: Thu, 23 Feb 2017 21:34:59 -0800	[thread overview]
Message-ID: <CAJr1M6fq2JzjwwW4nyPxN49eongjgj3g0W4+FuCEqh9ePimJZg@mail.gmail.com> (raw)
In-Reply-To: <CAJr1M6dpjtXXtJ146CTrfHou9Ckk71gw3KKFVjiL=pO4hoMh+w@mail.gmail.com>

Here's the quick fix.  I will opt out of doing more invasive refactoring.

I tried running abbrev-tests.el, but they don't seem to pass, even
without my change.  I am running these tests by: (eval-buffer)
followed by (ert).

I am getting undefined variable errors that I can fix with (require
'obarray).  Am I running these tests incorrectly or should I add a
(require 'obarray) to abbrev-tests.el?

I am also getting a type error for abbrev-table-p-test unrelated to my change.

There appear to be no tests for the actual abbrev expansion.

---
 lisp/abbrev.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index cbc604c23d..01ad3d478f 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)
-- 
2.11.1





  parent reply	other threads:[~2017-02-24  5:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17  0:49 bug#25767: 25.1.91; abbrev-prefix-mark expansion inserts newline Allen Li
2017-02-17 22:15 ` Allen Li
2017-02-18  8:09   ` Eli Zaretskii
2017-02-24  5:34 ` Allen Li [this message]
2017-02-24 14:26   ` bug#25767: [PATCH] " Noam Postavsky
2017-02-25  4:58     ` Allen Li
2017-02-28  4:47       ` npostavs
2017-03-02  6:35         ` Allen Li
2017-03-03  0:06   ` npostavs
2017-03-03  8:39     ` Eli Zaretskii
2017-03-03 10:34       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJr1M6fq2JzjwwW4nyPxN49eongjgj3g0W4+FuCEqh9ePimJZg@mail.gmail.com \
    --to=vianchielfaura@gmail.com \
    --cc=25767@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).