emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Strey <mstrey@strey.biz>
To: emacs-orgmode@gnu.org
Subject: Re: Regression in `org-todo'
Date: Mon, 2 Apr 2012 16:54:04 +0200	[thread overview]
Message-ID: <20120402145403.GB1704@mischka.fritz.box> (raw)
In-Reply-To: <CALw-MDpYXMgo_K8VqSq=G8VTgVNbFsHmKeL+sybyhURD=v0VQw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]

Hi Moritz & Bastien,

This bug fix seems not to be complete.  At least switching the todo
state in repeated tasks and in conjunction with org-checklist didn't
work for me as it used to before the last update.  PFA a patch that
solved the problem for me.

ATTENTION: Please check this patch very carefully.  This is my first
contribution to org-mode and my first patch ever.  My lisp knowledge is
rudimentary and I do not really understand the code.

Thanks to all developers for your work!

Best regards
Michael Strey

On Sun, Apr 01, 2012 at 05:01:12PM +0200, Moritz Ulrich wrote:
> Commit 6cbf1f417222321a47848a7368427ba8a22fe3a5 renames variable
> `last-state' to `org-last-state' in org.el. This change isn't
> reflected in function `org-todo'.
> That causes the following regression: Toggling a TODO state to DONE on
> a headline via C-c C-t (`org-todo') results in: "Symbol's value as
> variable is void: org-last-state".
> This is reproducible in latest HEAD and even in tag 'release_7.8.07'.
> M-x emacs-version: GNU Emacs (i386-apple-darwin11.3.0, NS
> apple-appkit-1138.32) of 2012-03-12 on moritz-macbook.local
> The attached patch contains a simple (two line) fix.

[-- Attachment #2: 0001-s-state-org-state.patch --]
[-- Type: text/plain, Size: 3998 bytes --]

From 554b1ece898c9aaff47e729d6fa746ec21b5eefd Mon Sep 17 00:00:00 2001
From: Michael Strey <mstrey@strey.biz>
Date: Mon, 2 Apr 2012 16:21:34 +0200
Subject: [PATCH] s/state/org-state/

 contrib/lisp/org-checklist.el |    2 +-
 lisp/org.el                   |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/contrib/lisp/org-checklist.el b/contrib/lisp/org-checklist.el
index a974874..03c7547 100644
--- a/contrib/lisp/org-checklist.el
+++ b/contrib/lisp/org-checklist.el
@@ -129,7 +129,7 @@ of checkbox items"
 (defun org-checklist ()
-  (when (member state org-done-keywords)
+  (when (member org-state org-done-keywords)
diff --git a/lisp/org.el b/lisp/org.el
index 9183743..bf30497 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2429,7 +2429,7 @@ When nil, only the date will be recorded."
 (defcustom org-log-note-headings
   '((done .  "CLOSING NOTE %t")
-    (state . "State %-12s from %-12S %t")
+    (org-state . "State %-12s from %-12S %t")
     (note .  "Note taken on %t")
     (reschedule .  "Rescheduled from %S on %t")
     (delschedule .  "Not scheduled, was %S on %t")
@@ -2458,7 +2458,7 @@ agenda log mode depends on the format of these entries."
 	  (cons (const :tag "Heading when closing an item" done) string)
 	  (cons (const :tag
 		       "Heading when changing todo state (todo sequence only)"
-		       state) string)
+		       org-state) string)
 	  (cons (const :tag "Heading when just taking a note" note) string)
 	  (cons (const :tag "Heading when clocking out" clock-out) string)
 	  (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
@@ -11437,10 +11437,10 @@ For calling through lisp, arg is also interpreted in the following way:
 		;; It is now done, and it was not done before
 		(org-add-planning-info 'closed (org-current-effective-time))
 		(if (and (not dolog) (eq 'note org-log-done))
-		    (org-add-log-setup 'done state this 'findpos 'note)))
+		    (org-add-log-setup 'done org-state this 'findpos 'note)))
 	      (when (and org-state dolog)
 		;; This is a non-nil state, and we need to log it
-		(org-add-log-setup 'state org-state this 'findpos dolog)))
+		(org-add-log-setup 'org-state org-state this 'findpos dolog)))
 	    ;; Fixup tag positioning
 	    (org-todo-trigger-tag-changes org-state)
 	    (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
@@ -11938,7 +11938,7 @@ This function is run automatically after each state change to a DONE state."
 	 (org-todo-log-states nil)
 	 re type n what ts time to-state)
     (when repeat
-      (if (eq org-log-repeat t) (setq org-log-repeat 'state))
+      (if (eq org-log-repeat t) (setq org-log-repeat 'org-state))
       (setq to-state (or (org-entry-get nil "REPEAT_TO_STATE")
       (unless (and to-state (member to-state org-todo-keywords-1))
@@ -11955,7 +11955,7 @@ This function is run automatically after each state change to a DONE state."
 		;; make sure we take a note, not only a time stamp
 		(setq org-log-note-how 'note))
 	  ;; Set up for taking a record
-	  (org-add-log-setup 'state (or done-word (car org-done-keywords))
+	  (org-add-log-setup 'org-state (or done-word (car org-done-keywords))
 			     'findpos org-log-repeat)))
       (org-back-to-heading t)
@@ -12377,7 +12377,7 @@ EXTRA is additional text that will be inserted into the notes buffer."
 		     ((eq org-log-note-purpose 'clock-out) "stopped clock")
 		     ((eq org-log-note-purpose 'done)  "closed todo item")
-		     ((eq org-log-note-purpose 'state)
+		     ((eq org-log-note-purpose 'org-state)
 		      (format "state change from \"%s\" to \"%s\""
 			      (or org-log-note-previous-state "")
 			      (or org-log-note-state "")))

  parent reply	other threads:[~2012-04-02 14:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-01 15:01 Regression in `org-todo' Moritz Ulrich
2012-04-01 18:35 ` [URGENT] " Moritz Ulrich
2012-04-01 20:29   ` Bastien
2012-04-01 20:37     ` Bastien
2012-04-02 14:54 ` Michael Strey [this message]
2012-04-02 15:03   ` Bastien
2012-04-02 20:44     ` Michael Strey
2012-04-02 21:07       ` Bastien
2012-04-02 21:43         ` Nick Dokos
     [not found]       ` <mstrey@strey.biz>
2012-04-02 21:40         ` Nick Dokos
2012-04-02 22:40           ` Bastien
2012-04-02 23:18             ` Bernt Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120402145403.GB1704@mischka.fritz.box \
    --to=mstrey@strey.biz \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).