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 13:01:15 -0600 Message-ID: <8760ok8ays.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1477162951 8144 195.159.176.226 (22 Oct 2016 19:02:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Oct 2016 19:02:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: 24766@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 22 21:02:25 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 1by1YX-0007l2-G2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Oct 2016 21:02:09 +0200 Original-Received: from localhost ([::1]:38400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by1YZ-0006EQ-Kl for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Oct 2016 15:02:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by1YT-0006EF-MN for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 15:02:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by1YQ-0006Ni-K6 for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 15:02:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59411) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1by1YQ-0006N5-GM for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 15:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1by1YQ-0005XG-0F for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 15:02: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 19:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24766 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147716290021240 (code B ref -1); Sat, 22 Oct 2016 19:02:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Oct 2016 19:01:40 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124846 Archived-At: --=-=-= 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? --=-=-=--