GNU bug report logs - #36434
26.2; smie-rule-next-p needs smie--after to be defined

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; Reported by: Sam Halliday <sam.halliday@HIDDEN>; dated Sat, 29 Jun 2019 13:24:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 36434) by debbugs.gnu.org; 29 Jun 2019 21:47:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 29 17:47:25 2019
Received: from localhost ([127.0.0.1]:45014 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hhLBt-0005OD-32
	for submit <at> debbugs.gnu.org; Sat, 29 Jun 2019 17:47:25 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:46872)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1hhLBr-0005O1-T1
 for 36434 <at> debbugs.gnu.org; Sat, 29 Jun 2019 17:47:24 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 856F181162;
 Sat, 29 Jun 2019 17:47:18 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6C57D80D82;
 Sat, 29 Jun 2019 17:47:17 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1561844837;
 bh=eyNECOHRypczJiWCirdLAx1UGzafWi/bow9/XmW1Ssc=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=bCPL8yWC382CwpBmDHr5HHKJ6dq3/n/6TFYKZQ1yQxtWz/AMCBfpETTnVOxLSbPD6
 JodJTmzOXuzQTILT1nLbKIS+eYysMXZaiFO/KEvrumX00mozapFdNKT5YtaQ7j8gby
 BlC2F7EKnst4jwZVw3Bml+IhX1OgQNUgLQlbxF7epbb/R5Ul1JHShkEko2lKzLEQfv
 Dne9mx6SELQP62byJGjatd8zOSYwo3KjfxhTqNb7Pg2y7KwU3vQVEdg7rQPFfcMI0x
 Ec3YIh7bk2d0EfHvzmMW+o9eJEm6365vXWnnQiE2h4EEZYC9EKJRIFAxMn7gYTnjuJ
 lBe95H9DIuukw==
Received: from alfajor (76-10-151-214.dsl.teksavvy.com [76.10.151.214])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3AB7C120AC4;
 Sat, 29 Jun 2019 17:47:17 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Sam Halliday <sam.halliday@HIDDEN>
Subject: Re: bug#36434: 26.2; smie-rule-next-p needs smie--after to be defined
Message-ID: <jwvimsokr4p.fsf-monnier+emacs@HIDDEN>
References: <CALR_T9CL_x5rzWzPH8W0ZbkJhQfO3+pShQreYbjqJvNQsx+5tw@HIDDEN>
Date: Sat, 29 Jun 2019 17:47:16 -0400
In-Reply-To: <CALR_T9CL_x5rzWzPH8W0ZbkJhQfO3+pShQreYbjqJvNQsx+5tw@HIDDEN>
 (Sam Halliday's message of "Sat, 29 Jun 2019 14:23:01 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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.145 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
X-SPAM-LEVEL: 
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36434
Cc: 36434 <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: -1.0 (-)

> When writing SMIE indentation rules, as per `smie-rules-function`,
> when an :elem is received (confirmed at least with 'empty-line-token)
> it is not possible to call the function smie-rule-parent-p, because
> the smie--after variable has not been defined.

[ Hmm... this is related to the smie-rule--parent mess.  ]

But I'm not completely sure how we can define "parent" in a really
unambiguous way, here: in the `empty-line-token` case we're presumably
on an empty line, so there's no token either immediately before or
immediately after.

Basically, I think this is a documentation bug: the smie-rule-*
functions are meant to be used for the :after and :before cases, but not
for :elem where there isn't necessarily such a clear "current token"
(tho I think it would be good to be more careful and try to
define such a "current token" when we can).

>         (defvar smie--after)
>         (setq smie--after (point))

Or use smie-backward-sexp rather than smie-rule-parent, which doesn't
depend on internals.


        Stefan





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

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


Received: (at 36434) by debbugs.gnu.org; 29 Jun 2019 13:27:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 29 09:27:15 2019
Received: from localhost ([127.0.0.1]:43616 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hhDNr-0007aH-9V
	for submit <at> debbugs.gnu.org; Sat, 29 Jun 2019 09:27:15 -0400
Received: from mail-ua1-f49.google.com ([209.85.222.49]:46537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sam.halliday@HIDDEN>) id 1hhDNp-0007a3-GT
 for 36434 <at> debbugs.gnu.org; Sat, 29 Jun 2019 09:27:13 -0400
Received: by mail-ua1-f49.google.com with SMTP id o19so3278611uap.13
 for <36434 <at> debbugs.gnu.org>; Sat, 29 Jun 2019 06:27:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=Ng8JYUOrvYFjj0tTVqqZ2q1z69rEYPcgB5EQdh6akkY=;
 b=RA1bnewE0pB7MLvh+G30CgjKc4unv9gXCCrNQ9r0awr0TMT1LzXNESm0Pqn/Y9WbWp
 NIclsQ+8u9DJCk2RqaK5kbGuYXJtj0BZGNU0MsPqisMR+a0guC3Ke2uW8mwo93cOC+ZR
 BBW3626R4zoqvx12A0/+fb64hosVxvI3MnOhkvQjL5qv1G6CntP2CtgtGVR7ksaQY/Xe
 oNy1LmVbN5jWCZKMmMLfTdnGgYwTzyviM3BajP0r9N0yEEseg3ChBsz8+EfDBi/27Dkb
 EkKgV0wPWdgZ8cFZYKLjxqqEde4D9CpoSmhzn9mS1ScbGDT6cgczdb8qNsKd309C1VF6
 gerw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=Ng8JYUOrvYFjj0tTVqqZ2q1z69rEYPcgB5EQdh6akkY=;
 b=FO8oEtvPvzoxtnLbfL/xvSQ8+ehk7hB+e1e61WfOd1kbv8VCYYQu4N9I3G4uHQ7REf
 nTman3oIeEC27GHPt2crKoPAFSiJ2U7K+7pGIXzlsrlO2/JVIlYpURsw2V7JTnoZqu58
 1a7wg8sKEW7J2GiGg79eTmfWgq1br52lfM53q9MMxR/AjW55eqOVkRj2JpMurr7jOglw
 VVie7Q5nJqmmEHvslth4YY8dH75UTXsdQN8MLjx2gtrnMAuw+9dc+Ivfy9myZaRtjJ0G
 iW48w5UfijDLbRdaSAxO4yt9vGBVgmU0GJKGEvIVbKVFWmWhQ/GfNkzUmsoWqile0nvb
 MOjw==
X-Gm-Message-State: APjAAAWr+CviV58yZ5xSOP3F8PG3+x8pdpA7XBVLs4uhOEz5FXtHQqOk
 BKLa1MqmKPrLSNtWpG2HlCzeh3rj68uim6NLgff4FQ==
X-Google-Smtp-Source: APXvYqzg9j5/aLVXyF01YFpngf3JdV7z3zkqpitPVgQxG6HXeoCjuzNwryNTQEGlzqW7leqthAjIJo1yB+KwtsvJR2M=
X-Received: by 2002:ab0:184e:: with SMTP id j14mr8713586uag.91.1561814827571; 
 Sat, 29 Jun 2019 06:27:07 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a9f:2427:0:0:0:0:0 with HTTP; Sat, 29 Jun 2019 06:27:07
 -0700 (PDT)
From: Sam Halliday <sam.halliday@HIDDEN>
Date: Sat, 29 Jun 2019 14:27:07 +0100
Message-ID: <CALR_T9BGmS97CMuxQ1vG0BMrZDYGcKyu1oBFi4OSBhqE1Ephiw@HIDDEN>
Subject: additional information
To: 36434 <at> debbugs.gnu.org
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36434
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: -1.0 (-)

Furthermore, and probably for the same reasons, it is not possible to
use `smie-rule-parent-p` in an :elem because `smie--parent` is not
defined.

FWIW I'm able to use these functions ok in a :before or :after




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

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


Received: (at submit) by debbugs.gnu.org; 29 Jun 2019 13:23:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 29 09:23:06 2019
Received: from localhost ([127.0.0.1]:43611 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hhDJp-0007Uj-M1
	for submit <at> debbugs.gnu.org; Sat, 29 Jun 2019 09:23:05 -0400
Received: from lists.gnu.org ([209.51.188.17]:37180)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sam.halliday@HIDDEN>) id 1hhDJo-0007Uc-4C
 for submit <at> debbugs.gnu.org; Sat, 29 Jun 2019 09:23:04 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45126)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <sam.halliday@HIDDEN>) id 1hhDJn-0000hv-7t
 for bug-gnu-emacs@HIDDEN; Sat, 29 Jun 2019 09:23: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=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <sam.halliday@HIDDEN>) id 1hhDJm-0002nB-EJ
 for bug-gnu-emacs@HIDDEN; Sat, 29 Jun 2019 09:23:03 -0400
Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]:34928)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <sam.halliday@HIDDEN>)
 id 1hhDJm-0002mf-AF
 for bug-gnu-emacs@HIDDEN; Sat, 29 Jun 2019 09:23:02 -0400
Received: by mail-ua1-x92f.google.com with SMTP id j21so3303279uap.2
 for <bug-gnu-emacs@HIDDEN>; Sat, 29 Jun 2019 06:23:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=3bT7BYlSBvbMv4E5DtiOxxPs4HMeMBV/o3elpSnURaE=;
 b=Fy9QOg6rM4BOpfL6r3w3sfd9VRRwBgx1rpR+6mqv86hxuVaeVfNXahRQyaRVrLZoni
 iO2IfB+WfGp29FFEpKpG1wV5XGOwRY+BnQS8yJFMrvdt2KqSvx2zH9kHhJnxyLBSX/oe
 Hh3CpXH3EgexUam2R8D0g+L9JPTAL5/Cq0bbLO4xSDD+5baz5UE2tX64U7wetwlOnbQW
 KxGyZhkdORwXAZyFWn5FxXYsFxzdLB7vpfvJEwWJqOQ+ouv3BnZyOQCGBjJQfoQCZ0+C
 i4XkTVsunt8WsuloRDGszuAiVHfcz+s8e8LhWFvJfBly+oUI2ikw3YhanmN5lTLvmgmh
 +axw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=3bT7BYlSBvbMv4E5DtiOxxPs4HMeMBV/o3elpSnURaE=;
 b=g0gFh0qhICcUefpmIif5yxcAQBzTnhlzFGKp21Tzmji4ZXs2xLQ2PGnyklSyXa8UwO
 LfkJNvGPPrmd6QhEhb79rKoMcsCpuW43uRG6vj0aWb2XImVI1bNB5F90nunH/8JKq1EB
 /r7UWlLgmzZEKRDaetEDgP4WQjP7hwW8icIPwd4DP6kiSRlbMl8NMxs1dhvlapF0G4JR
 9tLHl/P+tDuGnIA6+ixPtDcJagf2JiH2/RpEz9+jfo9hNrHxP0E4VMXhRUGC2+DiGvIX
 WXwcPO3dubGP7TMNDc4dgLknNw88ihOW7/aG+ovptPReecaZqS5lXnhvAbBj1/L1rHtn
 8dmg==
X-Gm-Message-State: APjAAAWGeP1vOCxVpXZAf+0c75omWZuIIyBkk8r2i1AretT28GucwOhK
 xI/UBFAyOeZM5qxC4LGIqNO5QaHnykPo7d7x0j6DFw==
X-Google-Smtp-Source: APXvYqzV9RAySPRfHZ4CJvlKnKtR92HiPQhqKacjaaVGOulQ52z/UjUWLd22YvJS7a9rM9uLB5SOH9G8p25qeRAl1VE=
X-Received: by 2002:ab0:184e:: with SMTP id j14mr8704160uag.91.1561814581394; 
 Sat, 29 Jun 2019 06:23:01 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a9f:2427:0:0:0:0:0 with HTTP; Sat, 29 Jun 2019 06:23:01
 -0700 (PDT)
From: Sam Halliday <sam.halliday@HIDDEN>
Date: Sat, 29 Jun 2019 14:23:01 +0100
Message-ID: <CALR_T9CL_x5rzWzPH8W0ZbkJhQfO3+pShQreYbjqJvNQsx+5tw@HIDDEN>
Subject: 26.2; smie-rule-next-p needs smie--after to be defined
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::92f
X-Spam-Score: -1.3 (-)
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: -2.3 (--)

When writing SMIE indentation rules, as per `smie-rules-function`,
when an :elem is received (confirmed at least with 'empty-line-token)
it is not possible to call the function smie-rule-parent-p, because
the smie--after variable has not been defined.

A workaround is to define the variable locally, e.g.

        (defvar smie--after)
        (setq smie--after (point))




Acknowledgement sent to Sam Halliday <sam.halliday@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#36434; 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: Mon, 25 Nov 2019 12:00:02 UTC

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