From 2d795f8ae0e390a22d914bdce52ef3027b79e909 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 9 Feb 2009 12:36:06 +0100 Subject: [PATCH] TODO: Make in-buffer keyword setting more general Now any line like #+XYZ_TODO: will be assumed to define some kind of TODO chain. If the handlers in `org-todo-setup-filter-hook' do not do anything with this sequence, it will be treated as `sequence'. --- lisp/ChangeLog | 3 +++ lisp/org.el | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d73f5f85..a2924fc54 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,9 @@ * org.el (org-return): Implement `org-return-follows-link' in the function org-return. This is more robust than using the mouse map, I think. + (org-set-regexps-and-options): Match more general #+TODO lines. + (org-make-options-regexp): New optional argument EXTRA, for an + extra regexp. 2009-02-07 Carsten Dominik diff --git a/lisp/org.el b/lisp/org.el index 8283cdae2..0d4c7a6e4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3193,9 +3193,10 @@ means to push this value onto the list in the variable.") (org-set-local 'org-file-properties nil) (org-set-local 'org-file-tags nil) (let ((re (org-make-options-regexp - '("CATEGORY" "SEQ_TODO" "TYP_TODO" "TODO" "CHOOSE_TODO" "COLUMNS" + '("CATEGORY" "TODO" "COLUMNS" "STARTUP" "ARCHIVE" "FILETAGS" "TAGS" "LINK" "PRIORITIES" - "CONSTANTS" "PROPERTY" "DRAWERS" "SETUPFILE"))) + "CONSTANTS" "PROPERTY" "DRAWERS" "SETUPFILE") + "\\(?:[a-zA-Z][0-9a-zA-Z_]*_TODO\\)")) (splitre "[ \t]+") kwds kws0 kwsa key log value cat arch tags const links hw dws tail sep kws1 prio props ftags drawers @@ -3220,8 +3221,10 @@ means to push this value onto the list in the variable.") (push (cons 'sequence (org-split-string value splitre)) kwds)) ((equal key "TYP_TODO") (push (cons 'type (org-split-string value splitre)) kwds)) - ((equal key "CHOOSE_TODO") - (push (cons 'choose (org-split-string value splitre)) kwds)) + ((string-match "\\`\\([a-zA-Z][0-9a-zA-Z_]*\\)_TODO\\'" key) + ;; general TODO-like setup + (push (cons (intern (downcase (match-string 1 key))) + (org-split-string value splitre)) kwds)) ((equal key "TAGS") (setq tags (append tags (org-split-string value splitre)))) ((equal key "COLUMNS") @@ -15132,12 +15135,13 @@ Show the heading too, if it is currently invisible." nil)) (error nil)))) -(defun org-make-options-regexp (kwds) +(defun org-make-options-regexp (kwds &optional extra) "Make a regular expression for keyword lines." (concat "^" "#?[ \t]*\\+\\(" (mapconcat 'regexp-quote kwds "\\|") + (if extra (concat "\\|" extra)) "\\):[ \t]*" "\\(.+\\)"))