diff options
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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)) |