GNU bug report logs -
#38255
27.0.50; Indentation error-out in css-mode
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Mon, 18 Nov 2019 12:16:02 UTC
Severity: normal
Found in version 27.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 38255-done <at> debbugs.gnu.org (full text, mbox):
>> foo {
>> }
>> }
>>
>> The following backtrace is triggered.
>>
>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>> smie-next-sexp(#f(compiled-function () #<bytecode 0x155d7de91a0d>)
>> #f(compiled-function (n) #<bytecode 0x155d7f00a465>) #<subr car>
>> #f(compiled-function (x) "Return the car of the cdr of X." #<bytecode
>> 0x1ffc61806017>) "}")
>> smie-backward-sexp("}")
>> smie-indent-keyword()
>> run-hook-with-args-until-success(smie-indent-keyword)
Thanks for the great recipe. I pushed the fix below to Emacs's master.
Stefan
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index f2163b243e..2c2898ae71 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -702,7 +702,11 @@ smie-next-sexp
(catch 'return
(let ((levels
(if (stringp halfsexp)
- (prog1 (list (cdr (assoc halfsexp smie-grammar)))
+ (prog1 (list (or (cdr (assoc halfsexp smie-grammar))
+ (when (string-match "\\`\\s(\\|\\s)\\(\\)\\'"
+ halfsexp)
+ (if (match-end 1) '(0 nil) '(nil 0)))
+ (error "Unknown token: %S" halfsexp)))
(setq halfsexp nil)))))
(while
(let* ((pos (point))
This bug report was last modified 5 years and 178 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.