From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#25767: 25.1.91; abbrev-prefix-mark expansion inserts newline Date: Fri, 17 Feb 2017 14:15:07 -0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1487369780 21217 195.159.176.226 (17 Feb 2017 22:16:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Feb 2017 22:16:20 +0000 (UTC) To: 25767@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 17 23:16:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceqp0-0004HR-Fr for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2017 23:16:10 +0100 Original-Received: from localhost ([::1]:56303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceqp0-0003nR-OL for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2017 17:16:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceqot-0003nB-SP for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 17:16:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceqot-0008QC-1G for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 17:16:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45690) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceqos-0008Q8-Tu for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 17:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ceqos-0006lm-GL for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 17:16:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2017 22:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148736971825968 (code B ref -1); Fri, 17 Feb 2017 22:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Feb 2017 22:15:18 +0000 Original-Received: from localhost ([127.0.0.1]:43889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceqo9-0006km-QK for submit@debbugs.gnu.org; Fri, 17 Feb 2017 17:15:17 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceqo8-0006ka-Dr for submit@debbugs.gnu.org; Fri, 17 Feb 2017 17:15:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceqo2-0008AC-En for submit@debbugs.gnu.org; Fri, 17 Feb 2017 17:15:11 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41382) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ceqo2-0008A7-BN for submit@debbugs.gnu.org; Fri, 17 Feb 2017 17:15:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceqo1-0003i4-8W for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 17:15:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceqo0-00087S-EA for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 17:15:09 -0500 Original-Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:33682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceqo0-00087B-9T for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 17:15:08 -0500 Original-Received: by mail-vk0-x233.google.com with SMTP id k127so37055309vke.0 for ; Fri, 17 Feb 2017 14:15:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=TdmWMvxxwWbsx0hAMvYyg4HMAKf5+6cYbe4JnpnxZ5M=; b=AMFitJWRSXpLQJByRhu09skXzX0VrpxDVXALOGAuKDJiZvK5qlpQ3mvHR1AjCM7l+c AYvDsiu+01j0ZMoeC7JPD10KYgkt/Z0ZzcQyZYbZ9XoI0CZtuazlRJpvnEzMNrz7ORlQ 1LODLsXFMfdzjpr5hoS70n+BCqaSXqtaOfbwKeVh7ZohYJm6PTsVil5GTioD2+ooa37k X3aYlVK3h0iOa2/zaWJcbsWJ4hCDLRUxyaq5/EsfbijQGJtGwa1pB3RWRCnYp0+j3CXN JxwTEgji95/9wR/hMnAnDjZUYSMXOu+H94Ay5i0RbBopJKH/rNrhlQOFTdV7xy2st+Bd k2fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=TdmWMvxxwWbsx0hAMvYyg4HMAKf5+6cYbe4JnpnxZ5M=; b=R81uvVfqdmOkT1u+0r2MpgopwfF+2ku9v4ICuRrkckv9mry33AkvGdcDZDRy5fOi0g ANnWFFcGro8xZrxbDMKE5l3U/9RdbOujzbWqtbs193AUo5WCFE5PBQ2MhX4MIe6Avlv7 tbj42mxpEDenoi0EYF2yyz+i4ozzTSGqG+kFZ1lrieadRWUkqRrAfWLXjTvZ+akKcmCV Wf1CDyR2D0lRt8sZML+ULmf3WWX8xB0mwnH488W2A3Gk4lF5GMEZvGxg/O+WcCTHRMYV fqUyUnFsvksj7px9Haij0ezxTSDx+nZbDJjKyu3ti5I150+Wsm0J920xVwjv7D5eyHaD G+mw== X-Gm-Message-State: AMke39mvds2M/lxwZ0E2ojE7xV8ITIsWqzqxevtXfk8Hogyd9NSmogZC4MgZMTWSJ6Cdl7pXY0WhvSPc45j4xQ== X-Received: by 10.31.79.132 with SMTP id d126mr5030561vkb.24.1487369707537; Fri, 17 Feb 2017 14:15:07 -0800 (PST) Original-Received: by 10.103.120.66 with HTTP; Fri, 17 Feb 2017 14:15:07 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129465 Archived-At: 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.)