|
@@ -1615,16 +1615,6 @@ category, you can use:
|
|
|
:group 'org-agenda-column-view
|
|
|
:type 'boolean)
|
|
|
|
|
|
-(defcustom org-agenda-columns-remove-prefix-from-item t
|
|
|
- "Non-nil means remove the prefix from a headline for agenda column view.
|
|
|
-The special ITEM field in the columns format contains the current line, with
|
|
|
-all information shown in other columns (like the TODO state or a tag).
|
|
|
-When this variable is non-nil, also the agenda prefix will be removed from
|
|
|
-the content of the ITEM field, to make sure as much as possible of the
|
|
|
-headline can be shown in the limited width of the field."
|
|
|
- :group 'org-agenda
|
|
|
- :type 'boolean)
|
|
|
-
|
|
|
(defcustom org-agenda-columns-compute-summary-properties t
|
|
|
"Non-nil means recompute all summary properties before column view.
|
|
|
When column view in the agenda is listing properties that have a summary
|
|
@@ -5341,6 +5331,10 @@ Any match of REMOVE-RE will be removed from TXT."
|
|
|
(while (string-match remove-re txt)
|
|
|
(setq txt (replace-match "" t t txt))))
|
|
|
|
|
|
+ ;; Set org-heading property on `rtn' to mark the start of the
|
|
|
+ ;; heading.
|
|
|
+ (setq txt (propertize txt 'org-heading t))
|
|
|
+
|
|
|
;; Create the final string
|
|
|
(if noprefix
|
|
|
(setq rtn txt)
|
|
@@ -5381,7 +5375,6 @@ Any match of REMOVE-RE will be removed from TXT."
|
|
|
'tags (mapcar 'org-downcase-keep-props tags)
|
|
|
'org-highest-priority org-highest-priority
|
|
|
'org-lowest-priority org-lowest-priority
|
|
|
- 'prefix-length (- (length rtn) (length txt))
|
|
|
'time-of-day time-of-day
|
|
|
'duration duration
|
|
|
'effort effort
|
|
@@ -5590,12 +5583,12 @@ could bind the variable in the options section of a custom command.")
|
|
|
(defun org-agenda-highlight-todo (x)
|
|
|
(let ((org-done-keywords org-done-keywords-for-agenda)
|
|
|
(case-fold-search nil)
|
|
|
- re pl)
|
|
|
+ re)
|
|
|
(if (eq x 'line)
|
|
|
(save-excursion
|
|
|
(beginning-of-line 1)
|
|
|
(setq re (org-get-at-bol 'org-todo-regexp))
|
|
|
- (goto-char (+ (point) (or (org-get-at-bol 'prefix-length) 0)))
|
|
|
+ (goto-char (or (text-property-any (point-at-bol) (point-at-eol) 'org-heading t) (point)))
|
|
|
(when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
|
|
|
(add-text-properties (match-beginning 0) (match-end 1)
|
|
|
(list 'face (org-get-todo-face 1)))
|
|
@@ -5603,21 +5596,21 @@ could bind the variable in the options section of a custom command.")
|
|
|
(delete-region (match-beginning 1) (1- (match-end 0)))
|
|
|
(goto-char (match-beginning 1))
|
|
|
(insert (format org-agenda-todo-keyword-format s)))))
|
|
|
- (setq re (concat (get-text-property 0 'org-todo-regexp x))
|
|
|
- pl (get-text-property 0 'prefix-length x))
|
|
|
- (when (and re
|
|
|
- (equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)")
|
|
|
- x (or pl 0)) pl))
|
|
|
- (add-text-properties
|
|
|
- (or (match-end 1) (match-end 0)) (match-end 0)
|
|
|
- (list 'face (org-get-todo-face (match-string 2 x)))
|
|
|
+ (let ((pl (text-property-any 0 (length x) 'org-heading t x)))
|
|
|
+ (setq re (concat (get-text-property 0 'org-todo-regexp x)))
|
|
|
+ (when (and re
|
|
|
+ (equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)")
|
|
|
+ x (or pl 0)) pl))
|
|
|
+ (add-text-properties
|
|
|
+ (or (match-end 1) (match-end 0)) (match-end 0)
|
|
|
+ (list 'face (org-get-todo-face (match-string 2 x)))
|
|
|
x)
|
|
|
- (when (match-end 1)
|
|
|
- (setq x (concat (substring x 0 (match-end 1))
|
|
|
- (format org-agenda-todo-keyword-format
|
|
|
- (match-string 2 x))
|
|
|
+ (when (match-end 1)
|
|
|
+ (setq x (concat (substring x 0 (match-end 1))
|
|
|
+ (format org-agenda-todo-keyword-format
|
|
|
+ (match-string 2 x))
|
|
|
(org-add-props " " (text-properties-at 0 x))
|
|
|
- (substring x (match-end 3))))))
|
|
|
+ (substring x (match-end 3)))))))
|
|
|
x)))
|
|
|
|
|
|
(defsubst org-cmp-priority (a b)
|
|
@@ -5670,8 +5663,8 @@ could bind the variable in the options section of a custom command.")
|
|
|
|
|
|
(defsubst org-cmp-alpha (a b)
|
|
|
"Compare the headlines, alphabetically."
|
|
|
- (let* ((pla (get-text-property 0 'prefix-length a))
|
|
|
- (plb (get-text-property 0 'prefix-length b))
|
|
|
+ (let* ((pla (text-property-any 0 (length a) 'org-heading t a))
|
|
|
+ (plb (text-property-any 0 (length b) 'org-heading t b))
|
|
|
(ta (and pla (substring a pla)))
|
|
|
(tb (and plb (substring b plb))))
|
|
|
(when pla
|
|
@@ -6739,8 +6732,8 @@ at the text of the entry itself."
|
|
|
(buffer (and marker (marker-buffer marker)))
|
|
|
(prefix (buffer-substring
|
|
|
(point-at-bol)
|
|
|
- (+ (point-at-bol)
|
|
|
- (or (org-get-at-bol 'prefix-length) 0)))))
|
|
|
+ (or (text-property-any (point-at-bol) (point-at-eol) 'org-heading t)
|
|
|
+ (point-at-bol)))))
|
|
|
(cond
|
|
|
(buffer
|
|
|
(with-current-buffer buffer
|
|
@@ -7057,11 +7050,10 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
|
|
|
cat (org-get-at-bol 'org-category)
|
|
|
tags thetags
|
|
|
new (org-format-agenda-item "x" newhead cat tags dotime 'noprefix)
|
|
|
- pl (org-get-at-bol 'prefix-length)
|
|
|
+ pl (text-property-any (point-at-bol) (point-at-eol) 'org-heading t)
|
|
|
undone-face (org-get-at-bol 'undone-face)
|
|
|
done-face (org-get-at-bol 'done-face))
|
|
|
- (goto-char (+ (point) pl))
|
|
|
- ;; (org-move-to-column pl) FIXME: does the above line work correctly?
|
|
|
+ (goto-char pl)
|
|
|
(cond
|
|
|
((equal new "")
|
|
|
(beginning-of-line 1)
|