Function: c-lang-major-mode-is

c-lang-major-mode-is is a byte-compiled function defined in cc-defs.el.gz.

Signature

(c-lang-major-mode-is MODE)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-defs.el.gz
(defun c-lang-major-mode-is (mode)
  ;; `c-major-mode-is' expands to a call to this function inside
  ;; `c-lang-defconst'.  Here we also match the mode(s) against any
  ;; fallback modes for the one in `c-buffer-is-cc-mode', so that
  ;; e.g. (c-major-mode-is 'c++-mode) is true in a derived language
  ;; that has c++-mode as base mode.
  (unless (listp mode)
    (setq mode (list mode)))
  (let (match (buf-mode c-buffer-is-cc-mode))
    (while (if (memq buf-mode mode)
	       (progn
		 (setq match t)
		 nil)
	     (setq buf-mode (get buf-mode 'c-fallback-mode))))
    match))