Rudolf Adamkovič <rud...@adamkovic.org> writes: > Subject: [PATCH 1/2] Fall back to Fundamental mode when editing code
Thanks for the patch! Note that some tests are failing when I try "make test". Please make sure that all the tests are passing. > +(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 > + (progn I think progn is redundant here. > + (when (and fallback > + fallback-message-p > + (not (eq fallback mode))) > + (message "%s not available, falling back to %s" mode fallback)) > + fallback)))) > + (lang-f (org-src-get-lang-mode-if-bound > + lang > + #'fundamental-mode > + (not (string= lang lang-fallback))))) Is (not (string= lang lang-fallback)) necessary now, after message is never displayed when fallback is the same as the mode? -- 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>