GNU bug report logs - #27552
25.2.50; Indentation problem in rnc-mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Ivan Andrus <darthandrus@HIDDEN>; Keywords: moreinfo; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 29.1, send any further explanations to 27552 <at> debbugs.gnu.org and Ivan Andrus <darthandrus@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 27552 <at> debbugs.gnu.org:


Received: (at 27552) by debbugs.gnu.org; 15 Jun 2022 15:57:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 15 11:57:11 2022
Received: from localhost ([127.0.0.1]:39626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o1VOJ-0003l7-2g
	for submit <at> debbugs.gnu.org; Wed, 15 Jun 2022 11:57:11 -0400
Received: from quimby.gnus.org ([95.216.78.240]:36256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1o1VOG-0003kh-89
 for 27552 <at> debbugs.gnu.org; Wed, 15 Jun 2022 11:57:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=+k2G6B4ojqPUcCIHI8Q7Np2AKaPllc69y9NlxHlvk54=; b=lF5V+ZwpjK/0r+uNrY1LTJt0eo
 LVAQjIJpt+rapkTVzFMAIbEmqfqygL98LaNm4xlsykFemPcSpbOaNdxmgscpwPLP4ejo/oz4F0T2e
 c8HRK2P4I1EyqxDvCO08R4HR3u71qjP6NWvSVD5gj+f4xfJsOwCmIWQBf1Tz1UBnFwJk=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1o1VO5-0004Nh-Qn; Wed, 15 Jun 2022 17:57:00 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#27552: 25.2.50; Indentation problem in rnc-mode
References: <BEC9975E-04D0-431C-B2D4-E7E73A059C79@HIDDEN>
 <87k0akhshb.fsf@HIDDEN> <87sfo6gg12.fsf@HIDDEN>
 <jwvv8t2ugy1.fsf-monnier+emacs@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEVoaJNEQFYFAgYf
 Giq6uNX///8My2XNAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YGDw8xOD7pT9gAAAG5SURBVDjLlZSN
 cesgDIBFYAALPEBAHQCkDIBb7z9TxY+dOG3f3dNdYk6f9S8M4FNaEEO6SoB9SykCylVPHvbawZtF
 Sd2CnHmzCAmoPTNcLSInGAcwfPU0gQAgJ3mGPoGr6syfntIJHkaD8DP0ASJzolMf/QlIwqmmFvoA
 LZEjgpCfgMaLdhpg4Qn6k9MskcI4PMHUl+kTpicFd25uQ04TSH9ZBuQSZnOARCZgy0SYvRxgWhBZ
 nzEgTyBaNFOLROAB0QbpfqEERUWamGgw58DU5glFF4H1D9FzDmJ0lgU1gQa8FFEskk0OWAkRFIiQ
 JiOag3YPgfJ+U+CbBYXSzFoqqBm7rzwtXma9akJYcx0gou5b57RpNejs3gGvexf1ddefLEt91Fag
 DD0o0SUroRhnv1pLSnUduBo/qVW0rHX0am9g22G7t9YYXDd3672qoMCu25jygqueiaG1LEOFbGIa
 a+xC2W0DKsu2yq2vU6IFJOhaDpDq3Xtdmz6aAtY+GMYgVz4XV1ff2o9POC4EvwBj4w7ph5DRWf0G
 hu+/AMHzDl0FXu7FGyj4O9DR8/+AAOnH92Vs/z+C/yHf2uyZc+STjKUAAAAldEVYdGRhdGU6Y3Jl
 YXRlADIwMjItMDYtMTVUMTU6NDk6NTYrMDA6MDClM4NHAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIy
 LTA2LTE1VDE1OjQ5OjU2KzAwOjAw1G47+wAAAABJRU5ErkJggg==
X-Now-Playing: Blaine L. Reininger's _The Blue Sleep_: "Odi Et Amo"
Date: Wed, 15 Jun 2022 17:56:56 +0200
In-Reply-To: <jwvv8t2ugy1.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Wed, 15 Jun 2022 11:15:28 -0400")
Message-ID: <87a6adhqd3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Stefan Monnier <monnier@HIDDEN> writes: > Kind of, 
 yes. There are various places where we could try and fix > this problem,
 but this might be the simplest, indeed. > I pushed the patch below which does
 that. Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 27552
Cc: Ivan Andrus <darthandrus@HIDDEN>, 27552 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> Kind of, yes.  There are various places where we could try and fix
> this problem, but this might be the simplest, indeed.
> I pushed the patch below which does that.

Thanks; I can confirm that that fixes this issue, so I'm closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27552; Package emacs. Full text available.

Message received at 27552 <at> debbugs.gnu.org:


Received: (at 27552) by debbugs.gnu.org; 15 Jun 2022 15:15:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 15 11:15:40 2022
Received: from localhost ([127.0.0.1]:39452 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o1Uk7-000134-Ew
	for submit <at> debbugs.gnu.org; Wed, 15 Jun 2022 11:15:40 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17123)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1o1Uk5-0000v0-12
 for 27552 <at> debbugs.gnu.org; Wed, 15 Jun 2022 11:15:38 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6CF37100479;
 Wed, 15 Jun 2022 11:15:31 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AA4A1100173;
 Wed, 15 Jun 2022 11:15:29 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1655306129;
 bh=VaV3FkwdTC+XXnLaZnlv1IhEEkXc+1fg60sitrQrEjM=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=WlGjkQbiOwUdTbTcqARp22kXS2NeAT1ECmO8t1M2cUtnFFd5O9JLA5NEANgIai8AK
 TehfzyMfLbr49NURyrwQXV4d3ymMXfU+nRpQTWoJ9AuXw/lH9GrFROgglJBq62KBB1
 cv4HPsLb3Ln7gZ7p4MmpTLta0K/5c7SjpqFMHQfg6zAeW8oRU/T2afg59NQdrbrRCG
 DNrSxKxqsEMg7Z2Biyrup8/Tp+IVgPagl0H+j677l+OCkOeEBh8xy8hf6XIXtD2keM
 iJZF4yD6aicLZcPrBGT7e1BLFfXCc9vVCQUA5zweEaiNO36TqidnTJ27TDS6rAKnxt
 pCpGbM2TRLd4Q==
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8AA9F1202DD;
 Wed, 15 Jun 2022 11:15:29 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#27552: 25.2.50; Indentation problem in rnc-mode
Message-ID: <jwvv8t2ugy1.fsf-monnier+emacs@HIDDEN>
References: <BEC9975E-04D0-431C-B2D4-E7E73A059C79@HIDDEN>
 <87k0akhshb.fsf@HIDDEN> <87sfo6gg12.fsf@HIDDEN>
Date: Wed, 15 Jun 2022 11:15:28 -0400
In-Reply-To: <87sfo6gg12.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 15 Jun 2022 16:25:29 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.181 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 KAM_SHORT               0.001 Use of a URL Shortener for very short URL
 T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 27552
Cc: Ivan Andrus <darthandrus@HIDDEN>, 27552 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen [2022-06-15 16:25:29] wrote:
> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>
>> I guess this "=" rule is for stuff like the "pattern =" etc.  But it
>> leads to things like this being indented more for each line:
>>
>> default namesace rng = "http://relaxng.org/ns/structure/1.0"
>> namespace local = ""
>> datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

Part of the problem is that the grammar we use is incorrect, so we
parse incorrectly, and we have to patch things up in the indentation
rules :-(

> Or...  is the problem here that we don't end pattern with a newline?

Kind of, yes.  There are various places where we could try and fix
this problem, but this might be the simplest, indeed.
I pushed the patch below which does that.


        Stefan


diff --git a/rnc-mode.el b/rnc-mode.el
index 30f3c39970..33363d2057 100644
--- a/rnc-mode.el
+++ b/rnc-mode.el
@@ -1,6 +1,6 @@
 ;;; rnc-mode.el --- Emacs mode to edit Relax-NG Compact files  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-1998, 2001-2016 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1998, 2001-2022 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@HIDDEN>
 ;; Keywords: xml relaxng
@@ -96,11 +96,18 @@
     '((assoc "," "&" "|") (nonassoc "?" "*" "+"))
     )))
 
+(defconst rnc-smie--def-regexp
+  (concat "\\(?:\\(?:namespace\\|datatypes\\)[ \t\n]+\\)?"
+          "\\(?:\\s_\\|\\sw\\)+[ \t\n]*[|&]?=")
+  "Regexp matching a \"definition\".
+Any line that starts with this is presumed to start a new definition,
+so the preceding newline is turned into an implicit \" ; \" token.")
+
 (defun rnc-smie-forward-token ()
   (let ((start (point)))
     (forward-comment (point-max))
     (if (and (> (point) start)
-             (looking-at "\\(?:\\s_\\|\\sw\\)+[ \t\n]*[|&]?=")
+             (looking-at rnc-smie--def-regexp)
              (save-excursion
                (goto-char start)
                (forward-comment -1)
@@ -120,7 +127,7 @@
              (let ((pos (point)))
                (goto-char start)
                (prog1
-                   (looking-at "\\(?:\\s_\\|\\sw\\)+[ \t\n]*[|&]?=")
+                   (looking-at rnc-smie--def-regexp)
                  (goto-char pos))))
         " ; "
       (if (looking-back "\\s." (1- (point)))





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27552; Package emacs. Full text available.

Message received at 27552 <at> debbugs.gnu.org:


Received: (at 27552) by debbugs.gnu.org; 15 Jun 2022 14:25:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 15 10:25:44 2022
Received: from localhost ([127.0.0.1]:39368 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o1Txo-0007Xj-HN
	for submit <at> debbugs.gnu.org; Wed, 15 Jun 2022 10:25:44 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33434)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1o1Txm-0007XS-Q8
 for 27552 <at> debbugs.gnu.org; Wed, 15 Jun 2022 10:25:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=K07Z3iLxnZgvtiX1oewMOAD5UrkbEtAOymPFAQVANts=; b=tOeYZF3YbkN8TOCxF77fTohxdM
 fW9mhH31U7cWDiCedmZgrMpQPXINtFAGVqjhzEkTyinqlkHkN/w1OJMVO2x2C7hR8gL6s/6wq3izq
 2IlPbFLrpg4Pv9v47gGrvbCPbdqWekIEvNee7HI6m3YY6qGXueoRTKwS8XXUPs4pT+1I=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1o1Txc-0003T1-8q; Wed, 15 Jun 2022 16:25:34 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Ivan Andrus <darthandrus@HIDDEN>
Subject: Re: bug#27552: 25.2.50; Indentation problem in rnc-mode
References: <BEC9975E-04D0-431C-B2D4-E7E73A059C79@HIDDEN>
 <87k0akhshb.fsf@HIDDEN>
X-Now-Playing: The Wake's _Harmony & Singles_: "The Old Men"
Date: Wed, 15 Jun 2022 16:25:29 +0200
In-Reply-To: <87k0akhshb.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Tue,
 17 May 2022 21:25:04 +0200")
Message-ID: <87sfo6gg12.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Lars Ingebrigtsen <larsi@HIDDEN> writes: > I guess this
 "=" rule is for stuff like the "pattern =" etc. But it > leads to things like
 this being indented more for each line: > > default namesace rng =
 "http://relaxng.org/ns/structure/1.0" > [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 27552
Cc: 27552 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> I guess this "=" rule is for stuff like the "pattern =" etc.  But it
> leads to things like this being indented more for each line:
>
> default namesace rng = "http://relaxng.org/ns/structure/1.0"
> namespace local = ""
> datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

Or...  is the problem here that we don't end pattern with a newline?
Because the "assignment" ends at the newline in this case.

  (smie-prec2->grammar
   (smie-bnf->prec2
    '((id) (atom) (args)
      (header (header "include" atom))
      (decls (id "=" pattern) (id "|=" pattern) (id "&=" pattern)
             (decls " ; " decls))
      (pattern ("element" args) ("attribute" args)
               ("list" args) ("mixed" args)
               ("parent" id) ("external" id)
               ("grammar" atom)
	       ("{" pattern "}")
	       (pattern "," pattern)
	       (pattern "&" pattern)
	       (pattern "|" pattern)
	       (pattern "?")
	       (pattern "*")
	       (pattern "+")))


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27552; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 27552 <at> debbugs.gnu.org:


Received: (at 27552) by debbugs.gnu.org; 17 May 2022 19:25:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 17 15:25:18 2022
Received: from localhost ([127.0.0.1]:57983 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nr2oo-0006d2-2X
	for submit <at> debbugs.gnu.org; Tue, 17 May 2022 15:25:18 -0400
Received: from quimby.gnus.org ([95.216.78.240]:57036)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nr2ol-0006ck-Nf
 for 27552 <at> debbugs.gnu.org; Tue, 17 May 2022 15:25:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=OzKxpxRQeRGuy8l8uP3Gk/WYOXyQYT21toGIIdbPya8=; b=CsFQhvKSFB9V/8vHsL0WrTR4Uq
 Xt+L7RG351jaMGBg1vxca3U3x3Prt8GRfnRA+JsNaK+nYRoHi2QqEO5OJaWRP3NZ6xInHd2WgWvp3
 1YWxuY/S0bfHfzqctbnJMP+oSRyvJoy9BBNwULx2qPvgsnma7/tublBm3iJIppoTv0Xg=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nr2ob-0006Qa-1K; Tue, 17 May 2022 21:25:07 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Ivan Andrus <darthandrus@HIDDEN>
Subject: Re: bug#27552: 25.2.50; Indentation problem in rnc-mode
References: <BEC9975E-04D0-431C-B2D4-E7E73A059C79@HIDDEN>
X-Now-Playing: Stephan Mathieu's _Radiance (4): A Rainbow of Moonlight_: "A
 Rainbow of Moonlight"
Date: Tue, 17 May 2022 21:25:04 +0200
In-Reply-To: <BEC9975E-04D0-431C-B2D4-E7E73A059C79@HIDDEN> (Ivan Andrus's
 message of "Sat, 1 Jul 2017 14:33:59 -0600")
Message-ID: <87k0akhshb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Ivan Andrus <darthandrus@HIDDEN> writes: > The RNC snippet
 below (from > http://cs.brown.edu/courses/cs196-9/slidestore/relaxng.html)
 shows an > indentation problem when using multiple opening namespace/datatypes
 > clauses. > > -Ivan > > def [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: 27552
Cc: 27552 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ivan Andrus <darthandrus@HIDDEN> writes:

> The RNC snippet below (from
> http://cs.brown.edu/courses/cs196-9/slidestore/relaxng.html) shows an
> indentation problem when using multiple opening namespace/datatypes
> clauses.
>
> -Ivan
>
> default namespace rng = "http://relaxng.org/ns/structure/1.0"
>                             namespace local = ""
>                                                   datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
>
> start = pattern
>
> pattern =
>     element element { (nameQName | nameClass), (common & pattern+) }
>     | element attribute { (nameQName | nameClass), (common & pattern?) }
>     | element group|interleave|choice|optional


(defun rnc-smie-rules (kind token)
  (pcase (cons kind token)
    (`(:list-intro . "element") t)
    (`(:elem . empty-line-token) " ; ")
    (`(:before . ,(or "include" "default" "namespace" "datatypes")) 0)
[...]
    (`(:after . ,(or "=" "|=" "&=")) smie-indent-basic)

I guess this "=" rule is for stuff like the "pattern =" etc.  But it
leads to things like this being indented more for each line:

default namesace rng = "http://relaxng.org/ns/structure/1.0"
namespace local = ""
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

I betcha this is easy to express in smie, but I have no idea how, so
I've added Stefan to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27552; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Jul 2017 20:34:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 01 16:34:16 2017
Received: from localhost ([127.0.0.1]:47994 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dRP5s-00012I-8E
	for submit <at> debbugs.gnu.org; Sat, 01 Jul 2017 16:34:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35839)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <darthandrus@HIDDEN>) id 1dRP5q-000128-NB
 for submit <at> debbugs.gnu.org; Sat, 01 Jul 2017 16:34:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <darthandrus@HIDDEN>) id 1dRP5k-0002c4-Ar
 for submit <at> debbugs.gnu.org; Sat, 01 Jul 2017 16:34:09 -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.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:53837)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <darthandrus@HIDDEN>)
 id 1dRP5k-0002c0-6w
 for submit <at> debbugs.gnu.org; Sat, 01 Jul 2017 16:34:08 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55034)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <darthandrus@HIDDEN>) id 1dRP5i-00084X-Mj
 for bug-gnu-emacs@HIDDEN; Sat, 01 Jul 2017 16:34:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <darthandrus@HIDDEN>) id 1dRP5f-0002bH-Jc
 for bug-gnu-emacs@HIDDEN; Sat, 01 Jul 2017 16:34:06 -0400
Received: from mail-it0-x234.google.com ([2607:f8b0:4001:c0b::234]:35526)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <darthandrus@HIDDEN>)
 id 1dRP5f-0002ah-EW
 for bug-gnu-emacs@HIDDEN; Sat, 01 Jul 2017 16:34:03 -0400
Received: by mail-it0-x234.google.com with SMTP id v202so74243016itb.0
 for <bug-gnu-emacs@HIDDEN>; Sat, 01 Jul 2017 13:34:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:content-transfer-encoding:subject:message-id:date:to
 :mime-version; bh=KziSNqJ0jm+1vjjjYghtzhaC22Hd9pSrf2f+IR1yA94=;
 b=j90OwXgemZ1PhEBsv8CCZSBLGVxwkZxD5ObrctdZ7n25vaQ8+d189Kd06b+gggVc3W
 DXU1YGf9n38orwGBbEKhH8OTg0OhbDNCAzqPFlMgMn5doXjEd+uxmK42kGT3/L/ONxfU
 Qy7251t2T8qlnQGYE7ewa11Yh8XU2lgbnqS0+aBCWOa6dSdrp+pQOOGALU9BPHXQOjJi
 6KUv6dvGnzD55gREVu25LxqSOg+UN5Gvtk7vhrFfLzKkkcoJF/KwNZ6kDFGJATOf8wvy
 XtuTHk7vXgVaQau4pSNxRyy/do1Y0e9/U05ReLnnsjlL+bpJtOxd2rUdHZWdgfSJiBzq
 w4tw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:content-transfer-encoding:subject
 :message-id:date:to:mime-version;
 bh=KziSNqJ0jm+1vjjjYghtzhaC22Hd9pSrf2f+IR1yA94=;
 b=GIOJTgJHOaXpbvwVurl8265Lk+RNvt5dav9/eyigpR+AMWxiywpMvcoZAg5MbZMTqA
 si1HSdGq6w6E+wfckKvOaCMn3yu3aYcP6uUjKH4/FoeSaJoqlkNSlCyPi4ja5ulzaDcW
 IooZE3rJrIRK1fl5x23lOFSQ7oLjDDP63v25PdGQ8Sbbimom7saw38UNOICUsuCkXYfb
 plNxFnQTirQT5/6/iPIvmIjMA1Q4efGf9Vnrp6hNyAYrBQFaNePITqYoPH9XzIKescPL
 n5OEo7FwwdpDDMjSrDvu44uJmosO71jsuk9OhVC39oIzt/e5HRL/nWjcla/GFyMxL6cd
 jE4g==
X-Gm-Message-State: AKS2vOw6S5e4GrS4WKIyt5uBGf+EUfGjHpzsCgWLDPkFapLcJ0AstZas
 URVR19KN5YAIfaZ0w6w=
X-Received: by 10.36.89.139 with SMTP id p133mr25806304itb.5.1498941240838;
 Sat, 01 Jul 2017 13:34:00 -0700 (PDT)
Received: from [192.168.0.9] (174-23-124-127.slkc.qwest.net. [174.23.124.127])
 by smtp.gmail.com with ESMTPSA id
 t5sm415746ita.22.2017.07.01.13.34.00 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Sat, 01 Jul 2017 13:34:00 -0700 (PDT)
From: Ivan Andrus <darthandrus@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Subject: 25.2.50; Indentation problem in rnc-mode
Message-Id: <BEC9975E-04D0-431C-B2D4-E7E73A059C79@HIDDEN>
Date: Sat, 1 Jul 2017 14:33:59 -0600
To: bug-gnu-emacs@HIDDEN
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Mailer: Apple Mail (2.3124)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -6.8 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.8 (------)

The RNC snippet below (from
http://cs.brown.edu/courses/cs196-9/slidestore/relaxng.html) shows an
indentation problem when using multiple opening namespace/datatypes
clauses.

-Ivan

default namespace rng =3D "http://relaxng.org/ns/structure/1.0"
                            namespace local =3D ""
                                                  datatypes xsd =3D =
"http://www.w3.org/2001/XMLSchema-datatypes"

start =3D pattern

pattern =3D
    element element { (nameQName | nameClass), (common & pattern+) }
    | element attribute { (nameQName | nameClass), (common & pattern?) }
    | element group|interleave|choice|optional
              |zeroOrMore|oneOrMore|list|mixed { common & pattern+ }
    | element ref|parentRef { nameNCName, common }
    | element empty|notAllowed|text { common }
    | element data { type, param*, (common & exceptPattern?) }
    | element value { commonAttributes, type?, xsd:string }
    | element externalRef { href, common }
    | element grammar { common & grammarContent* }



In GNU Emacs 25.2.50.5 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 =
Version 10.11.6 (Build 15G1421))
of 2017-06-28 built on iandrus-osx
Repository revision: efe7a7f79f8eb9c716136561821d350b69456b55
Windowing system distributor 'Apple', version 10.3.1404
Configured using:
'configure --without-makeinfo PKG_CONFIG_PATH=3D/opt/X11/lib/pkgconfig'

Configured features:
JPEG RSVG DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: RNC

Minor modes in effect:
  achievements-mode: t
  highlight-symbol-mode: t
  which-function-mode: t
  show-paren-mode: t
  global-semantic-stickyfunc-mode: t
  save-place-mode: t
  msb-mode: t
  minibuffer-depth-indicate-mode: t
  gud-tooltip-mode: t
  global-hl-line-mode: t
  delete-selection-mode: t
  guide-key-mode: t
  auto-insert-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  ido-everywhere: t
  beacon-mode: t
  global-page-break-lines-mode: t
  gvol-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  TeX-PDF-mode: t
  global-edit-server-edit-mode: t
  auto-image-file-mode: t
  desktop-save-mode: t
  drag-stuff-global-mode: t
  drag-stuff-mode: t
  recentf-mode: t
  global-anzu-mode: t
  anzu-mode: t
  keyfreq-autosave-mode: t
  keyfreq-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t




Acknowledgement sent to Ivan Andrus <darthandrus@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#27552; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 15 Jun 2022 16:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.