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

Previous Next

Package: emacs;

Reported by: Sam Halliday <sam.halliday <at> gmail.com>

Date: Sat, 29 Jun 2019 13:24:02 UTC

Severity: normal

Found in version 26.2

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Sam Halliday <sam.halliday <at> gmail.com>
Cc: 36434 <at> debbugs.gnu.org
Subject: bug#36434: 26.2; smie-rule-next-p needs smie--after to be defined
Date: Sat, 29 Jun 2019 17:47:16 -0400
> 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





This bug report was last modified 3 years and 363 days ago.

Previous Next


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