Function: org-src-get-lang-mode-if-bound

org-src-get-lang-mode-if-bound is a byte-compiled function defined in org-src.el.gz.

Signature

(org-src-get-lang-mode-if-bound LANG &optional FALLBACK FALLBACK-MESSAGE-P)

Documentation

Return major mode for LANG, if bound, and FALLBACK otherwise.

LANG is a string. FALLBACK and the returned value are both symbols. If FALLBACK-MESSAGE-P and FALLBACK are both non-nil, display a message when falling back to a major mode different from that for LANG.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-src.el.gz
(defun org-src-get-lang-mode-if-bound (lang &optional fallback fallback-message-p)
  "Return major mode for LANG, if bound, and FALLBACK otherwise.
LANG is a string.  FALLBACK and the returned value are both symbols.  If
FALLBACK-MESSAGE-P and FALLBACK are both non-nil, display a message when
falling back to a major mode different from that for LANG."
  (let ((mode (org-src-get-lang-mode lang)))
    (if (functionp mode)
        mode
      (when (and fallback
                 fallback-message-p
                 (not (eq fallback mode)))
        (message "%s not available, falling back to %s" mode fallback))
      fallback)))