GNU bug report logs - #36432
26.2; SMIE does not request forward tokens when point is at point-max

Previous Next

Package: emacs;

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

Date: Sat, 29 Jun 2019 12:15:01 UTC

Severity: normal

Found in version 26.2

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sam Halliday <sam.halliday <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.2; SMIE does not request forward tokens when point is at point-max
Date: Sat, 29 Jun 2019 13:14:01 +0100
SMIE (via a `indent-for-tab-command') does not request forward tokens
from the lexer when point is at `point-max'.

This might sound like a strange bug report: why should smie expect
there to be any tokens when it is already at point-max? The answer is:
virtual tokens. For example, Haskell may have many closing curly
brackets that live at the end of the buffer.

A workaround is to add a few stray newlines to the end of any buffer
that uses SMIE for indentation. Then SMIE will request the next tokens
(even thought there is only whitespace left until the end of the
buffer) and will receive at least one of those virtuals.




This bug report was last modified 5 years and 352 days ago.

Previous Next


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