From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe Date: Sat, 22 Oct 2016 15:49:57 -0600 Message-ID: <87shro6ol6.fsf@gmail.com> References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1477173202 10267 195.159.176.226 (22 Oct 2016 21:53:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Oct 2016 21:53:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 24766@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 22 23:53:18 2016 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 1by4E3-0001KL-Ld for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Oct 2016 23:53:11 +0200 Original-Received: from localhost ([::1]:38946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by4E6-0000oy-3s for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Oct 2016 17:53:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by4C1-0008It-Ht for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by4By-00051y-FR for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1by4By-00051u-C3 for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1by4By-0002pW-12 for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Oct 2016 21:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24766 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24766-submit@debbugs.gnu.org id=B24766.147717300910816 (code B ref 24766); Sat, 22 Oct 2016 21:51:01 +0000 Original-Received: (at 24766) by debbugs.gnu.org; 22 Oct 2016 21:50:09 +0000 Original-Received: from localhost ([127.0.0.1]:46647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by4B7-0002oO-Aw for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:50:09 -0400 Original-Received: from mail-it0-f52.google.com ([209.85.214.52]:37094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by4B6-0002oA-9Y for 24766@debbugs.gnu.org; Sat, 22 Oct 2016 17:50:08 -0400 Original-Received: by mail-it0-f52.google.com with SMTP id m138so71209637itm.0 for <24766@debbugs.gnu.org>; Sat, 22 Oct 2016 14:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dy7NHcYX1JsDUtdxYE9iEkG50kl4KqOoGQ8V1K0qDxc=; b=Vgjr3s5fkF1kpMEnu1j6AHpnp93jgzOa0XJ/5RJo94QJMwFc3KdeJvpqdtoKuk8xl8 Ox2du3cw8PsADtL2frcRvIANqccxiIJKoxXYiELJsl/ti2vPFXPDHhyLUqfrCFYZzmpV aZDugum/R5qPHwZV+7EcaR4JEU5PE2WiNnWdRUNBmp3JLVGFIGKhyZxZQY/vVDHqBhfy LwHP02GaR+Ir1Vnrm4vq1aBrd+o/r3oGH+xeDim41+JM7s9w5PE/bkjxmYf+SnN7CfDI jLJDZ2LfaaY4jB4tv4gykgoGf7yNn3NuYCjx1fDPiDzbCkAmsjvgokyppjhMMnOftSEr XgBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=dy7NHcYX1JsDUtdxYE9iEkG50kl4KqOoGQ8V1K0qDxc=; b=j93/ZrUPMFoZtNoFmjN1Uqe5Bn7mQPHd6Fng8Vt9vaH6HZHovXWIER1ML3AF5qWJAw bbPsLAqqA4JFEQh35oonT3Zrf1tvwKkyL4gnbUArsW+ypA0hn0bhJyh4mNrsAaaWBv7m fvLQ+QRFsSkkKagCPY3e9YRjDCSzMP4NNMQafzzh+qvmPIqCFWeDBnjrYCD9hdCMu6Ej aJDqidS2R73HogxR58xKRsqZtxqKaAewnSbx/MAOV8+h5zuNVEtENzsv+DB5ynZ9GGR5 9XqH1IMNRx4GT+lEIF40zHGICKja9x6EaO5/61xMmcrBdM1Lm4hBvzIVS6fB3Yu1OpRh TCYg== X-Gm-Message-State: ABUngve0MsYaezlL4jth9t28Cd9NfflAhxQqojDX7HX9GcKiKUX4nbAsWJePYIWKI98Wwg== X-Received: by 10.36.68.197 with SMTP id o188mr4522836ita.94.1477173002631; Sat, 22 Oct 2016 14:50:02 -0700 (PDT) Original-Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id f96sm4443153ioj.15.2016.10.22.14.50.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Oct 2016 14:50:02 -0700 (PDT) In-Reply-To: <83h984p3lb.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Oct 2016 22:48:32 +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:124859 Archived-At: Eli Zaretskii writes: >> From: Alex >> Cc: 24766@debbugs.gnu.org >> Date: Sat, 22 Oct 2016 13:40:57 -0600 >> >> >> The point does not move even when there are appropriate indentation >> >> points to move to. >> > >> > It doesn't move because that's what UNINDENTED-OK means. >> >> I took UNINTENDED-OK to mean that "if non-nil, nothing is done in the >> case that there are no appropriate indentation positions. If there are >> appropriate indentation positions, then it should indent as usual." >> >> The docstring could be improved to state that. > > Definitely. Would you like to give it a try? Sure. That would describe the behaviour that my diff brings -- does that mean that you're okay with the proposed change? >> The optional argument is implicitly mentioned as "unless >> this command is invoked with a numeric argument, in which case it >> does nothing." > > Well, that's not how we document such functions, right? Both the > effect of the argument, when used from Lisp, and the fact that it's > the prefix argument in interactive invocation, should be stated. Indeed. Though it seems, according to commit 1fd63d9b9bc249488ec12a49cc3a576baf8c788a, that you were the one to document it. ;-) >> > but other than fixing the documentation, I see >> > no reason to change the behavior. Am I missing something? >> >> IIUC the current behaviour essentially makes indent-relative-maybe a >> no-op. > > No, it's definitely not a no-op. It is only a no-op if the previous > non-blank line has no white space at its beginning, or the current > column is already past that first indentation point. IOW, > indent-relative-maybe only ever indents to the first indentation > point, and only when that indentation point is preceded by whitespace. Oh, I see. Sorry about missing that. For some reason I was only testing lines that started with non-whitespace. I feel more hesitant to change such old behaviour now, but I still think that it should be done. Here are the functions that call indent-relative-maybe or call indent-relative with an argument: * add-change-log-entry * mh-letter-next-header-field-or-indent * A few functions in AUCTeX (ELPA) I'm not sure if they should be changed, but if they should, a new function could be made to match the previous indent-relative-maybe behaviour: (let ((first-indent (save-excursion (re-search-backward "^[^\n]") (backward-to-indentation 0)))) (when (< (current-column) first-indent) (indent-to first-indent)))