Skip to content

Commit

Permalink
* lisp/progmodes/antlr-mode.el: Fix bootstrap failure
Browse files Browse the repository at this point in the history
(antlr-mode): Remove compatibility code with older CC-mode.
This somehow appears to fix the error:

    In antlr-mode:
    progmodes/antlr-mode.el:2426:20: Error: `c-init-language-vars' defined
        after use in (c-init-language-vars) (missing `require' of a library
        file?)
    progmodes/antlr-mode.el:2427:26: Warning: c-init-language-vars called
        with 0 arguments, but requires 1

No idea what caused the error to appear after the previous patch either.
  • Loading branch information
monnier committed Feb 22, 2021
1 parent 97eec9d commit efe42c2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lisp/progmodes/antlr-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2418,16 +2418,7 @@ the default language."
(cadr (assq antlr-language antlr-language-alist)))))
;; indentation, for the C engine -------------------------------------------
(setq c-buffer-is-cc-mode antlr-language)
(cond ((fboundp 'c-init-language-vars-for) ; cc-mode 5.30.5+
(c-init-language-vars-for antlr-language))
((fboundp 'c-init-c-language-vars) ; cc-mode 5.30 to 5.30.4
(c-init-c-language-vars) ; not perfect, but OK
(setq c-recognize-knr-p nil))
((fboundp 'c-init-language-vars) ; cc-mode 5.29
(let ((init-fn 'c-init-language-vars))
(funcall init-fn))) ; is a function in v5.29
(t ; cc-mode upto 5.28
(antlr-c-init-language-vars))) ; do it myself
(c-init-language-vars-for antlr-language)
(c-basic-common-init antlr-language (or antlr-indent-style "gnu"))
(set (make-local-variable 'outline-regexp) "[^#\n\^M]")
(set (make-local-variable 'outline-level) #'c-outline-level) ;TODO: define own
Expand Down Expand Up @@ -2471,6 +2462,6 @@ Used in `antlr-mode'. Also a useful function in `java-mode-hook'."

(provide 'antlr-mode)

;;; Local IspellPersDict: .ispell_antlr
;; Local IspellPersDict: .ispell_antlr

;;; antlr-mode.el ends here

0 comments on commit efe42c2

Please sign in to comment.