Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2015-08-21 14:46:55 +02:00
commit 93fc10a141
1 changed files with 15 additions and 38 deletions

View File

@ -292,24 +292,14 @@ stopped."
(org-with-wide-buffer (org-with-wide-buffer
(goto-char beg) (goto-char beg)
(beginning-of-line) (beginning-of-line)
;; 1. Initialize prefix at BEG. This is done by storing two ;; Initialize prefix at BEG, according to current entry's level.
;; variables: INLINE-PF and PF, representing respectively
;; length of current `line-prefix' when line is inside an
;; inline task or not.
(let* ((case-fold-search t) (let* ((case-fold-search t)
(limited-re (org-get-limited-outline-regexp)) (limited-re (org-get-limited-outline-regexp))
(pf (save-excursion (level (or (org-current-level) 0))
(and (ignore-errors (let ((outline-regexp limited-re))
(org-back-to-heading t)))
(- (match-end 0) (match-beginning 0) 1))))
(pf-inline (and (featurep 'org-inlinetask)
(org-inlinetask-in-task-p)
(+ (* org-indent-indentation-per-level
(1- (org-inlinetask-get-task-level))) 2)))
(time-limit (and delay (time-add (current-time) delay)))) (time-limit (and delay (time-add (current-time) delay))))
;; 2. For each line, set `line-prefix' and `wrap-prefix' ;; For each line, set `line-prefix' and `wrap-prefix'
;; properties depending on the type of line (headline, ;; properties depending on the type of line (headline, inline
;; inline task, item or other). ;; task, item or other).
(org-with-silent-modifications (org-with-silent-modifications
(while (and (<= (point) end) (not (eobp))) (while (and (<= (point) end) (not (eobp)))
(cond (cond
@ -327,31 +317,18 @@ stopped."
(throw 'interrupt (point))) (throw 'interrupt (point)))
;; Headline or inline task. ;; Headline or inline task.
((looking-at org-outline-regexp) ((looking-at org-outline-regexp)
(let* ((nstars (- (match-end 0) (match-beginning 0) 1))) (let* ((nstars (- (match-end 0) (match-beginning 0) 1))
(cond (type (or (org-looking-at-p limited-re) 'inlinetask)))
;; Headline: new value for PF. (org-indent-set-line-properties nstars 0 type)
((looking-at limited-re) ;; At an headline, define new value for LEVEL.
(org-indent-set-line-properties nstars 0 t) (unless (eq type 'inlinetask) (setq level nstars))))
(setq pf nstars))
;; End of inline task: PF-INLINE is now nil.
((looking-at "\\*+ end[ \t]*$")
(org-indent-set-line-properties nstars 0 'inlinetask)
(setq pf-inline nil))
;; Start of inline task. Determine if it contains
;; text, or if it is only one line long. Set
;; PF-INLINE accordingly.
(t (org-indent-set-line-properties nstars 0 'inlinetask)
(setq pf-inline (and (org-inlinetask-in-task-p) nstars))))))
;; List item: `wrap-prefix' is set where body starts. ;; List item: `wrap-prefix' is set where body starts.
((org-at-item-p) ((org-at-item-p)
(let* ((line (or pf-inline pf 0))
(wrap (org-list-item-body-column (point))))
(org-indent-set-line-properties (org-indent-set-line-properties
(or pf-inline pf 0) level (org-list-item-body-column (point))))
(org-list-item-body-column (point))))) ;; Regular line.
;; Normal line: use PF-INLINE, PF or nil as prefixes. (t
(t (org-indent-set-line-properties (org-indent-set-line-properties level (org-get-indentation))))))))))
(or pf-inline pf 0) (org-get-indentation))))))))))
(defun org-indent-notify-modified-headline (beg end) (defun org-indent-notify-modified-headline (beg end)
"Set `org-indent-modified-headline-flag' depending on context. "Set `org-indent-modified-headline-flag' depending on context.