Indentation: Make #+end line up with #+begin

This commit is contained in:
Carsten Dominik 2009-06-07 23:21:55 +02:00
parent ea846889f2
commit ef57d7b90c
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2009-06-07 Carsten Dominik <carsten.dominik@gmail.com> 2009-06-07 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-indent-line-function): Fix indentation of +#end lines.
* org-src.el (org-edit-src-get-indentation): New function. * org-src.el (org-edit-src-get-indentation): New function.
(org-edit-src-code): Base indentation on the begin line. (org-edit-src-code): Base indentation on the begin line.

View File

@ -15685,6 +15685,7 @@ which make use of the date at the cursor."
(interactive) (interactive)
(let* ((pos (point)) (let* ((pos (point))
(itemp (org-at-item-p)) (itemp (org-at-item-p))
(case-fold-search t)
(org-drawer-regexp (or org-drawer-regexp "\000")) (org-drawer-regexp (or org-drawer-regexp "\000"))
column bpos bcol tpos tcol bullet btype bullet-type) column bpos bcol tpos tcol bullet btype bullet-type)
;; Find the previous relevant line ;; Find the previous relevant line
@ -15697,6 +15698,11 @@ which make use of the date at the cursor."
(save-excursion (save-excursion
(goto-char (1- (match-beginning 1))) (goto-char (1- (match-beginning 1)))
(setq column (current-column)))) (setq column (current-column))))
((and (looking-at "[ \t]+#\\+end_\\([a-z]+\\)")
(save-excursion
(re-search-backward
(concat "^[ \t]*#\\+begin_" (downcase (match-string 1))) nil t)))
(setq column (org-get-indentation (match-string 0))))
(t (t
(beginning-of-line 0) (beginning-of-line 0)
(while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]") (while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]")