Преглед на файлове

Tolerate editing an export block without type

* lisp/org-src.el (org-edit-export-block): Tolerate editing an export
  block without type.
Nicolas Goaziou преди 7 години
родител
ревизия
d50170b208
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      lisp/org-src.el

+ 4 - 1
lisp/org-src.el

@@ -920,7 +920,10 @@ Throw an error when not at an export block."
     (unless (and (eq (org-element-type element) 'export-block)
 		 (org-src--on-datum-p element))
       (user-error "Not in an export block"))
-    (let* ((type (downcase (org-element-property :type element)))
+    (let* ((type (downcase (or (org-element-property :type element)
+			       ;; Missing export-block type.  Fallback
+			       ;; to default mode.
+			       "fundamental")))
 	   (mode (org-src--get-lang-mode type)))
       (unless (functionp mode) (error "No such language mode: %s" mode))
       (org-src--edit-element