Revert the change to `org-indent-line-function'.

This change was to avoid indentation in source code regions,
but the overhead is too large.
This commit is contained in:
Carsten Dominik 2008-09-19 16:14:09 +02:00
parent df098ce3f2
commit 08e7428858
2 changed files with 54 additions and 52 deletions

View File

@ -1,5 +1,8 @@
2008-09-19 Carsten Dominik <dominik@science.uva.nl> 2008-09-19 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-indent-line-function): No longer check for src
regions, this is too much overhead.
* org-agenda.el (org-agenda-highlight-todo): Fix bugs with keyword * org-agenda.el (org-agenda-highlight-todo): Fix bugs with keyword
matching. matching.

View File

@ -14159,59 +14159,58 @@ which make use of the date at the cursor."
(defun org-indent-line-function () (defun org-indent-line-function ()
"Indent line like previous, but further if previous was headline or item." "Indent line like previous, but further if previous was headline or item."
(interactive) (interactive)
(unless (org-edit-src-find-region-and-lang) (let* ((pos (point))
(let* ((pos (point)) (itemp (org-at-item-p))
(itemp (org-at-item-p)) 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 (beginning-of-line 1)
(beginning-of-line 1) (cond
((looking-at "#") (setq column 0))
((looking-at "\\*+ ") (setq column 0))
(t
(beginning-of-line 0)
(while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]"))
(beginning-of-line 0))
(cond (cond
((looking-at "#") (setq column 0)) ((looking-at "\\*+[ \t]+")
((looking-at "\\*+ ") (setq column 0)) (if (not org-adapt-indentation)
(t (setq column 0)
(beginning-of-line 0) (goto-char (match-end 0))
(while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]")) (setq column (current-column))))
(beginning-of-line 0)) ((org-in-item-p)
(cond (org-beginning-of-item)
((looking-at "\\*+[ \t]+") (looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\[[- X]\\][ \t]*\\|.*? :: \\)?")
(if (not org-adapt-indentation) (setq bpos (match-beginning 1) tpos (match-end 0)
(setq column 0) bcol (progn (goto-char bpos) (current-column))
(goto-char (match-end 0)) tcol (progn (goto-char tpos) (current-column))
(setq column (current-column)))) bullet (match-string 1)
((org-in-item-p) bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
(org-beginning-of-item) (if (> tcol (+ bcol org-description-max-indent))
(looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\[[- X]\\][ \t]*\\|.*? :: \\)?") (setq tcol (+ bcol 5)))
(setq bpos (match-beginning 1) tpos (match-end 0) (if (not itemp)
bcol (progn (goto-char bpos) (current-column)) (setq column tcol)
tcol (progn (goto-char tpos) (current-column)) (goto-char pos)
bullet (match-string 1) (beginning-of-line 1)
bullet-type (if (string-match "[0-9]" bullet) "n" bullet)) (if (looking-at "\\S-")
(if (> tcol (+ bcol org-description-max-indent)) (progn
(setq tcol (+ bcol 5))) (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
(if (not itemp) (setq bullet (match-string 1)
(setq column tcol) btype (if (string-match "[0-9]" bullet) "n" bullet))
(goto-char pos) (setq column (if (equal btype bullet-type) bcol tcol)))
(beginning-of-line 1) (setq column (org-get-indentation)))))
(if (looking-at "\\S-") (t (setq column (org-get-indentation))))))
(progn (goto-char pos)
(looking-at "[ \t]*\\(\\S-+\\)[ \t]*") (if (<= (current-column) (current-indentation))
(setq bullet (match-string 1) (org-indent-line-to column)
btype (if (string-match "[0-9]" bullet) "n" bullet)) (save-excursion (org-indent-line-to column)))
(setq column (if (equal btype bullet-type) bcol tcol))) (setq column (current-column))
(setq column (org-get-indentation))))) (beginning-of-line 1)
(t (setq column (org-get-indentation)))))) (if (looking-at
(goto-char pos) "\\([ \t]+\\)\\(:[-_0-9a-zA-Z]+:\\)[ \t]*\\(\\S-.*\\(\\S-\\|$\\)\\)")
(if (<= (current-column) (current-indentation)) (replace-match (concat "\\1" (format org-property-format
(org-indent-line-to column) (match-string 2) (match-string 3)))
(save-excursion (org-indent-line-to column))) t nil))
(setq column (current-column)) (org-move-to-column column)))
(beginning-of-line 1)
(if (looking-at
"\\([ \t]+\\)\\(:[-_0-9a-zA-Z]+:\\)[ \t]*\\(\\S-.*\\(\\S-\\|$\\)\\)")
(replace-match (concat "\\1" (format org-property-format
(match-string 2) (match-string 3)))
t nil))
(org-move-to-column column))))
(defun org-set-autofill-regexps () (defun org-set-autofill-regexps ()
(interactive) (interactive)