summaryrefslogtreecommitdiff
path: root/init.org
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2016-07-15 10:02:51 +0200
committerrekado <rekado@elephly.net>2016-07-15 10:02:51 +0200
commit305132b25eb60da67dbc27223d63d5a4588b63e0 (patch)
tree8ad0b7729bba512254dfa6cfd92490c6c18fd637 /init.org
parentd6283187ded6a0d564376d99f9e76af5e6177b0a (diff)
Move regexp for begin of org src block to variable.
Diffstat (limited to 'init.org')
-rw-r--r--init.org6
1 files changed, 4 insertions, 2 deletions
diff --git a/init.org b/init.org
index ee53fc7..5cd315c 100644
--- a/init.org
+++ b/init.org
@@ -290,13 +290,15 @@ from [[https://pank.eu/blog/pretty-babel-src-blocks.html][the blog of Rasmus Pan
#+BEGIN_SRC elisp
(defvar-local rasmus/org-at-src-begin -1
"Variable that holds whether last position was a ")
+(defvar-local my/org-src-begin-regexp
+ "^[ \t]*#\\+begin_src[ \t]+[^ \f\t\n\r\v]+[ \t]*")
(defvar rasmus/ob-header-symbol ?☰
"Symbol used for babel headers")
(defun rasmus/org-prettify-src--update ()
(let ((case-fold-search t)
- (re "^[ \t]*#\\+begin_src[ \t]+[^ \f\t\n\r\v]+[ \t]*")
+ (re my/org-src-begin-regexp)
found)
(save-excursion
(goto-char (point-min))
@@ -332,7 +334,7 @@ may not be efficient."
(let* ((case-fold-search t)
(at-src-block (save-excursion
(beginning-of-line)
- (looking-at "^[ \t]*#\\+begin_src[ \t]+[^ \f\t\n\r\v]+[ \t]*"))))
+ (looking-at my/org-src-begin-regexp))))
;; Test if we moved out of a block.
(when (or (and rasmus/org-at-src-begin
(not at-src-block))