Below major mode is a dummy mode just derived from c-mode:

;; a simple major mode, mylang-mode
(define-derived-mode mylang-mode c-mode
  "major mode for editing mylang language code."
  (message "dummy"))

;; add the mode to the `features' list
(provide 'mylang-mode)

But when I switch on this mode by M-x mylang-mode, I always get below warning message:

Warning (irony): Major mode is unknown to Irony, see

I try to add below line to init.el but not helpful:

(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)

1 Answer 1


irony-supported-major-modes is the list of major modes known to be compatible with irony, and although your mode extends c-mode irony doesn't know that it's supported. Add your mode to the list with something like (push 'mylang-mode irony-supported-major-modes) and the warning ought to go away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.