Subject: Re: bug#25767: 25.1.91; abbrev-prefix-mark expansion inserts newline

From: Allen Li <[email-masked]>
Date: Fri, 17 Feb 2017 14:15:07 -0800

The behavior was bugging me so I looked into it.  The root cause is
that `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 (in the repro example, moving past the
newline).

The fix is really easy, but I haven't contributed to Emacs before, so
I don't know the proper procedure.  (Also, the existing code really
bugs me; I would tear it out and replace it with (with-excursion) if
Emacs was my pet project that millions of users aren't depending on.)