From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:01:40 2016 Received: (at submit) by debbugs.gnu.org; 22 Oct 2016 19:01:40 +0000 Received: from localhost ([127.0.0.1]:46577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by1Y4-0005WW-IO for submit@debbugs.gnu.org; Sat, 22 Oct 2016 15:01:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by1Y3-0005WH-5r for submit@debbugs.gnu.org; Sat, 22 Oct 2016 15:01:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by1Xx-0006Gv-7q for submit@debbugs.gnu.org; Sat, 22 Oct 2016 15:01:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1by1Xx-0006Gr-4T for submit@debbugs.gnu.org; Sat, 22 Oct 2016 15:01:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by1Xv-0006Df-W2 for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 15:01:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by1Xs-0006GP-Tu for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 15:01:32 -0400 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:32976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1by1Xs-0006GI-PQ for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 15:01:28 -0400 Received: by mail-it0-x241.google.com with SMTP id k64so4231936itb.0 for ; Sat, 22 Oct 2016 12:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version; bh=VLu6e2gnTUYRGIvHnJVjJHphq61g6Sf219BCDjzoZGw=; b=ygiaHSzJmcRe7aOtVJGRHfDJcY7Ey2L7T6zoOtW4zrWdj4Dywel6NdDXDK+1Sq2pAu 5VYDZyH+XeHMOqz53vn7JiMbpgJsX2WBNTNjgxpZfcR0Q9jxPDBmrrIF9tu9CTH4h8HK TcWYAoPV3Z0iwAHeGRZKuLNxEjqcot98F0TYOjpDKqOoqHxnt5fMuuZESpUBeBu9UZ/0 tNONa8ibJ5vxmj6VMXJubbitUdEDXVZ08HNtGNxtAMBQVKLYKfTD+ktqv7KNCSWMKpIe poKDSUQG/sbX4EeR5F3kfoWWAntmbD75BaURSeGayO32ow1WE4507oQ6UDiUhlJSjSo6 djsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=VLu6e2gnTUYRGIvHnJVjJHphq61g6Sf219BCDjzoZGw=; b=Y2LsZZziBW6dXFLfRzvhZPTlmAB/aNxIaCSkTqVPuaVudR20mvYvrn7PZv2+MuuJFR hg9EhBviB257mES83X8GN2qx/hhWTlcXDdBa7KzprAZk8+knEIQcNWjsFxBymXOBWmDK a+gWpvzv3jDYCu5CDsjegfp+4hhblH9DMFMFbEFNHjMx5CifmmCNdGZdl7sAKyyoH3qt 8Oal0sO6b9gb5r+vPdppC2BbZ/PUcfQIrckFz/NSw9/XfaabC406eB+uQShmBBHDrPAg /BC35swo4WarZs9X4+6PuIOArNDNSrGWz8QIEPs06S17DUhXDf1/C8BmEsm6ibv77UrS jvrA== X-Gm-Message-State: ABUngved7TmfJSw3ZnhJ1iPDPPcJUptR4SXtvnvVbp+arzx78qTUc7v8W7qAiB17Y3gPJg== X-Received: by 10.107.135.202 with SMTP id r71mr6825526ioi.224.1477162887729; Sat, 22 Oct 2016 12:01:27 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id c42sm4220551ioj.32.2016.10.22.12.01.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Oct 2016 12:01:27 -0700 (PDT) From: Alex To: bug-gnu-emacs@gnu.org Subject: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe Date: Sat, 22 Oct 2016 13:01:15 -0600 Message-ID: <8760ok8ays.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain In emacs -Q's scratch buffer, try the following: M-: (indent-relative) RET Repeating this will move to the next appropriate indentation point as indicated in indent-relative's docstring. Now try: M-: (indent-relative-maybe) RET The point does not move even when there are appropriate indentation points to move to. This contradicts the intention of the docstring for indent-relative-maybe: If the previous nonblank line has no indent points beyond the column point starts at, this command does nothing. I would have expected, in indent-relative, that the calculation of a suitable indentation position is done independent of the argument UNINDENTED-OK. The following diff fixes this: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=indent.patch Content-Description: indent diff diff --git a/lisp/indent.el b/lisp/indent.el index 0f6c68d..02ec210 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -593,18 +593,18 @@ indent-relative ;; Is start-column inside a tab on this line? (if (> (current-column) start-column) (backward-char 1)) - (or (looking-at "[ \t]") - unindented-ok - (skip-chars-forward "^ \t" end)) + (unless (looking-at "[ \t]") + (skip-chars-forward "^ \t" end)) (skip-chars-forward " \t" end) (or (= (point) end) (setq indent (current-column)))))) - (if indent - (let ((opoint (point-marker))) - (indent-to indent 0) - (if (> opoint (point)) - (goto-char opoint)) - (move-marker opoint nil)) - (tab-to-tab-stop)))) + (cond (indent + (let ((opoint (point-marker))) + (indent-to indent 0) + (if (> opoint (point)) + (goto-char opoint)) + (move-marker opoint nil))) + (unindented-ok nil) + (t (tab-to-tab-stop))))) (defcustom tab-stop-list nil "List of tab stop positions used by `tab-to-tab-stop'. --=-=-= Content-Type: text/plain Apparently this stems from the initial revision of indent.el. Am I just misinterpreting this function's purpose, or has it been wrong this whole time? --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:22:19 2016 Received: (at 24766) by debbugs.gnu.org; 22 Oct 2016 19:22:19 +0000 Received: from localhost ([127.0.0.1]:46598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by1s3-00061q-8l for submit@debbugs.gnu.org; Sat, 22 Oct 2016 15:22:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by1s0-00061c-QU for 24766@debbugs.gnu.org; Sat, 22 Oct 2016 15:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by1rq-0003j1-Ld for 24766@debbugs.gnu.org; Sat, 22 Oct 2016 15:22:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by1rq-0003ix-Iq; Sat, 22 Oct 2016 15:22:06 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2079 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1by1ro-0007Ik-17; Sat, 22 Oct 2016 15:22:05 -0400 Date: Sat, 22 Oct 2016 22:21:51 +0300 Message-Id: <83lgxgp4ts.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <8760ok8ays.fsf@gmail.com> (message from Alex on Sat, 22 Oct 2016 13:01:15 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > From: Alex > Date: Sat, 22 Oct 2016 13:01:15 -0600 > > In emacs -Q's scratch buffer, try the following: > > M-: (indent-relative) RET > > Repeating this will move to the next appropriate indentation point as > indicated in indent-relative's docstring. > > Now try: > > M-: (indent-relative-maybe) RET > > 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. > This contradicts the intention of the docstring for > indent-relative-maybe: > > If the previous nonblank line has no indent points beyond the > column point starts at, this command does nothing. > > > I would have expected, in indent-relative, that the calculation of a > suitable indentation position is done independent of the argument > UNINDENTED-OK. The following diff fixes this: These functions exist for ages in this form. I agree that the doc string is misleading (and the optional argument of indent-relative is not even documented), but other than fixing the documentation, I see no reason to change the behavior. Am I missing something? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:41:07 2016 Received: (at 24766) by debbugs.gnu.org; 22 Oct 2016 19:41:07 +0000 Received: from localhost ([127.0.0.1]:46610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by2AE-0006UZ-QC for submit@debbugs.gnu.org; Sat, 22 Oct 2016 15:41:06 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:36314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by2AD-0006Ty-6e for 24766@debbugs.gnu.org; Sat, 22 Oct 2016 15:41:05 -0400 Received: by mail-it0-f42.google.com with SMTP id e187so66601292itc.1 for <24766@debbugs.gnu.org>; Sat, 22 Oct 2016 12:41:05 -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=ai+awM3MJNruAo3wzSPw6FziljkVSuAX9kSlguIiMtc=; b=lEewuPoGsmOcJD3tGF8+49hsrORTvCT6brMl81Cca/nl6PvE8Q2IotdenRtZxrLx/3 NpK8XTl+ToNOc2g0yIcrc+OtSbHktVrIlkuJOVZauuHxYH63jjjMjLvFghh89o8cFOhP QNv/Tbx1nDA1rMmSMkh2vLCM0pnucDn0hL83L7vbO5bdk1jSx9hMdvGyz57jtiCsqofF 551iYV1z/B109En3wkuIoPByLi0bKZ2CvmmCs+9fPG6tjMLQXTXCiVCpICXuY7Hyz/cb HUpUrS0GYBuuUbSyNus1OWDQjTE3X9WHoYcJAxsaC1/Iv9Ito1UTdZatVRAMI85GW4Zk eNrw== 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=ai+awM3MJNruAo3wzSPw6FziljkVSuAX9kSlguIiMtc=; b=SqeoCrAGSV+N7oVmXR1/nu8rIpyVHWf4WU4qew6ecDIbuxt4hIc9L5MS1zhHo7JiNC vi7+PNiMoz+Yv/69M9VNJRaXf5MASvyTTsLUjBJrg/vmnpAbkRWy5ID4kk1qS/3Squw4 vj1zhaXimTiqhK5Zk2GCtP3aIggYWE+zxI4EhTIo/LmLAPQCCtQsv2JPAh/OmkEjgRfS HbGSSePhhpyrLb55eZOZrkhsc1F2tRxmjjbc2j/VIT5GMESlJhZqBm9qtt+bkZauGpxk dAwTjtOs09Z6AZcmsiiYNdU8IiwJ5797XWp8T73M/49vOF7qmMdqhyUqmo92Ryp8qsR9 BCbw== X-Gm-Message-State: ABUngvfXx5MqZywSpjQFjmivkZJm4tvCBDiLxR0YC18qC2U2v1IGgrIUr9i0LTAR1Oa29Q== X-Received: by 10.36.107.15 with SMTP id v15mr6600563itc.88.1477165259412; Sat, 22 Oct 2016 12:40:59 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id l2sm1684716itb.9.2016.10.22.12.40.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Oct 2016 12:40:59 -0700 (PDT) From: Alex To: Eli Zaretskii Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> Date: Sat, 22 Oct 2016 13:40:57 -0600 In-Reply-To: <83lgxgp4ts.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Oct 2016 22:21:51 +0300") Message-ID: <871sz8894m.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Eli Zaretskii writes: >> From: Alex >> Date: Sat, 22 Oct 2016 13:01:15 -0600 >> >> In emacs -Q's scratch buffer, try the following: >> >> M-: (indent-relative) RET >> >> Repeating this will move to the next appropriate indentation point as >> indicated in indent-relative's docstring. >> >> Now try: >> >> M-: (indent-relative-maybe) RET >> >> 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. >> This contradicts the intention of the docstring for >> indent-relative-maybe: >> >> If the previous nonblank line has no indent points beyond the >> column point starts at, this command does nothing. >> >> >> I would have expected, in indent-relative, that the calculation of a >> suitable indentation position is done independent of the argument >> UNINDENTED-OK. The following diff fixes this: > > These functions exist for ages in this form. I agree that the doc > string is misleading (and the optional argument of indent-relative is > not even documented), The optional argument is implicitly mentioned as "unless this command is invoked with a numeric argument, in which case it does nothing." > 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. But again, perhaps there's something I'm missing? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:49:02 2016 Received: (at 24766) by debbugs.gnu.org; 22 Oct 2016 19:49:02 +0000 Received: from localhost ([127.0.0.1]:46619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by2Ht-0006gh-Qn for submit@debbugs.gnu.org; Sat, 22 Oct 2016 15:49:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by2Hs-0006gD-KW for 24766@debbugs.gnu.org; Sat, 22 Oct 2016 15:49:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by2Hk-0003vX-8e for 24766@debbugs.gnu.org; Sat, 22 Oct 2016 15:48:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by2Hk-0003vR-5T; Sat, 22 Oct 2016 15:48:52 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2096 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1by2Hh-0001gV-Hc; Sat, 22 Oct 2016 15:48:51 -0400 Date: Sat, 22 Oct 2016 22:48:32 +0300 Message-Id: <83h984p3lb.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <871sz8894m.fsf@gmail.com> (message from Alex on Sat, 22 Oct 2016 13:40:57 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > 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? > 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. > > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 17:50:09 2016 Received: (at 24766) by debbugs.gnu.org; 22 Oct 2016 21:50:09 +0000 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 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 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) 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) From: Alex To: Eli Zaretskii Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> Date: Sat, 22 Oct 2016 15:49:57 -0600 In-Reply-To: <83h984p3lb.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Oct 2016 22:48:32 +0300") Message-ID: <87shro6ol6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) 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))) From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 23 02:24:00 2016 Received: (at 24766) by debbugs.gnu.org; 23 Oct 2016 06:24:00 +0000 Received: from localhost ([127.0.0.1]:47044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byCCN-0000bW-RD for submit@debbugs.gnu.org; Sun, 23 Oct 2016 02:24:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byCCM-0000bI-Ia for 24766@debbugs.gnu.org; Sun, 23 Oct 2016 02:23:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byCCE-000176-AP for 24766@debbugs.gnu.org; Sun, 23 Oct 2016 02:23:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byCCE-000170-6a; Sun, 23 Oct 2016 02:23:50 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2416 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1byCCD-0006Kp-Jm; Sun, 23 Oct 2016 02:23:49 -0400 Date: Sun, 23 Oct 2016 09:23:45 +0300 Message-Id: <83a8dvpor2.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87shro6ol6.fsf@gmail.com> (message from Alex on Sat, 22 Oct 2016 15:49:57 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > From: Alex > Cc: 24766@debbugs.gnu.org > Date: Sat, 22 Oct 2016 15:49:57 -0600 > > Eli Zaretskii writes: > > >> 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? No, I meant to improve the doc string to describe the current behavior. > >> 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. ;-) Yes, but my change just described one subtlety of that function, it didn't change anything about the rest. Most probably I bumped into the aspect of the behavior I described, and found it not documented at all. > > 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))) Like I said, I don't think the behavior should be changed, only the documentation, which is somewhat misleading. If we want some different behavior, we could have a new function, or a new value of the argument to indent-relative. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 23 16:44:10 2016 Received: (at 24766) by debbugs.gnu.org; 23 Oct 2016 20:44:10 +0000 Received: from localhost ([127.0.0.1]:50280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byPco-0001fQ-9G for submit@debbugs.gnu.org; Sun, 23 Oct 2016 16:44:10 -0400 Received: from mail-yw0-f180.google.com ([209.85.161.180]:36297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byPcm-0001fD-JC for 24766@debbugs.gnu.org; Sun, 23 Oct 2016 16:44:08 -0400 Received: by mail-yw0-f180.google.com with SMTP id u124so147116441ywg.3 for <24766@debbugs.gnu.org>; Sun, 23 Oct 2016 13:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=VYcvv+Aw1KhrKbK/fplubuKUl3/I882kAFJK1C9CeeE=; b=odV6aHCXvfwxaYCwhyiR891fzMQxmzF10DDtNNK+ycgWn/AQJmdF9r09eUwGJhu+9a 8f6zTLXup3jSwCr0BHNAVinTQItRXrnrmVghCyfPGwMioj1Jh+rcl0LfIbxwaU0BTaYW 1GUez84nBhFLEaVfx6TA/CREZno4YIMcjTUnAQgA2gT1aFaUhjhiny9vf1vOgTURFHDP x4tDcAUyZJB+lJ3RNuD3HWuZKVaQAPsZxXPM+pcPv7uzWN7x66KKnczuA0aW5w/h0dq8 l7HXGnVpJmefdonmib/WSGcaDKjx7gSsXY8H98MTf4Mwyxfa+f+5U9yXZV2vAmodqx22 IyEA== 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:in-reply-to:references :user-agent:date:message-id:mime-version; bh=VYcvv+Aw1KhrKbK/fplubuKUl3/I882kAFJK1C9CeeE=; b=awtFv289ROfk9LwtWq6zQD+WuuGC9Cmqu814UImqroECSY6l4Ic/DIHg1Z/gkHp5qs RozwDAhZGAnUv3GsVZwze28Awq1ziVsSjgd3PltRhgzF2bv7i8Kx4t9C2RxnOdIRIiU4 vSDQmcql4GUnVzjyUeDkrJID/8M6BBu+ojCNprxhaCleHBf6BMHV0lLBA3vaeRNiqp/H KihVnGu9NZl0fkdg+8r/36X4hlKi6LfgHUfAKwEvO4Gci0dV50fYizfwRTSh1LX86yk3 dqhK+qelitvtRuen5R/rPtdhXMm2KPS7qm6FFx28Q+sVPNF6woIhJoa/DUXofFBV9Ws9 +jfQ== X-Gm-Message-State: ABUngvfpik2SRjNhtmv07XOIEVspGlzaG8ZavONNEAEn0yL7bO1nk+zHlzxBmDu3guIGNg== X-Received: by 10.107.43.75 with SMTP id r72mr10402964ior.26.1477255442993; Sun, 23 Oct 2016 13:44:02 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id b6sm6216883iob.4.2016.10.23.13.44.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Oct 2016 13:44:02 -0700 (PDT) From: Alex To: Eli Zaretskii Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe In-Reply-To: <83a8dvpor2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 23 Oct 2016 09:23:45 +0300") References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Date: Sun, 23 Oct 2016 14:43:57 -0600 Message-ID: <87twc2iynm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Like I said, I don't think the behavior should be changed, only the > documentation, which is somewhat misleading. If we want some > different behavior, we could have a new function, or a new value of > the argument to indent-relative. > > Thanks. What about changing `indent-relative-maybe' and adding an extra argument to `indent-relative'? Since `indent-relative-maybe' has had that docstring for a good 15 years, and the name fits the new behaviour more. Then in Emacs core we can replace the single instance of it with (indent-relative t). The corresponding diff: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=indent2.patch Content-Description: second time diff --git a/lisp/indent.el b/lisp/indent.el index 0f6c68d..675b6b8 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -566,9 +566,9 @@ indent-relative-maybe See also `indent-relative'." (interactive) - (indent-relative t)) + (indent-relative nil t)) -(defun indent-relative (&optional unindented-ok) +(defun indent-relative (&optional first-only unindented-ok) "Space out to under next indent point in previous nonblank line. An indent point is a non-whitespace character following whitespace. The following line shows the indentation points in this line. @@ -594,17 +594,18 @@ indent-relative (if (> (current-column) start-column) (backward-char 1)) (or (looking-at "[ \t]") - unindented-ok + first-only (skip-chars-forward "^ \t" end)) (skip-chars-forward " \t" end) (or (= (point) end) (setq indent (current-column)))))) - (if indent - (let ((opoint (point-marker))) - (indent-to indent 0) - (if (> opoint (point)) - (goto-char opoint)) - (move-marker opoint nil)) - (tab-to-tab-stop)))) + (cond (indent + (let ((opoint (point-marker))) + (indent-to indent 0) + (if (> opoint (point)) + (goto-char opoint)) + (move-marker opoint nil))) + (unindented-ok nil) + (t (tab-to-tab-stop))))) (defcustom tab-stop-list nil "List of tab stop positions used by `tab-to-tab-stop'. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 24 04:23:34 2016 Received: (at 24766) by debbugs.gnu.org; 24 Oct 2016 08:23:34 +0000 Received: from localhost ([127.0.0.1]:51831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byaXd-0005ue-Pu for submit@debbugs.gnu.org; Mon, 24 Oct 2016 04:23:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byaXc-0005uL-Cz for 24766@debbugs.gnu.org; Mon, 24 Oct 2016 04:23:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byaXU-0002xg-7x for 24766@debbugs.gnu.org; Mon, 24 Oct 2016 04:23:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byaXU-0002xZ-4K; Mon, 24 Oct 2016 04:23:24 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1406 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1byaXT-0006Xv-GK; Mon, 24 Oct 2016 04:23:23 -0400 Date: Mon, 24 Oct 2016 11:23:22 +0300 Message-Id: <837f8y5f5x.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87twc2iynm.fsf@gmail.com> (message from Alex on Sun, 23 Oct 2016 14:43:57 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > From: Alex > Cc: 24766@debbugs.gnu.org > Date: Sun, 23 Oct 2016 14:43:57 -0600 > > What about changing `indent-relative-maybe' and adding an extra argument > to `indent-relative'? Since `indent-relative-maybe' has had that > docstring for a good 15 years, and the name fits the new behaviour more. > > Then in Emacs core we can replace the single instance of it with > (indent-relative t). The corresponding diff: I'd prefer a backward-compatible change, i.e. make the new argument be the 2nd one, and keep the current behavior when the 1st arg is non-nil and the 2nd is nil or omitted. Also, please add the necessary text to the doc string to document the new argument. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 24 15:27:54 2016 Received: (at 24766) by debbugs.gnu.org; 24 Oct 2016 19:27:54 +0000 Received: from localhost ([127.0.0.1]:54815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bykuX-00079V-Qv for submit@debbugs.gnu.org; Mon, 24 Oct 2016 15:27:53 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:32777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bykuV-00079H-Pj for 24766@debbugs.gnu.org; Mon, 24 Oct 2016 15:27:52 -0400 Received: by mail-oi0-f49.google.com with SMTP id y2so55733587oie.0 for <24766@debbugs.gnu.org>; Mon, 24 Oct 2016 12:27:51 -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=q0p/57IzSZnZMXvCgo8VnPftt8gk5gPgDhofKBp6oI4=; b=dODmJVZg7D25PsirwM9jyy/fKo4Xj0OcuaADWedSeAbKPxqHQbpqf3jHfkSFK823ri cFp9EC0Y627TV/2YgaAVcCQ5piOWUjR93aLmH7mhywJPDAO+mDTkkztV2wiu2et6AxtQ WtBNLWmRLYZu5ZHDlWfOGmtdpcT3ihrcXnyBE5QuolBbdM9XC1tnA8WpvFMk62iHoXc/ FDwAATKnqEtmOaFmkVCfE1Q+hRzMLYI4MUDM4a8HEXB3yE6VkopNQSFgIx8W6dav8Y4m W4HjLUejBgGSnwynhogel+LAzrJ3Bt/ZwCn1vptL0AaIh+wMefrCxYOBf7QAhhuT780y fBFw== 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=q0p/57IzSZnZMXvCgo8VnPftt8gk5gPgDhofKBp6oI4=; b=dfscTYdEaCLqAje+t2MZvbncBp7ilJtkEjFO2mzYRygVIPrJfvKAYQJrLPQO1CCLC5 MCXCfENVA5x/RtqVWB15yFysp790PVgkM3OK9iWwevy52EL3RxMLb0/PUNHKTiUGQI2g hWWYz5k9vmHIaGeHRgu8ZPKiNXOCVfrX82YP9QjQKRHVMGe6A6asUcuUtjhONHK+vqji TFXGdEMGw5UojNhmXiOh6myeLbO9dqZnvv2dyySIfw1A2RTMNdTQm59Fj9GqOcBCWTCJ qwNq9X1Ng4eHYh4vmnzb5qz7cRK7RpEAdr0X95IuyyG8G4rUCogxVlnhtEstq2I9H0ZI 8T2w== X-Gm-Message-State: ABUngvfqN9CmD+IGv6zh+YpViJSCv/pGNe2QIQvcZKlv1HRWRvsLbcYHouS58d4l+NLydQ== X-Received: by 10.107.23.132 with SMTP id 126mr13304679iox.162.1477337265859; Mon, 24 Oct 2016 12:27:45 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id a100sm7931305ioj.13.2016.10.24.12.27.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Oct 2016 12:27:45 -0700 (PDT) From: Alex To: Eli Zaretskii Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> Date: Mon, 24 Oct 2016 13:27:43 -0600 In-Reply-To: <837f8y5f5x.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 24 Oct 2016 11:23:22 +0300") Message-ID: <87insh4keo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Eli Zaretskii writes: >> From: Alex >> Cc: 24766@debbugs.gnu.org >> Date: Sun, 23 Oct 2016 14:43:57 -0600 >> >> What about changing `indent-relative-maybe' and adding an extra argument >> to `indent-relative'? Since `indent-relative-maybe' has had that >> docstring for a good 15 years, and the name fits the new behaviour more. >> >> Then in Emacs core we can replace the single instance of it with >> (indent-relative t). The corresponding diff: > > I'd prefer a backward-compatible change, i.e. make the new argument be > the 2nd one, and keep the current behavior when the 1st arg is non-nil > and the 2nd is nil or omitted. That's what I did, but I used a new name for the old argument and the old name for the new argument. I did so as the old name fits the new behaviour more. This is a backward-compatible change for indent-relative, but it does use the new behaviour for indent-relative-maybe. Is that alright with you? > Also, please add the necessary text to the doc string to document the > new argument. Sure, I'll do that once the code changes are agreed upon. > Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 24 15:58:11 2016 Received: (at 24766) by debbugs.gnu.org; 24 Oct 2016 19:58:11 +0000 Received: from localhost ([127.0.0.1]:54892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bylNr-0007um-8g for submit@debbugs.gnu.org; Mon, 24 Oct 2016 15:58:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bylNq-0007ub-0E for 24766@debbugs.gnu.org; Mon, 24 Oct 2016 15:58:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bylNh-0004Yh-Oq for 24766@debbugs.gnu.org; Mon, 24 Oct 2016 15:58:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bylNh-0004Yd-MC; Mon, 24 Oct 2016 15:58:01 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3545 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bylNe-00026I-W5; Mon, 24 Oct 2016 15:58:01 -0400 Date: Mon, 24 Oct 2016 22:57:43 +0300 Message-Id: <83insh34g8.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87insh4keo.fsf@gmail.com> (message from Alex on Mon, 24 Oct 2016 13:27:43 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> <87insh4keo.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) > From: Alex > Cc: 24766@debbugs.gnu.org > Date: Mon, 24 Oct 2016 13:27:43 -0600 > > > I'd prefer a backward-compatible change, i.e. make the new argument be > > the 2nd one, and keep the current behavior when the 1st arg is non-nil > > and the 2nd is nil or omitted. > > That's what I did, but I used a new name for the old argument and the > old name for the new argument. I did so as the old name fits the new > behaviour more. > > This is a backward-compatible change for indent-relative, but it does > use the new behaviour for indent-relative-maybe. Is that alright with > you? Yes, thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 20:53:52 2016 Received: (at 24766) by debbugs.gnu.org; 8 Nov 2016 01:53:52 +0000 Received: from localhost ([127.0.0.1]:48860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3vbk-0006of-HP for submit@debbugs.gnu.org; Mon, 07 Nov 2016 20:53:52 -0500 Received: from mail-it0-f54.google.com ([209.85.214.54]:37888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3vbi-0006oQ-98 for 24766@debbugs.gnu.org; Mon, 07 Nov 2016 20:53:50 -0500 Received: by mail-it0-f54.google.com with SMTP id q124so171030004itd.1 for <24766@debbugs.gnu.org>; Mon, 07 Nov 2016 17:53:50 -0800 (PST) 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=PXJeV7Dny0fzYJIzPMkqboyFtFn+r7feTx8WptvcPGM=; b=lp8kvwjbmfkqA7LTz4aHTThx6R+Rax2CU7J7Xwmd+4V0SsEfeSxYvzUQfmxgtn+YOk YOa/gVBOzfg5WSH75KMUolnhCU0D3Z4N41hshLw0sXnZeNI6kRuhWO8enUm7kLcJK7qa uu+oM74j16lMsIlySa4qvfPK3nuY06fcVzQbq4NHh/Wux9PYff1P/MP8uW0AaebyHe9R 0Ry7gOyT4Cq0WCBK539qJNRTsv4w02EOaQgbcBbVHdA8WJOGsunRq9n3qzmMJ9+HJQ6S WOeuWo9oEiBzZfXlDns6FrC1wx0akm+m/r7s7t/DqpK7UP9B9xaKZtt7nIsTYpdXm1Rz iTtA== 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=PXJeV7Dny0fzYJIzPMkqboyFtFn+r7feTx8WptvcPGM=; b=hU/vcH44UKGuMfnP9If726JxnkwLmhOmxo6JrTzDgrhiIKObRrw3p+rlLKnaiCuAf3 rhHN33IJ9r/VfkRM+e/cHyJqiaQjjE5eItV+EExbwQyZrHco37dF6ZGhdGijhnHmi0Ns CPJZ7E0ip2CrLeNyg4mU9QvRZBUvgCvkv2vZ1H2uY6w/LH4z1cOLdfItOppsUoibbjqB Bv2KdgPKkn7FDEqfCL/a1jR5xzfWdYnirCMuz+yUDKFTHMjk5U4lr+L+69fvROXsbex3 /VcWT9HoKsni6Wo3J2eMp7FYWy1t+D9FKcczNPA5Ej8F3OA/rKKEpntFL9jgrhQR1/Hh Q6ww== X-Gm-Message-State: ABUngveXVqmhLYCJxE6EKTzaNaqrvo0/IYZJ6N4ObrgTf+dXDpTxeDaR3H1lGyR4eTOwPw== X-Received: by 10.107.170.230 with SMTP id g99mr12054598ioj.111.1478570024634; Mon, 07 Nov 2016 17:53:44 -0800 (PST) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id i75sm3366229itf.10.2016.11.07.17.53.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Nov 2016 17:53:44 -0800 (PST) From: Alex To: Eli Zaretskii Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> <87insh4keo.fsf@gmail.com> <83insh34g8.fsf@gnu.org> Date: Mon, 07 Nov 2016 19:53:22 -0600 In-Reply-To: <83insh34g8.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 24 Oct 2016 22:57:43 +0300") Message-ID: <878tsuivot.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Alex >> Cc: 24766@debbugs.gnu.org >> Date: Mon, 24 Oct 2016 13:27:43 -0600 >> >> > I'd prefer a backward-compatible change, i.e. make the new argument be >> > the 2nd one, and keep the current behavior when the 1st arg is non-nil >> > and the 2nd is nil or omitted. >> >> That's what I did, but I used a new name for the old argument and the >> old name for the new argument. I did so as the old name fits the new >> behaviour more. >> >> This is a backward-compatible change for indent-relative, but it does >> use the new behaviour for indent-relative-maybe. Is that alright with >> you? > > Yes, thanks. Sorry for the delay. After thinking about it some more, and after properly searching on Github for `indent-relative-maybe', I'm not sure if my previous solution is the best one now. I found that due to some blog posts and starter kit configurations, a surprising amount of people use indent-relative-maybe despite docstring claiming different functionality. I now think the following should happen: 1) indent-relative-maybe's should be obsoleted in favour of a name suiting the purpose (e.g. indent-relative-whitespace) with a better docstring. 2) The docstring and second optional argument should be added as discussed before. 3) Perhaps in the future a new function can be introduced that automatically calls (indent-relative nil t), but I'm not sure if that should be done now. To be honest, I lost my original reason that made me interested in this function. Anyway, I've attached a diff that addresses this new proposal. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=indent3-2.diff Content-Description: 3rd time diff --git a/lisp/indent.el b/lisp/indent.el index 0f6c68d..6c907f4 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -559,24 +559,29 @@ indent-region ;; by hand. (setq deactivate-mark t)) -(defun indent-relative-maybe () - "Indent a new line like previous nonblank line. -If the previous nonblank line has no indent points beyond the -column point starts at, this command does nothing. +(define-obsolete-function-alias 'indent-relative-maybe + 'indent-relative-whitespace "26.1") + +(defun indent-relative-whitespace () + "Indent the current line like the previous nonblank line. +Indent to the first indentation position in the previous nonblank +line. See also `indent-relative'." (interactive) (indent-relative t)) -(defun indent-relative (&optional unindented-ok) +(defun indent-relative (&optional first-only unindented-ok) "Space out to under next indent point in previous nonblank line. An indent point is a non-whitespace character following whitespace. The following line shows the indentation points in this line. ^ ^ ^ ^ ^ ^ ^ ^ ^ +If FIRST-ONLY is non-nil, then only the first indent point is +considered. + If the previous nonblank line has no indent points beyond the -column point starts at, `tab-to-tab-stop' is done instead, unless -this command is invoked with a numeric argument, in which case it -does nothing. +column point starts at, then `tab-to-tab-stop' is done if +UNINDENTED-OK is nil, otherwise nothing is done in this case. See also `indent-relative-maybe'." (interactive "P") @@ -594,17 +599,18 @@ indent-relative (if (> (current-column) start-column) (backward-char 1)) (or (looking-at "[ \t]") - unindented-ok + first-only (skip-chars-forward "^ \t" end)) (skip-chars-forward " \t" end) (or (= (point) end) (setq indent (current-column)))))) - (if indent - (let ((opoint (point-marker))) - (indent-to indent 0) - (if (> opoint (point)) - (goto-char opoint)) - (move-marker opoint nil)) - (tab-to-tab-stop)))) + (cond (indent + (let ((opoint (point-marker))) + (indent-to indent 0) + (if (> opoint (point)) + (goto-char opoint)) + (move-marker opoint nil))) + (unindented-ok nil) + (t (tab-to-tab-stop))))) (defcustom tab-stop-list nil "List of tab stop positions used by `tab-to-tab-stop'. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 10:07:01 2016 Received: (at 24766) by debbugs.gnu.org; 8 Nov 2016 15:07:01 +0000 Received: from localhost ([127.0.0.1]:49783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c47zJ-0001x7-69 for submit@debbugs.gnu.org; Tue, 08 Nov 2016 10:07:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c47zI-0001ww-Cr for 24766@debbugs.gnu.org; Tue, 08 Nov 2016 10:07:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c47zA-00010R-67 for 24766@debbugs.gnu.org; Tue, 08 Nov 2016 10:06:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c47zA-00010L-2I; Tue, 08 Nov 2016 10:06:52 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2900 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c47z9-0005Fu-GB; Tue, 08 Nov 2016 10:06:51 -0500 Date: Tue, 08 Nov 2016 17:07:25 +0200 Message-Id: <83h97iggcy.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <878tsuivot.fsf@gmail.com> (message from Alex on Mon, 07 Nov 2016 19:53:22 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> <87insh4keo.fsf@gmail.com> <83insh34g8.fsf@gnu.org> <878tsuivot.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Alex > Cc: 24766@debbugs.gnu.org > Date: Mon, 07 Nov 2016 19:53:22 -0600 > > After thinking about it some more, and after properly searching on > Github for `indent-relative-maybe', I'm not sure if my previous solution > is the best one now. I found that due to some blog posts and starter kit > configurations, a surprising amount of people use indent-relative-maybe > despite docstring claiming different functionality. > > I now think the following should happen: > > 1) indent-relative-maybe's should be obsoleted in > favour of a name suiting the purpose (e.g. indent-relative-whitespace) > with a better docstring. > > 2) The docstring and second optional argument should be added as > discussed before. > > 3) Perhaps in the future a new function can be introduced that > automatically calls (indent-relative nil t), but I'm not sure if that > should be done now. To be honest, I lost my original reason that made me > interested in this function. > > Anyway, I've attached a diff that addresses this new proposal. Thanks, this is fine, except that the new function's name should be better as indent-relative-first-indent-point or somesuch. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 14:10:05 2016 Received: (at 24766) by debbugs.gnu.org; 8 Nov 2016 19:10:05 +0000 Received: from localhost ([127.0.0.1]:49974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4BmX-00018Q-1Q for submit@debbugs.gnu.org; Tue, 08 Nov 2016 14:10:05 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:33884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4BmV-00017P-JX for 24766@debbugs.gnu.org; Tue, 08 Nov 2016 14:10:03 -0500 Received: by mail-it0-f66.google.com with SMTP id q124so18434155itd.1 for <24766@debbugs.gnu.org>; Tue, 08 Nov 2016 11:10:03 -0800 (PST) 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=11RJaaai2NcH1FINT2Fxn596/rDWEpBlNFVgsoRfguM=; b=xfTHytSRpDry9PwFGPyCI0FPfdpvrd+MWrF9CAv7HI0kUcIRBcyluecimjNl/J1rDm E2Bm+KB0uy/5+HafY3yfgKg+UWkQpeFyDVvaEiohmMKQLyr2ree3uOgAXrCuSuBu+nGE rg7JxtciOnw3DhY8Jpp1G++zDR7HPL+/+kl0nz5QQFpFVAiyRAIQM61ijmReZsbo1T49 pghXQPgr1KBwnG7bSjGksxHnVr+uNt3TkLMcvUZ/blhvN6KRYdrsscEJ0CeLjaJlZ937 o/sWHqIO1I2ywLvSAyFDH79GCVQCJFThE7FKzNcWetJQ3W0ZOpnEEl/kF+ixv6KpIiEb +67Q== 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=11RJaaai2NcH1FINT2Fxn596/rDWEpBlNFVgsoRfguM=; b=GnEwqkvVZGo9tS3UF3bu4G4QYdUSFZi2VDRuVIdNF5i7IFjSbKm32E5DqMST/OhKWs sor+OFXOIiYeGBpD2MI0roj9wmvwm98b55kHvlHWB75t06csPOt5bCPX/3eozkjPRjTL 9OoDE5F5wF4d0/WItpyx0G0Ws13S1lrTkK4KLsNU0t/pub0HRB9ULQGOCQsA7SSdmVco bL6q0vK4THjcdeCOuMrNlSgRJ6lpCC4TTQyKjtWg8IH8CVEg5BYgMKhkF9KcVZiOSzyr /Ot39PgGtIJl0NFNs2oYKjaRWVNWazyUAup8IiWXiqx1sEhwoDMwEaaGneLqONuIsDng GvZA== X-Gm-Message-State: ABUngvepuEhQM0q2TBy0Q1CthIJ21CzAvIdE2G07aRzjsOJMv1s9GImreAipU8OXpEZdIQ== X-Received: by 10.107.7.168 with SMTP id g40mr14192832ioi.114.1478632198070; Tue, 08 Nov 2016 11:09:58 -0800 (PST) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id l14sm12628769ioi.18.2016.11.08.11.09.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Nov 2016 11:09:57 -0800 (PST) From: Alex To: Eli Zaretskii Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> <87insh4keo.fsf@gmail.com> <83insh34g8.fsf@gnu.org> <878tsuivot.fsf@gmail.com> <83h97iggcy.fsf@gnu.org> Date: Tue, 08 Nov 2016 13:09:42 -0600 In-Reply-To: <83h97iggcy.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Nov 2016 17:07:25 +0200") Message-ID: <87k2cdn5zd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks, this is fine, except that the new function's name should be > better as indent-relative-first-indent-point or somesuch. That name does better describe how (indent-relative t) works, but I figured that indent-relative-whitespace is a better name for what people seem to use it for (indent according to the whitespace on the previous nonblank line). Though if you still disagree then `indent-relative-first-indent-point' seems fine (if not a bit long). I suppose this diff goes over the accepted limit for non-assigned submissions? I mailed my copyright forms about a month ago but unfortunately the FSF hasn't informed me that the process is complete yet. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=indent4.diff Content-Description: 4th time diff --git a/lisp/indent.el b/lisp/indent.el index 0f6c68d..6d04192 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -559,26 +559,32 @@ indent-region ;; by hand. (setq deactivate-mark t)) -(defun indent-relative-maybe () - "Indent a new line like previous nonblank line. -If the previous nonblank line has no indent points beyond the -column point starts at, this command does nothing. +(define-obsolete-function-alias 'indent-relative-maybe + 'indent-relative-first-indent-point "26.1") + +(defun indent-relative-first-indent-point () + "Indent the current line like the previous nonblank line. +Indent to the first indentation position in the previous nonblank +line if that position is greater than the current column. See also `indent-relative'." (interactive) (indent-relative t)) -(defun indent-relative (&optional unindented-ok) +(defun indent-relative (&optional first-only unindented-ok) "Space out to under next indent point in previous nonblank line. An indent point is a non-whitespace character following whitespace. The following line shows the indentation points in this line. ^ ^ ^ ^ ^ ^ ^ ^ ^ +If FIRST-ONLY is non-nil, then only the first indent point is +considered. + If the previous nonblank line has no indent points beyond the -column point starts at, `tab-to-tab-stop' is done instead, unless -this command is invoked with a numeric argument, in which case it -does nothing. +column point starts at, then `tab-to-tab-stop' is done if both +FIRST-ONLY and UNINDENTED-OK are nil, otherwise nothing is done +in this case. -See also `indent-relative-maybe'." +See also `indent-relative-first-indent-point'." (interactive "P") (if (and abbrev-mode (eq (char-syntax (preceding-char)) ?w)) @@ -594,17 +600,18 @@ indent-relative (if (> (current-column) start-column) (backward-char 1)) (or (looking-at "[ \t]") - unindented-ok + first-only (skip-chars-forward "^ \t" end)) (skip-chars-forward " \t" end) (or (= (point) end) (setq indent (current-column)))))) - (if indent - (let ((opoint (point-marker))) - (indent-to indent 0) - (if (> opoint (point)) - (goto-char opoint)) - (move-marker opoint nil)) - (tab-to-tab-stop)))) + (cond (indent + (let ((opoint (point-marker))) + (indent-to indent 0) + (if (> opoint (point)) + (goto-char opoint)) + (move-marker opoint nil))) + (unindented-ok nil) + (t (tab-to-tab-stop))))) (defcustom tab-stop-list nil "List of tab stop positions used by `tab-to-tab-stop'. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 15:26:36 2016 Received: (at 24766) by debbugs.gnu.org; 8 Nov 2016 20:26:36 +0000 Received: from localhost ([127.0.0.1]:50038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4CyZ-00030z-Oo for submit@debbugs.gnu.org; Tue, 08 Nov 2016 15:26:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4CyY-00030m-4F for 24766@debbugs.gnu.org; Tue, 08 Nov 2016 15:26:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4CyP-00061s-JA for 24766@debbugs.gnu.org; Tue, 08 Nov 2016 15:26:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4CyP-00061o-GK; Tue, 08 Nov 2016 15:26:25 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3299 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c4CyO-00011b-PR; Tue, 08 Nov 2016 15:26:25 -0500 Date: Tue, 08 Nov 2016 22:26:22 +0200 Message-Id: <837f8dhg5t.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87k2cdn5zd.fsf@gmail.com> (message from Alex on Tue, 08 Nov 2016 13:09:42 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> <87insh4keo.fsf@gmail.com> <83insh34g8.fsf@gnu.org> <878tsuivot.fsf@gmail.com> <83h97iggcy.fsf@gnu.org> <87k2cdn5zd.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Alex > Cc: 24766@debbugs.gnu.org > Date: Tue, 08 Nov 2016 13:09:42 -0600 > > I suppose this diff goes over the accepted limit for non-assigned > submissions? I mailed my copyright forms about a month ago but > unfortunately the FSF hasn't informed me that the process is complete > yet. Please ping them. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 04:04:58 2016 Received: (at 24766) by debbugs.gnu.org; 18 Nov 2016 09:04:58 +0000 Received: from localhost ([127.0.0.1]:33080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7f6P-0001b4-VM for submit@debbugs.gnu.org; Fri, 18 Nov 2016 04:04:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7f6O-0001ar-HQ for 24766@debbugs.gnu.org; Fri, 18 Nov 2016 04:04:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7f6G-0006Z3-02 for 24766@debbugs.gnu.org; Fri, 18 Nov 2016 04:04:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7f6F-0006Yj-SO; Fri, 18 Nov 2016 04:04:47 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2311 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c7f6D-0003sv-3u; Fri, 18 Nov 2016 04:04:46 -0500 Date: Fri, 18 Nov 2016 11:04:49 +0200 Message-Id: <8337ipduq6.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87k2cdn5zd.fsf@gmail.com> (message from Alex on Tue, 08 Nov 2016 13:09:42 -0600) Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> <87insh4keo.fsf@gmail.com> <83insh34g8.fsf@gnu.org> <878tsuivot.fsf@gmail.com> <83h97iggcy.fsf@gnu.org> <87k2cdn5zd.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 24766 Cc: 24766@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Alex > Cc: 24766@debbugs.gnu.org > Date: Tue, 08 Nov 2016 13:09:42 -0600 > > Eli Zaretskii writes: > > > Thanks, this is fine, except that the new function's name should be > > better as indent-relative-first-indent-point or somesuch. > > That name does better describe how (indent-relative t) works, but I > figured that indent-relative-whitespace is a better name for what people > seem to use it for (indent according to the whitespace on the previous > nonblank line). Thanks, pushed to the master branch. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 03 22:53:22 2017 Received: (at control) by debbugs.gnu.org; 4 Jun 2017 02:53:23 +0000 Received: from localhost ([127.0.0.1]:54442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHLfO-0002I1-Mq for submit@debbugs.gnu.org; Sat, 03 Jun 2017 22:53:22 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:37191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHLfN-0002Hn-LC for control@debbugs.gnu.org; Sat, 03 Jun 2017 22:53:21 -0400 Received: by mail-it0-f49.google.com with SMTP id m47so49148545iti.0 for ; Sat, 03 Jun 2017 19:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2dUq838d6azWhYw+H0kHzjlKY9ViUsFatHuX0De8rLM=; b=XNQ60BnnwXAfRSjxuwpROIdnydNtE1zYO4DY4aBVLnhaZgeqaSX+UB/QpbpwGCb3PF k3Kt+tpsKIi23Dmn0FmwMqFbENmS88BWWvSakieVMO+l5op0E9XO5b2PAywIPgY2ZyL5 TNGsIL2PJpggAv90owVI5WJ6VTn6v4Z+6Kvokiz7GqYf48yy24U8z5DAo+5gdZdLen2a DFUqUZXSwEmP+OghH/PMpatEW0144Juvq8qZJTSUX3h95hYERo6f3cM1U0e6lOYrSZZh 2v2qNPYJFAIvL1HcFC51xDYNlEfMetaZ4KBercCeaHwIlegIR19LGnIl1K14ryA8oUnU TvUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=2dUq838d6azWhYw+H0kHzjlKY9ViUsFatHuX0De8rLM=; b=JXBMG5QWX/WL2zPmq/Fiz+/dElM3MArbNpMCR2aGq+RAKFIsM4+Ghbx93IPrWa1wbJ DmvRxSZetUYqoqGVlAbZV0xkJ+pzieFv/hRZRnpUu3buT81kx4e24GKfd1fGoMxi//Vt 0KYL3laBpzFFW/o3OCAFZ1vQgk+YaQNHTderEotkwfXuMeYTZ7IEwMqNaaUKi4J3NMZ0 TRCgbvqqBffEWjnSAfdPIiJk8UGzmL4zXCL9ILjM8oEVrYqUnL5v6X+RKlVdlQdyW+pq IfQ1y1SnVuxMedKuuy0Cf5bLEqcBQgHUG+2i2iIMggsYYyTGp52FwdHzaxizLrcefOVu XQTA== X-Gm-Message-State: AODbwcBkATEMZvtUXkH1vqVsORuQuZqjYRTURHGeHwe+ZR6bsIHhypFC Knjf40ZwQz6cVl9H X-Received: by 10.36.117.132 with SMTP id y126mr6488383itc.120.1496544796036; Sat, 03 Jun 2017 19:53:16 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f29sm12096230ioj.61.2017.06.03.19.53.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Jun 2017 19:53:15 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: Re: bug#24766: 26.0.50: [PATCH] Confusing behaviour for indent-relative-maybe References: <8760ok8ays.fsf@gmail.com> <83lgxgp4ts.fsf@gnu.org> <871sz8894m.fsf@gmail.com> <83h984p3lb.fsf@gnu.org> <87shro6ol6.fsf@gmail.com> <83a8dvpor2.fsf@gnu.org> <87twc2iynm.fsf@gmail.com> <837f8y5f5x.fsf@gnu.org> <87insh4keo.fsf@gmail.com> <83insh34g8.fsf@gnu.org> <878tsuivot.fsf@gmail.com> <83h97iggcy.fsf@gnu.org> <87k2cdn5zd.fsf@gmail.com> <8337ipduq6.fsf@gnu.org> Date: Sat, 03 Jun 2017 22:54:53 -0400 In-Reply-To: <8337ipduq6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Nov 2016 11:04:49 +0200") Message-ID: <87y3t8zcle.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) tags 24766 fixed close 24766 26.1 quit Eli Zaretskii writes: >> From: Alex >> Cc: 24766@debbugs.gnu.org >> Date: Tue, 08 Nov 2016 13:09:42 -0600 >> >> Eli Zaretskii writes: >> >> > Thanks, this is fine, except that the new function's name should be >> > better as indent-relative-first-indent-point or somesuch. >> >> That name does better describe how (indent-relative t) works, but I >> figured that indent-relative-whitespace is a better name for what people >> seem to use it for (indent according to the whitespace on the previous >> nonblank line). > > Thanks, pushed to the master branch. From unknown Sat Jun 21 10:40:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Jul 2017 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator