diff options
author | Bastien <bzg@gnu.org> | 2020-02-03 13:09:34 +0100 |
---|---|---|
committer | Bastien <bzg@gnu.org> | 2020-02-03 13:09:34 +0100 |
commit | cad2a6a588866237ba24f8de2c51037b4b31b0b3 (patch) | |
tree | bd50d98fbcbcd1f132c313c1a438897eed7becc3 | |
parent | 5c72d60d4494e249b65ec11ac2d5293d564e5444 (diff) | |
download | org-mode-cad2a6a588866237ba24f8de2c51037b4b31b0b3.tar.gz |
org-src.el: Enhance `org-edit-src-code'
* lisp/org-src.el (org-edit-src-code): Don't throw an error
when trying to find the source language in a non-interactive
call, typically when called for template expansion.
Thanks to Tyler Smith and Jack Kamm for reporting a related bug.
-rw-r--r-- | lisp/org-src.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el index 7876dea..3c6409d 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -1022,8 +1022,9 @@ name of the sub-editing buffer." (babel-info (and (eq type 'src-block) (org-babel-get-src-block-info 'light))) deactivate-mark) - (when (and (eq type 'src-block) (not (functionp lang-f))) - (error "No such language mode: %s" lang-f)) + (when (and (called-interactively-p 'any) + (eq type 'src-block) (not (functionp lang-f))) + (user-error "No such language mode: %s" lang-f)) (org-src--edit-element element (or edit-buffer-name |