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: [PATCH] 25.1.91; abbrev-prefix-mark expansion inserts newline Date: Thu, 23 Feb 2017 21:34:59 -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 1487914576 11444 195.159.176.226 (24 Feb 2017 05:36:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 24 Feb 2017 05:36:16 +0000 (UTC) Cc: 25767@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 24 06:36:12 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 1ch8Y3-00024W-M2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Feb 2017 06:36:07 +0100 Original-Received: from localhost ([::1]:34772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ch8Y8-0000vA-9J for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Feb 2017 00:36:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ch8Y1-0000uu-VC for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2017 00:36:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ch8Xy-0003He-SV for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2017 00:36:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55245) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ch8Xy-0003HY-Ol for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2017 00:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ch8Xy-0004lJ-Il for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2017 00:36: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, 24 Feb 2017 05:36: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: Original-Received: via spool by 25767-submit@debbugs.gnu.org id=B25767.148791450818223 (code B ref 25767); Fri, 24 Feb 2017 05:36:02 +0000 Original-Received: (at 25767) by debbugs.gnu.org; 24 Feb 2017 05:35:08 +0000 Original-Received: from localhost ([127.0.0.1]:53439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ch8X6-0004jr-B0 for submit@debbugs.gnu.org; Fri, 24 Feb 2017 00:35:08 -0500 Original-Received: from mail-ua0-f170.google.com ([209.85.217.170]:34976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ch8X3-0004jI-Mb for 25767@debbugs.gnu.org; Fri, 24 Feb 2017 00:35:06 -0500 Original-Received: by mail-ua0-f170.google.com with SMTP id 40so7392196uau.2 for <25767@debbugs.gnu.org>; Thu, 23 Feb 2017 21:35:05 -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:cc; bh=NQbNz5avldseg31pbng6wG4CPjAGlCu1OwC863m6/zw=; b=kl/hYE6CbbCiIFDJjFzuHq3RzLQybnR+ic0KhfvhSxg0JqE/rmZuoVemyaPNFo9RJS bg7khHbRRZb9jnPNjkwH2Go0HKcFl6o0WPfvE/ZV713pu4aEqcaOFRpBs2Am+AJuDMIs x7n5/mnEW7zIrYy80mV9k3wLtDOLcPXOuxIgKyoSTSYQCN28BRoVKfB3ySF60PknT3TP 5JsbV/NG0UgN6m+oHWpMdnkwaZZVXYnxOqPaUFgPtmJhag9XcNDzFM0Xdkd0yy+8PVvZ hBOJlgoedACJk/WG3QvgZ2j+2TypAaHqzwe3w/iNeM0xA5xQYRpUJv1SO+9LXtihSduD cOVA== 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:cc; bh=NQbNz5avldseg31pbng6wG4CPjAGlCu1OwC863m6/zw=; b=P9ZrmLh5z3nnoeD0+qTpTiJu6GUAETWTvSxtlJK/dqVpYs0eAFJfAXIcbJ3d/9xofX taav9KQkWV09vb7xJqxpYTBuYAVXmK4LscVakwnVDIIcKYhtERVbDHh6g4gdwNn5KhbO 7caYl1LfAwANt/iO2MEr+uNtoTnPQIg7mM74ID3u+V5oUIZYVYhSY2IYPas4DViGlpKg T92b4Bhs4HrYvd1t9veL5RVCh0uR4vUcEAnUUmzqg+YaLFQZiq15nLlJFq958qA8AktL vPy+pVbglIkk/2KhXjBIewrn63uNpWkhx5hyBfQZ6UH2iTGQmoe7xfl9W2OECt3oekQr bEbg== X-Gm-Message-State: AMke39m2Ja8z4RGcJXo37BbwOHcKuLQj586uo57b/jGURY397XBoeLLm1K2ovixiZWX5TupIQlKKHF9/t0hCXQ== X-Received: by 10.159.34.100 with SMTP id 91mr403903uad.137.1487914499893; Thu, 23 Feb 2017 21:34:59 -0800 (PST) Original-Received: by 10.103.108.196 with HTTP; Thu, 23 Feb 2017 21:34:59 -0800 (PST) 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:129708 Archived-At: 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