|
@@ -8668,49 +8668,50 @@ Returns the new TODO keyword, or nil if no state change should occur."
|
|
|
(ncol (/ (- (window-width) 4) fwidth))
|
|
|
tg cnt e c tbl
|
|
|
groups ingroup)
|
|
|
- (save-window-excursion
|
|
|
- (if expert
|
|
|
- (set-buffer (get-buffer-create " *Org todo*"))
|
|
|
- (org-switch-to-buffer-other-window (get-buffer-create " *Org todo*")))
|
|
|
- (erase-buffer)
|
|
|
- (org-set-local 'org-done-keywords done-keywords)
|
|
|
- (setq tbl fulltable cnt 0)
|
|
|
- (while (setq e (pop tbl))
|
|
|
+ (save-excursion
|
|
|
+ (save-window-excursion
|
|
|
+ (if expert
|
|
|
+ (set-buffer (get-buffer-create " *Org todo*"))
|
|
|
+ (org-switch-to-buffer-other-window (get-buffer-create " *Org todo*")))
|
|
|
+ (erase-buffer)
|
|
|
+ (org-set-local 'org-done-keywords done-keywords)
|
|
|
+ (setq tbl fulltable cnt 0)
|
|
|
+ (while (setq e (pop tbl))
|
|
|
+ (cond
|
|
|
+ ((equal e '(:startgroup))
|
|
|
+ (push '() groups) (setq ingroup t)
|
|
|
+ (when (not (= cnt 0))
|
|
|
+ (setq cnt 0)
|
|
|
+ (insert "\n"))
|
|
|
+ (insert "{ "))
|
|
|
+ ((equal e '(:endgroup))
|
|
|
+ (setq ingroup nil cnt 0)
|
|
|
+ (insert "}\n"))
|
|
|
+ (t
|
|
|
+ (setq tg (car e) c (cdr e))
|
|
|
+ (if ingroup (push tg (car groups)))
|
|
|
+ (setq tg (org-add-props tg nil 'face
|
|
|
+ (org-get-todo-face tg)))
|
|
|
+ (if (and (= cnt 0) (not ingroup)) (insert " "))
|
|
|
+ (insert "[" c "] " tg (make-string
|
|
|
+ (- fwidth 4 (length tg)) ?\ ))
|
|
|
+ (when (= (setq cnt (1+ cnt)) ncol)
|
|
|
+ (insert "\n")
|
|
|
+ (if ingroup (insert " "))
|
|
|
+ (setq cnt 0)))))
|
|
|
+ (insert "\n")
|
|
|
+ (goto-char (point-min))
|
|
|
+ (if (not expert) (org-fit-window-to-buffer))
|
|
|
+ (message "[a-z..]:Set [SPC]:clear")
|
|
|
+ (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
|
|
|
(cond
|
|
|
- ((equal e '(:startgroup))
|
|
|
- (push '() groups) (setq ingroup t)
|
|
|
- (when (not (= cnt 0))
|
|
|
- (setq cnt 0)
|
|
|
- (insert "\n"))
|
|
|
- (insert "{ "))
|
|
|
- ((equal e '(:endgroup))
|
|
|
- (setq ingroup nil cnt 0)
|
|
|
- (insert "}\n"))
|
|
|
- (t
|
|
|
- (setq tg (car e) c (cdr e))
|
|
|
- (if ingroup (push tg (car groups)))
|
|
|
- (setq tg (org-add-props tg nil 'face
|
|
|
- (org-get-todo-face tg)))
|
|
|
- (if (and (= cnt 0) (not ingroup)) (insert " "))
|
|
|
- (insert "[" c "] " tg (make-string
|
|
|
- (- fwidth 4 (length tg)) ?\ ))
|
|
|
- (when (= (setq cnt (1+ cnt)) ncol)
|
|
|
- (insert "\n")
|
|
|
- (if ingroup (insert " "))
|
|
|
- (setq cnt 0)))))
|
|
|
- (insert "\n")
|
|
|
- (goto-char (point-min))
|
|
|
- (if (not expert) (org-fit-window-to-buffer))
|
|
|
- (message "[a-z..]:Set [SPC]:clear")
|
|
|
- (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
|
|
|
- (cond
|
|
|
- ((or (= c ?\C-g)
|
|
|
- (and (= c ?q) (not (rassoc c fulltable))))
|
|
|
- (setq quit-flag t))
|
|
|
- ((= c ?\ ) nil)
|
|
|
- ((setq e (rassoc c fulltable) tg (car e))
|
|
|
- tg)
|
|
|
- (t (setq quit-flag t))))))
|
|
|
+ ((or (= c ?\C-g)
|
|
|
+ (and (= c ?q) (not (rassoc c fulltable))))
|
|
|
+ (setq quit-flag t))
|
|
|
+ ((= c ?\ ) nil)
|
|
|
+ ((setq e (rassoc c fulltable) tg (car e))
|
|
|
+ tg)
|
|
|
+ (t (setq quit-flag t)))))))
|
|
|
|
|
|
(defun org-entry-is-todo-p ()
|
|
|
(member (org-get-todo-state) org-not-done-keywords))
|