소스 검색

ob-demarcate-block: visible region and completion during language selection

  Thanks to Sébastien Vauban for the suggestion

* lisp/ob.el (org-babel-demarcate-block): visible region and
  completion during language selection
Eric Schulte 14 년 전
부모
커밋
eb0068e9cd
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      lisp/ob.el

+ 4 - 1
lisp/ob.el

@@ -1141,11 +1141,14 @@ region is not active then the point is demarcated."
 	   (move-end-of-line 2))
          (sort (if (region-active-p) (list (mark) (point)) (list (point))) #'>))
       (let ((start (point))
+	    (lang (org-icompleting-read "Lang: "
+					(mapcar (lambda (el) (symbol-name (car el)))
+						org-babel-load-languages)))
 	    (body (delete-and-extract-region
 		   (if (region-active-p) (mark) (point)) (point))))
 	(insert (concat (if (looking-at "^") "" "\n")
 			(if arg (concat stars "\n") "")
-			"#+begin_src " (read-from-minibuffer "Lang: ") "\n"
+			"#+begin_src " lang "\n"
 			body
 			(if (or (= (length body) 0)
 				(string-match "[\r\n]$" body)) "" "\n")