瀏覽代碼

org-eldoc: Handle source blocks with empty language

* contrib/lisp/org-eldoc.el (org-eldoc-get-src-header): When inserting
  a new src block, the language may not yet be chosen when this is
  called.
Fabrice Popineau 8 年之前
父節點
當前提交
ebe7aa6692
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      contrib/lisp/org-eldoc.el

+ 1 - 1
contrib/lisp/org-eldoc.el

@@ -70,7 +70,7 @@
       (save-match-data
         (when (looking-at "^[ \t]*#\\+\\(begin\\|end\\)_src")
           (setq info (org-babel-get-src-block-info 'light)
-                lang (propertize (nth 0 info) 'face 'font-lock-string-face)
+                lang (propertize (or (nth 0 info) "no lang") 'face 'font-lock-string-face)
                 hdr-args (nth 2 info))
           (concat
            lang