diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ced5f9f82..9f219048d 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2009-06-07 Carsten Dominik + * org.el (org-indent-line-function): Fix indentation of +#end lines. + * org-src.el (org-edit-src-get-indentation): New function. (org-edit-src-code): Base indentation on the begin line. diff --git a/lisp/org.el b/lisp/org.el index 53fa1c1fb..80fd75557 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15685,6 +15685,7 @@ which make use of the date at the cursor." (interactive) (let* ((pos (point)) (itemp (org-at-item-p)) + (case-fold-search t) (org-drawer-regexp (or org-drawer-regexp "\000")) column bpos bcol tpos tcol bullet btype bullet-type) ;; Find the previous relevant line @@ -15697,6 +15698,11 @@ which make use of the date at the cursor." (save-excursion (goto-char (1- (match-beginning 1))) (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 (beginning-of-line 0) (while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]")