mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 21:37:50 +00:00
lisp/ob-core.el: Use lower-case by default for block keywords
* lisp/ob-core.el (org-babel-demarcate-block): Use lower-case by default.
This commit is contained in:
parent
1837cfb0e2
commit
5f0a9cca3d
|
@ -1890,9 +1890,9 @@ region is not active then the point is demarcated."
|
||||||
(block (and start (match-string 0)))
|
(block (and start (match-string 0)))
|
||||||
(headers (and start (match-string 4)))
|
(headers (and start (match-string 4)))
|
||||||
(stars (concat (make-string (or (org-current-level) 1) ?*) " "))
|
(stars (concat (make-string (or (org-current-level) 1) ?*) " "))
|
||||||
(lower-case-p (and block
|
(upper-case-p (and block
|
||||||
(let (case-fold-search)
|
(let (case-fold-search)
|
||||||
(string-match-p "#\\+begin_src" block)))))
|
(string-match-p "#\\+BEGIN_SRC" block)))))
|
||||||
(if info
|
(if info
|
||||||
(mapc
|
(mapc
|
||||||
(lambda (place)
|
(lambda (place)
|
||||||
|
@ -1906,9 +1906,9 @@ region is not active then the point is demarcated."
|
||||||
(delete-region (point-at-bol) (point-at-eol)))
|
(delete-region (point-at-bol) (point-at-eol)))
|
||||||
(insert (concat
|
(insert (concat
|
||||||
(if (looking-at "^") "" "\n")
|
(if (looking-at "^") "" "\n")
|
||||||
indent (funcall (if lower-case-p 'downcase 'upcase) "#+end_src\n")
|
indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
|
||||||
(if arg stars indent) "\n"
|
(if arg stars indent) "\n"
|
||||||
indent (funcall (if lower-case-p 'downcase 'upcase) "#+begin_src ")
|
indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
|
||||||
lang
|
lang
|
||||||
(if (> (length headers) 1)
|
(if (> (length headers) 1)
|
||||||
(concat " " headers) headers)
|
(concat " " headers) headers)
|
||||||
|
@ -1929,14 +1929,16 @@ region is not active then the point is demarcated."
|
||||||
(if (org-region-active-p) (mark) (point)) (point))))
|
(if (org-region-active-p) (mark) (point)) (point))))
|
||||||
(insert (concat (if (looking-at "^") "" "\n")
|
(insert (concat (if (looking-at "^") "" "\n")
|
||||||
(if arg (concat stars "\n") "")
|
(if arg (concat stars "\n") "")
|
||||||
(funcall (if lower-case-p 'downcase 'upcase) "#+begin_src ")
|
(if upper-case-p "#+BEGIN_SRC " "#+begin_src ")
|
||||||
lang "\n"
|
lang "\n" body
|
||||||
body
|
|
||||||
(if (or (= (length body) 0)
|
(if (or (= (length body) 0)
|
||||||
(string-suffix-p "\r" body)
|
(string-suffix-p "\r" body)
|
||||||
(string-suffix-p "\n" body)) "" "\n")
|
(string-suffix-p "\n" body))
|
||||||
(funcall (if lower-case-p 'downcase 'upcase) "#+end_src\n")))
|
""
|
||||||
(goto-char start) (move-end-of-line 1)))))
|
"\n")
|
||||||
|
(if upper-case-p "#+END_SRC\n" "#+end_src\n")))
|
||||||
|
(goto-char start)
|
||||||
|
(move-end-of-line 1)))))
|
||||||
|
|
||||||
(defun org-babel--insert-results-keyword (name hash)
|
(defun org-babel--insert-results-keyword (name hash)
|
||||||
"Insert RESULTS keyword with NAME value at point.
|
"Insert RESULTS keyword with NAME value at point.
|
||||||
|
|
Loading…
Reference in a new issue