From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#17955: 24.3.92; octave.el: indentation following ... or \ Date: Sat, 29 May 2021 10:44:10 -0400 Message-ID: References: <87a6oet9ge.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11429"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 17955@debbugs.gnu.org, Leo Liu To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 29 16:45:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ln0DA-0002lJ-4A for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 May 2021 16:45:12 +0200 Original-Received: from localhost ([::1]:58966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ln0D9-0005Y4-4S for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 May 2021 10:45:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln0D0-0005VL-K4 for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 10:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ln0D0-0006Kx-C0 for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 10:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ln0D0-0006Px-85 for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 10:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 May 2021 14:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17955 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 17955-submit@debbugs.gnu.org id=B17955.162229946124597 (code B ref 17955); Sat, 29 May 2021 14:45:02 +0000 Original-Received: (at 17955) by debbugs.gnu.org; 29 May 2021 14:44:21 +0000 Original-Received: from localhost ([127.0.0.1]:57523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln0CL-0006Oe-0U for submit@debbugs.gnu.org; Sat, 29 May 2021 10:44:21 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln0CI-0006ON-1M for 17955@debbugs.gnu.org; Sat, 29 May 2021 10:44:19 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8BDD38066C; Sat, 29 May 2021 10:44:12 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 37286801F2; Sat, 29 May 2021 10:44:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622299451; bh=dcY45PNw+izyxU7tPc7Vyeqb8SHDBHdCLMJ8RrHaiDo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jF0UJSSOaO7mb7ikm3lnkbwWJwvYE9tcftjOO8EF4kaJAeadMzVJqU1LYfuWdLhbd Gx6NFAqZCaKxW0t2kNmP1Ij16Wim7+FtnBLDux1Fpob2edwhqa1VGs70V+YGJDGJr+ qpOh6AZzqPKQOrPMVBX9vbIpmPKczdKtdwtvtXVX0Cusc/is3xTsZd294aKEOCP302 hBUwu8XFz03Tjfj7kQuqq9yVyn31Pi/z2PUIWOjxZXn8AZrEVw4TzeqtYBFaoYGPNd 5s3pRk+BT43PZsRrbh2/QusAwXuqx2UPbTt0n80BN7jEYIdYzADU2wBYfOXjsHMCmb 4H2EloOg9NL4w== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E7916120C86; Sat, 29 May 2021 10:44:10 -0400 (EDT) In-Reply-To: <87a6oet9ge.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 29 May 2021 07:06:41 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207537 Archived-At: Lars Ingebrigtsen [2021-05-29 07:06:41] wrote: > Stefan Monnier writes: >> So you should be able to control indentation of "b" above by tweaking >> the (:after . "=") or (:before . "=") rule. > > I've never played around with the SMIE indentation before, but looking > at other examples, I came up with this: > > diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el > index a1a5192ee1..5d877fc6ba 100644 > --- a/lisp/progmodes/octave.el > +++ b/lisp/progmodes/octave.el > @@ -460,7 +460,8 @@ octave-smie-rules > (smie-rule-parent octave-block-offset) > ;; For (invalid) code between switch and case. > ;; (if (smie-rule-parent-p "switch") 4) > - nil)))) > + nil)) > + ('(:after . "=") octave-block-offset))) > > (defun octave-indent-comment () > "A function for `smie-indent-functions' (which see)." > > And the results look OK to me: > > a = \ > b > foo = \ > dasd > > So I've pushed this to Emacs 28; feel free to tweak further. I suspect this behavior, is still not quite what users would want: why break the line if the continuation starts where you broke? Maybe ('(:after . "=") (smie-rule-parent octave-block-offset)))) would work better? And we should add tests for these changes, since regressions are all too easy to introduce when it comes to indentation rules. Stefan