Open ghost opened 6 years ago
Adding this near the other c-lang-defconst
calls seems to fix the problem. cc-mode seems to be defaulting some stuff to nil
and then passing that to looking-at
(which apparently doesn't like nil
).
(c-lang-defconst c-cpp-expr-functions-key
yang "")
(c-lang-defconst c-opt-op-identifier-prefix
yang "")
I'm not really sure if ""
is the right thing for YANG though
Since the time of the original issue, more variables cause problems. Another solution is to derive yang-mode
from js-mode
, rather then java-mode
:
@@ -157,12 +157,13 @@
(require 'cc-langs)
(require 'cc-fonts))
+(require 'js)
(eval-and-compile
;; Make our mode known to the language constant system. Use Java
;; mode as the fallback for the constants we don't change here.
;; This needs to be done also at compile time since the language
;; constants are evaluated then.
- (c-add-language 'yang-mode 'java-mode)
+ (c-add-language 'yang-mode 'js-mode)
;; compatibility with emacs < 24
(defalias 'yang-mode-prog-mode
It does't take much to reproduce this, just type
module foo {
in a new .yang file and you'll get a backtrace like this.Using yang-mode packaage
20180306.407
on Emacs 26.1