From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#32014: 26.1; lisp-indent-line fails in first line of Ielm Date: Sat, 30 Jun 2018 09:27:58 -0400 Message-ID: <87o9fsmmjl.fsf@gmail.com> References: <876021mb84.fsf@gmail.com> <87sh55m8b2.fsf@gmail.com> <831scoojfx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1530365233 22735 195.159.176.226 (30 Jun 2018 13:27:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2018 13:27:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: joaotavora@gmail.com, 32014@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 30 15:27:08 2018 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 1fZFu8-0005lo-4t for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jun 2018 15:27:08 +0200 Original-Received: from localhost ([::1]:46937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZFwD-0008UP-Py for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jun 2018 09:29:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZFw2-0008U1-Bk for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 09:29:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZFvy-0004dX-Da for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 09:29:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZFvy-0004dI-9a for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 09:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fZFvy-0008La-3a for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 09:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Jun 2018 13:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32014 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 32014-submit@debbugs.gnu.org id=B32014.153036528831991 (code B ref 32014); Sat, 30 Jun 2018 13:29:02 +0000 Original-Received: (at 32014) by debbugs.gnu.org; 30 Jun 2018 13:28:08 +0000 Original-Received: from localhost ([127.0.0.1]:40443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZFv6-0008Ju-8t for submit@debbugs.gnu.org; Sat, 30 Jun 2018 09:28:08 -0400 Original-Received: from mail-io0-f179.google.com ([209.85.223.179]:40812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZFv4-0008Ja-36 for 32014@debbugs.gnu.org; Sat, 30 Jun 2018 09:28:06 -0400 Original-Received: by mail-io0-f179.google.com with SMTP id t135-v6so10901949iof.7 for <32014@debbugs.gnu.org>; Sat, 30 Jun 2018 06:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/CmEsUUfYq5aBcB2hYrzepCGb8sTad+eSeg8eTDn/KY=; b=Tp5nDyOKe8fo0TnyLC1B2nhVgxErIwtHBB+NLfT43KkOoIT0FqJi0n8qrw2Ofh05KT Um6D9RhrGaAGwPmiqt+c37nWDUiFOB5Y0vkPOYy4Z9UkRENdHdj22IZZep29BYH2vXNM Lgi/VdJbDgZztu0i3NTNv0fjVDHA6Dxrcxxg5HaYWTV8VhTHv76Hi0WTv5r+zUE1TIWK W4DBRXTUT1GmiFHn78zziRCHR7oQcXdkgsVolWpXk5jCkYB3Qsf+hiTHuHV+lk6pbdu9 6EOJ+uFchhHAWRpoTMUObkvG4C6+xCjqTx7SQHMr8ZuOr16U1zckyjckP1G9oJBM9C4h mOrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=/CmEsUUfYq5aBcB2hYrzepCGb8sTad+eSeg8eTDn/KY=; b=MpnCqXYR0nvbMVmLjgXnX7JOwUNtAS5jF38l7Ef6v2hlsfLkkv9C+N2FAhwIW8nHpy +TTUc75eIkNs86uhp53V41q3HeSc9m3LxIMSl27aFxfwdFJbC8nMfgjqae+/w7GtWUbF 7CQFurkG66vEyWr5bVMsfG3zv4tlJRrV3bgDtS//LmIYk4WRYlfd2qP3YYFOA/UcKBWO vjOvK+J80VLFa2j9yMCcO5VS+ENZsvK30tCGsITIFLx+z3M30AYtPSjZv/kjSP2BxfAa vhheFDrP8a5r+IOkVrOlNMZr+fQ/3p6axwhJdZWXOiDvhbsyn38pjlZRjfvbmLL1gQLu dxgQ== X-Gm-Message-State: APt69E2MrlNHuvONAwG/g3hB580Tyendsrj3lhNE/SLr9ga56hb35wId xHq5ORYcGsHztnWIZw6Ig/4vzg== X-Google-Smtp-Source: AAOMgpfT9W4sCuf2WWe4TzY8rEaPWdQkZxgBzKcagDHJHHRJnUmJ8A/WwxrU997NZaGCLI3pRfU2Ng== X-Received: by 2002:a6b:38c6:: with SMTP id f189-v6mr14310878ioa.138.1530365280305; Sat, 30 Jun 2018 06:28:00 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id s3-v6sm4203332ioa.15.2018.06.30.06.27.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Jun 2018 06:27:59 -0700 (PDT) In-Reply-To: <831scoojfx.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Jun 2018 09:52:02 +0300") 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:148018 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > I'm not sure I'm okay with changing the behavior of > forward/backward-to-indentation like that. It's an incompatible > change, isn't it? The documentation doesn't seem to tell anything wrt > the behavior in presence of fields, but that doesn't mean we can make > such changes without considering the consequences. Can you tell why > you think this change is TRT? Hmm, the more I look at it, the less I understand why these functions even exist. There are hardly any uses of them. Maybe we should just do this instead: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Respect-field-boundaries-in-indent-line-to-Bug-32.patch Content-Description: patch >From a31918efdbdbf4c6d3f26ae7a73aba910f164116 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 30 Jun 2018 09:14:22 -0400 Subject: [PATCH v2] Respect field boundaries in indent-line-to (Bug#32014) * lisp/indent.el (indent-line-to): Use the back-to-indentation point as the end-point of whitespace removal, rather than backward-to-indentation which doesn't respect field boundaries. --- lisp/indent.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/indent.el b/lisp/indent.el index eb5b21e8e8..14efe8bfdf 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -300,8 +300,9 @@ indent-line-to (progn (skip-chars-backward " ") (point)))) (indent-to column)) ((> cur-col column) ; too far right (after tab?) - (delete-region (progn (move-to-column column t) (point)) - (progn (backward-to-indentation 0) (point))))))) + (let ((cur-indent (point))) + (delete-region (progn (move-to-column column t) (point)) + cur-indent)))))) (defun current-left-margin () "Return the left margin to use for this line. -- 2.11.0 --=-=-=--