summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-06-24 09:16:39 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-06-24 09:18:30 +0200
commitbffa144f540471983bc77b1dad433f105571cef6 (patch)
tree4e5a9380d32a7466532d96183114397061b88e75
parent5485170263a46fa17db67b0324c4c4e48bcdfe49 (diff)
downloadorg-mode-bffa144f540471983bc77b1dad433f105571cef6.tar.gz
org-mobile: Fix TODO keywords generation
* lisp/org-mobile.el (org-mobile-create-index-file): Call `org-delete-all' later since it is a destructive operation. Reported-by: Ian Dunn <dunni@gnu.org> <http://permalink.gmane.org/gmane.emacs.orgmode/107900>
-rw-r--r--lisp/org-mobile.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 9c69128..986499c 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -441,15 +441,16 @@ agenda view showing the flagged items."
target-file)
(insert "#+READONLY\n")
(dolist (entry def-todo)
- (let* ((kwds (mapcar (lambda (x) (if (string-match "(" x)
- (substring x 0 (match-beginning 0))
- x))
- (cdr entry)))
- (dwds (or (member "|" kwds) (last kwds)))
- (twds (org-delete-all dwds kwds)))
- (insert "#+TODO: " (mapconcat 'identity kwds " ") "\n")
- (setq todo-kwds (org-delete-all twds todo-kwds))
- (setq done-kwds (org-delete-all dwds done-kwds))))
+ (let ((kwds (mapcar (lambda (x)
+ (if (string-match "(" x)
+ (substring x 0 (match-beginning 0))
+ x))
+ (cdr entry))))
+ (insert "#+TODO: " (mapconcat #'identity kwds " ") "\n")
+ (let* ((dwds (or (member "|" kwds) (last kwds)))
+ (twds (org-delete-all dwds kwds)))
+ (setq todo-kwds (org-delete-all twds todo-kwds))
+ (setq done-kwds (org-delete-all dwds done-kwds)))))
(when (or todo-kwds done-kwds)
(insert "#+TODO: " (mapconcat 'identity todo-kwds " ") " | "
(mapconcat 'identity done-kwds " ") "\n"))