summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2008-09-19 16:14:09 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2008-09-19 16:14:09 +0200
commit08e74288584992e3b512b6298be1823511265158 (patch)
tree16e208c325174b9a9ac399e7a605fcf46a02478b
parentdf098ce3f254b4089186018df0501f5e0078e185 (diff)
downloadorg-mode-08e74288584992e3b512b6298be1823511265158.tar.gz
Revert the change to `org-indent-line-function'.
This change was to avoid indentation in source code regions, but the overhead is too large.
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org.el103
2 files changed, 54 insertions, 52 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9453550..cd59a37 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
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
matching.
diff --git a/lisp/org.el b/lisp/org.el
index b0c966a..109cc7c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14159,59 +14159,58 @@ which make use of the date at the cursor."
(defun org-indent-line-function ()
"Indent line like previous, but further if previous was headline or item."
(interactive)
- (unless (org-edit-src-find-region-and-lang)
- (let* ((pos (point))
- (itemp (org-at-item-p))
- column bpos bcol tpos tcol bullet btype bullet-type)
- ;; Find the previous relevant line
- (beginning-of-line 1)
+ (let* ((pos (point))
+ (itemp (org-at-item-p))
+ column bpos bcol tpos tcol bullet btype bullet-type)
+ ;; Find the previous relevant line
+ (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
- ((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
- ((looking-at "\\*+[ \t]+")
- (if (not org-adapt-indentation)
- (setq column 0)
- (goto-char (match-end 0))
- (setq column (current-column))))
- ((org-in-item-p)
- (org-beginning-of-item)
- (looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\[[- X]\\][ \t]*\\|.*? :: \\)?")
- (setq bpos (match-beginning 1) tpos (match-end 0)
- bcol (progn (goto-char bpos) (current-column))
- tcol (progn (goto-char tpos) (current-column))
- bullet (match-string 1)
- bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
- (if (> tcol (+ bcol org-description-max-indent))
- (setq tcol (+ bcol 5)))
- (if (not itemp)
- (setq column tcol)
- (goto-char pos)
- (beginning-of-line 1)
- (if (looking-at "\\S-")
- (progn
- (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
- (setq bullet (match-string 1)
- btype (if (string-match "[0-9]" bullet) "n" bullet))
- (setq column (if (equal btype bullet-type) bcol tcol)))
- (setq column (org-get-indentation)))))
- (t (setq column (org-get-indentation))))))
- (goto-char pos)
- (if (<= (current-column) (current-indentation))
- (org-indent-line-to column)
- (save-excursion (org-indent-line-to column)))
- (setq column (current-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))))
+ ((looking-at "\\*+[ \t]+")
+ (if (not org-adapt-indentation)
+ (setq column 0)
+ (goto-char (match-end 0))
+ (setq column (current-column))))
+ ((org-in-item-p)
+ (org-beginning-of-item)
+ (looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\[[- X]\\][ \t]*\\|.*? :: \\)?")
+ (setq bpos (match-beginning 1) tpos (match-end 0)
+ bcol (progn (goto-char bpos) (current-column))
+ tcol (progn (goto-char tpos) (current-column))
+ bullet (match-string 1)
+ bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
+ (if (> tcol (+ bcol org-description-max-indent))
+ (setq tcol (+ bcol 5)))
+ (if (not itemp)
+ (setq column tcol)
+ (goto-char pos)
+ (beginning-of-line 1)
+ (if (looking-at "\\S-")
+ (progn
+ (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
+ (setq bullet (match-string 1)
+ btype (if (string-match "[0-9]" bullet) "n" bullet))
+ (setq column (if (equal btype bullet-type) bcol tcol)))
+ (setq column (org-get-indentation)))))
+ (t (setq column (org-get-indentation))))))
+ (goto-char pos)
+ (if (<= (current-column) (current-indentation))
+ (org-indent-line-to column)
+ (save-excursion (org-indent-line-to column)))
+ (setq column (current-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 ()
(interactive)