slightly cleaner code
This commit is contained in:
parent
0974acd7b4
commit
700324bfbf
|
@ -149,25 +149,17 @@ of the following form. (language body header-arguments-alist)"
|
||||||
(if (or
|
(if (or
|
||||||
(save-excursion ;; on a #+srcname: line
|
(save-excursion ;; on a #+srcname: line
|
||||||
(beginning-of-line 1)
|
(beginning-of-line 1)
|
||||||
(and
|
(and (looking-at "#\\+srcname") (forward-line 1)
|
||||||
(looking-at "#\\+srcname")
|
(looking-at litorgy-src-block-regexp)))
|
||||||
(progn
|
|
||||||
(forward-line 1)
|
|
||||||
(looking-at litorgy-src-block-regexp))))
|
|
||||||
(save-excursion ;; on a #+begin_src line
|
(save-excursion ;; on a #+begin_src line
|
||||||
(beginning-of-line 1)
|
(beginning-of-line 1) (looking-at litorgy-src-block-regexp))
|
||||||
(looking-at litorgy-src-block-regexp))
|
|
||||||
(save-excursion ;; inside a src block
|
(save-excursion ;; inside a src block
|
||||||
(and
|
(and
|
||||||
(setq middle (point))
|
(setq middle (point)) (re-search-backward "#\\+begin_src" nil t)
|
||||||
(re-search-backward "#\\+begin_src" nil t)
|
(setq top (point)) (re-search-forward "#\\+end_src" nil t)
|
||||||
(setq top (point))
|
|
||||||
(re-search-forward "#\\+end_src" nil t)
|
|
||||||
(setq bottom (point))
|
(setq bottom (point))
|
||||||
(< top middle)
|
(< top middle) (< middle bottom)
|
||||||
(< middle bottom)
|
(goto-char top) (looking-at litorgy-src-block-regexp))))
|
||||||
(goto-char top)
|
|
||||||
(looking-at litorgy-src-block-regexp))))
|
|
||||||
(litorgy-parse-src-block-match)
|
(litorgy-parse-src-block-match)
|
||||||
(if (save-excursion ;; inline source block
|
(if (save-excursion ;; inline source block
|
||||||
(re-search-backward "[ \f\t\n\r\v]" nil t)
|
(re-search-backward "[ \f\t\n\r\v]" nil t)
|
||||||
|
|
Loading…
Reference in New Issue