Rudolf Adamkovič <rud...@adamkovic.org> writes:

> I did not change `org-src-get-lang-mode' directly.  Instead I wrapped
> it in `org-src-get-lang-mode-if-bound' which does little more.  WDYT?

Thanks for the patch!
You are introducing a new behavior, so please update etc/ORG-NEWS.
Also, 16.10 Editing Source Code section of the manual needs an update.

> +(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 is non-nil, display a message when using FALLBACK."
> +  (let ((mode (org-src-get-lang-mode lang)))
> +    (if (functionp mode) mode
> +      (when fallback-message-p
> +        (message "%s not available, falling back to %s" mode fallback)
> +        fallback))))

Maybe you can suppress the message when FALLBACK == MODE.
Also, what if FALLBACK is also not bound?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to