From 93ea7371bd56c880a2cfc32e818691ebf9ae2e21 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 28 Aug 2009 14:41:15 +0200 Subject: [PATCH] Fix bug when removing scheduled/deadline times Bernt Hansen writes: > I ran into this a few weeks ago and it's been bugging me. > > I reorganized a project which had a deadline on the main task and moved > it down to multiple subtasks in the project. > > ,---- > | * TODO Project task > | DEADLINE: <2009-08-28 Fri> > | ** TODO Step 1 > | ** TODO Step 2 > | ... > | ** TODO Step n > `---- > > I decided the DEADLINE really doesn't belong at the top -- since the > deadline was for step 2 (and a few other tasks)... so I moved it the > hard way. Instead of cutting it out and pasting it back in the right > tree I just used C-c C-d and entered the same date on step 2 (because I > was moving the date a bit from the original date). > > ,---- > | * TODO Project task > | DEADLINE: <2009-08-28 Fri> > | ** TODO Step 1 > | ** TODO Step 2 > | DEADLINE: <2009-08-28 Fri> > | ... > | ** TODO Step n > `---- > > Now to remove the deadline from the Project task I just did C-u C-c C-d > on the Project task but this removed all the deadlines in the subtree > and my deadline in Step 2 (and others) is now gone. > > AFAICT SCHEDULED: works the same way. This doesn't feel natural to me > but I know it is documented this way. > > Does the way it works now really make sense or would just removing the > deadline from the task you are working on be better. > > C-c C-d sets a deadline just for this task, so it felt natural to me > that C-u C-c C-d would remove the deadline just for this task -- but > that's what I get for not reading the manual (or forgetting since I read > it ;) --- lisp/ChangeLog | 3 +++ lisp/org.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 34605cf98..6fd7d497f 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-08-28 Carsten Dominik + * org.el (org-remove-timestamp-with-keyword): Only remove in + entry, not in subtree. + * org-src.el (org-src-lang-modes): Add abbreviation elisp for emacs lisp. diff --git a/lisp/org.el b/lisp/org.el index 735029c2e..a5181abc8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10045,7 +10045,7 @@ nil." (save-excursion (org-back-to-heading t) (setq beg (point)) - (org-end-of-subtree t t) + (outline-next-heading) (while (re-search-backward re beg t) (replace-match "") (if (and (string-match "\\S-" (buffer-substring (point-at-bol) (point)))