Browse Source

Solidify the new logging stuff.

Carsten Dominik 17 years ago
parent
commit
9dfd23276b
5 changed files with 411 additions and 101 deletions
  1. 15 5
      ChangeLog
  2. 315 43
      ORGWEBPAGE/Changes.html
  3. 25 4
      ORGWEBPAGE/Changes.org
  4. 40 36
      org.el
  5. 16 13
      org.texi

+ 15 - 5
ChangeLog

@@ -1,5 +1,16 @@
+2008-02-19  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.el (org-set-regexps-and-options): Parse the new logging
+	options.
+	(org-extract-log-state-settings): New function.
+	(org-todo): Handle the new ways of recording state change stuff.
+	(org-local-logging): New function.
+
 2008-02-18  Carsten Dominik  <dominik@science.uva.nl>
 
+	* org.el (org-columns-open-link): Fixed bug with opening link in
+	column view.
+
 	* org-mac-message.el (org-mac-message-get-link): New function for
 	non-interactive use.
 
@@ -25,9 +36,8 @@
 	(org-add-log-note): Check if we really need to ask for a note.
 	(org-get-current-options): Digest the new keyword.
 
-	* org.texi (Progress logging): Document the new variable
-	`org-log-progress' and the new possibilities for per-keyword
-	settings.
+	* org.texi (Progress logging): Document the new progress logging
+	stuff.
 
 2008-02-13  Carsten Dominik  <dominik@science.uva.nl>
 
@@ -139,7 +149,7 @@
 	in each buffer, to make sure that also unused tags will be
 	available for completion.
 
-2008-01-24  Carsten Dominik  <dominik@carsten-dominiks-macbook-pro.local>
+2008-01-24  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org.el (org-columns-edit-value)
 	(org-columns-next-allowed-value): Only update if not in agenda.
@@ -632,7 +642,7 @@ Installed as 5.09
 	(org-todo): Respect org-todo-log-states.
 	(org-up-heading-safe): New function.
 	(org-entry-get-with-inheritance): Use `org-up-heading-safe'.
-	
+
 	* org.texi: Change links to webpage and maintained email.
 	(Remember): Promoted to Chapter, significant changes.
 	(Fast access to TODO states): New section.

+ 315 - 43
ORGWEBPAGE/Changes.html

@@ -6,7 +6,7 @@ lang="en" xml:lang="en">
 <title>Org-mode list of User-visible changes</title>
 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
 <meta name="generator" content="Org-mode"/>
-<meta name="generated" content="2008/01/25 14:14:58"/>
+<meta name="generated" content="2008/02/19 08:08:42"/>
 <meta name="author" content="Carsten Dominik"/>
 <style type="text/css">
   html {
@@ -35,6 +35,104 @@ lang="en" xml:lang="en">
 </head><body>
 <h1 class="title">Org-mode list of User-visible changes</h1>
 
+<div class="outline-2">
+<h2>Version 5.22</h2>
+
+
+
+<div class="outline-3">
+<h3>Incompatible changes</h3>
+
+
+<ul>
+<li>
+The variable `org-log-done' is now less complex.
+</li>
+<li>
+The in-buffer settings for logging have changed.  Some
+options no longer exists, some new ones have been added.
+
+</li>
+</ul></div>
+
+<div class="outline-3">
+<h3>Details</h3>
+
+
+
+<div class="outline-4">
+<h4>Changes to logging progress</h4>
+
+
+<p>
+There is now more control over which state changes are being
+logged in what way.  Please read carefully the corresponding
+sections in the manual.  Basically: 
+</p>
+<ul>
+<li>
+The variable `org-log-done' has been simplified, it no
+longer influences logging state changes and clocking out.
+</li>
+<li>
+There is a new variable for triggering note-taking when
+clocking out an item: `org-log-note-clock-out'.
+</li>
+<li>
+Logging of state changes now has to be configured on a
+pre-keyword basis, either in `org-todo-keywords' or in the
+#+TODO in-buffer setting.
+</li>
+<li>
+These per-keyword settings allow more control.  For example
+<pre>
+ WAIT(w@)    Record a note when entering this state.
+ WAIT(w!)    Record a timestamp when entering this state.
+ WAIT(w@/!)  Recore a note when entering and timestamp
+             when leaving this state.  This is great for
+             getting a record when switching *back* from
+              WAIT to TODO.
+ WAIT(/!)    Record a timestamp when leaving this state.
+             Here we not even define a fast access
+             character, but just the logging stuff.
+</pre>
+
+
+</li>
+</ul></div>
+
+<div class="outline-4">
+<h4>Misc</h4>
+
+
+<ul>
+<li>
+M-RET no longer brakes a line in the middle, it will make a
+new line ofter the current or (if cursor is at the beginning
+of the line) before the current line.
+
+</li>
+<li>
+RET, when executed in a headline after the main text and
+before the tags will leave the tags in the current line and
+create a new line below the current one.
+
+</li>
+</ul></div>
+</div>
+</div>
+
+<div class="outline-2">
+<h2>Version 5.21</h2>
+
+
+<p>
+Bug fixes, in particular the long-hunted bug about wrong window
+positions after pressing SPACE in the agenda.  Hopefully this
+is really fixed.
+</p>
+</div>
+
 <div class="outline-2">
 <h2>Version 5.20</h2>
 
@@ -44,65 +142,239 @@ lang="en" xml:lang="en">
 <h3>Overview</h3>
 
 
+
+<div class="outline-4">
+<h4>Remember/Refile/Goto</h4>
+
+
+<ul>
+<li>
+The use of prefix arguments for the commands `org-remember'
+and `org-refile' has been normalized.
+
+</li>
+<li>
+The clock can now safely be used in a remember buffer.
+
+</li>
+<li>
+The variable `org-remember-use-refile-when-interactive'
+introduced only in 5.19 is already obsolete.  Please use
+`org-remember-interactive-interface' instead.
+
+</li>
+<li>
+It is no longer necessary to update the refiling targets.
+
+</li>
+<li>
+Automatic isearch in `org-goto'.
+
+</li>
+<li>
+Outline-path-completion as alternative org-goto interface.
+
+</li>
+</ul></div>
+
+<div class="outline-4">
+<h4>Misc</h4>
+
+
+<ul>
+<li>
+Checkboxes now work hierarchically.
+
+</li>
+<li>
+`C-k' can now behave specially in headlines.
+
+</li>
+<li>
+Repeater for tasks in plain timestamps.
+
+</li>
+<li>
+All clock intervals of an item show in agenda/timeline.
+
+</li>
+<li>
+New parameter <code>:step</code> for clocktable, to get daily reports.
+
+</li>
+<li>
+Never loose a repeaded scheduled item from the agenda.
+
+</li>
+<li>
+Archiving a subtree now stores the outline path in a property.
+
+</li>
+<li>
+Links to messages in Apple Mail.
+
+</li>
+<li>
+Bug fixes.
+
+</li>
+</ul></div>
 </div>
 
 <div class="outline-3">
 <h3>Incompatible Changes</h3>
 
 
-</div>
+<ul>
+<li>
+The variable `org-remember-use-refile-when-interactive'
+introduced only in 5.19 is already obsolete.  Please use
+`org-remember-interactive-interface' instead.
+
+</li>
+</ul></div>
 
 <div class="outline-3">
 <h3>Details</h3>
 
 
-<p>
-+&mdash;&mdash;&mdash;&mdash;+&ndash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;+
-+&mdash;&mdash;&mdash;&mdash;+&ndash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;+
-+&mdash;&mdash;&mdash;&mdash;+&ndash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;+
-+&mdash;&mdash;&mdash;&mdash;+&ndash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;+
-+&mdash;&mdash;&mdash;&mdash;+&ndash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;+-&mdash;&mdash;&mdash;&mdash;+
-</p>
+
+<div class="outline-4">
+<h4>Remember/Refile/Goto</h4>
+
+
 <ul>
 <li>
+The use of prefix arguments for the commands `org-remember'
+and `org-refile' has been normalized:
+
+<ul>
+<li>
+when called without prefix argument, the command does its
+normal job, starting a remember note or refiling a tree.
+
+</li>
+<li>
+when called with a single C-u prefix, these commands can be
+used to select a target location and to jump there.  In
+the case of `org-remember', you will be prompted for a
+template and then Emacs jumps to the default target
+location or this template.  In the case of `org-refile',
+you select a location from the refile target list and jump
+there.
+
+</li>
+<li>
+when called with two prefixes (`C-u C-u'), the command
+jumps to the location last used for storing a note or a
+moved tree.
+
+</li>
+</ul></li>
+<li>
+When the clock is running inside an remember buffer, storing
+the remember buffer with `C-c C-c' will automatically clock
+out.  This was inspired by a request by Rainer Stengle. 
+
+</li>
+<li>
 The variable `org-remember-use-refile-when-interactive'
-introduced only in 5.19 is obsolete.  Please use
+introduced only in 5.19 is already obsolete.  Please use
 `org-remember-interactive-interface' instead.  This new
 variable does select the interface that is used to select
-the target for a remember note.  Possible values are:
-FIXME:
+the target for a remember note in an interactive way.
+Possible values are:
 
+<ul>
+<li>
+`outline': Use an outline of the document to select a
+location.  
 </li>
 <li>
-You can now also have a plain (as opposed to deadline or
-scheduled) repeater timestamp in a task.  Switching the task
-to DONE will now also shift a plain time stamp.  This was a
-request by Austin Frank.
+`outline-path-completion': Use completion of an outline
+path to select a location.
+</li>
+<li>
+`refile': Offer the `org-refile-targets' as possible
+targets.
 
 </li>
+</ul></li>
 <li>
 It is no longer necessary to update the refiling targets -
 they are always current.
 
 </li>
 <li>
-`C-u C-c C-w' allows you to jump to a refiling location.
+In `org-goto', typing characters now automatically starts
+isearch from the beginning of the buffer.  The isearch is
+special also because it only matches in headline.  This
+goes some way toward saving org-goto from being removed
+from Org-mode.  Thanks to Piotr Zielinski for the code, and
+sorry that it took me so long to put it in.  If you prefer
+to use single letters n,p,f,b,u,q for navigation as before,
+configure the variable `org-goto-auto-isearch'.
+
+</li>
+<li>
+Outline-path-completion is now available as an alternative
+interface in the command `org-goto'.  Please select the
+default interface you'd like to use with the new variable
+`org-goto-interface'.  You can then select the alternative
+interface with a prefix argument to `C-c C-j' (org-goto).  I
+am considering to make outline-path-completion the default
+interface.  Comments?
+
 
 </li>
+</ul></div>
+
+<div class="outline-4">
+<h4>Misc</h4>
+
+
+<ul>
 <li>
-`C-u C-u C-c C-w' uses the refile interface to jum to any
-headline in the current file.
+Checkboxes now work hierarchically.  When a plain-list item
+with a checkbox has children with checkboxes, the status of
+the item's checkbox is calculated from the children, each
+time a checkbox is toggled with C-c C-c.  Thanks to Miguel
+A. Figueroa-Villanueva for a patch to this effect.
 
 </li>
 <li>
-In `org-goto', typing characters now automatically starts
-isearch from the beginning of the buffer.  The isearch is
-special also because it only matches in headline.  This goes
-some way toward saving org-goto from being removed from
-Org-mode.  Thanks to Piotr Zielinski for the code, and sorry
-that it took me o long to ut it in.  If you prefer to use
-single letters n,p,f,b,u,q for navigation as before,
-configure the variable `org-goto-auto-isearch'.
+There is a new variable `org-special-ctrl-k'.  When set,
+`C-k' will behave specially in headlines:
+
+<ul>
+<li>
+When the cursor is at the beginning of a headline, kill
+the entire line and possible the folded subtree below the
+line.
+</li>
+<li>
+When in the middle of the headline text, kill the
+headline up to the tags.
+</li>
+<li>
+When after the headline text, kill the tags.
+
+</li>
+</ul>
+<p>This is following a proposal by Piotr Zielinski.
+</p>
+</li>
+<li>
+You can now also have a plain (as opposed to deadline or
+scheduled) repeater timestamp in a task.  Switching the task
+to DONE will now also shift a plain time stamp.  This was a
+request by Austin Frank.
+
+</li>
+<li>
+If an entry is clocked multiple times, it will now show up
+several times in the agenda and timeline buffers, when
+log-mode is on.  This was a proposal by Jurgen Defurne.
 
 </li>
 <li>
@@ -117,7 +389,7 @@ A time-stamp with a repeater now no longer refers to the
 date <b>closest</b> to the current day.  Instead, it means either
 today or the most recent match.  This change makes sure that
 overdue scheduled or deadline items never disappear from the
-agenda.  With the previous convention, an overdue sheduled
+agenda.  With the previous convention, an overdue scheduled
 item would disappear.  For example, a weekly item scheduled
 for Sunday would appear as overdue until Wednesday, and the
 suddenly disappear until next Sunday.  Now the item will
@@ -128,7 +400,7 @@ Bernt.
 
 </li>
 <li>
-Archving a subtree now creates an additional property,
+Archiving a subtree now creates an additional property,
 <code>ARCHIVE_OLPATH</code>.  This property contains the "path" in the
 outline tree to the archived entry, as it was in the
 original file.  For example, archiving <code>Fix the door</code> in the
@@ -155,9 +427,20 @@ Note that you can configure (i.e. limit) the information
 that gets stored upon archiving with the variable
 `org-archive-save-context-info'.
 </p>
+</li>
+<li>
+New file `org-mac-message.el' by John Wiegley to create
+links for messages in Apple Mail, and to follow these
+links.
+
+</li>
+<li>
+Bug fixes.
+
 </li>
 </ul></div>
 </div>
+</div>
 
 <div class="outline-2">
 <h2>Version 5.19</h2>
@@ -934,19 +1217,8 @@ You can now export special strings in HTML.  Here is the
 list of newly performed conversions:
 
 <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-<col align="left"></col><col align="left"></col><col align="left"></col><col align="left"></col>
+<col align="left"></col><col align="left"></col><col align="left"></col>
 <thead>
-<tr><th>Command</th><th></th><th>C-u</th><th>C-u C-u</th></tr>
-<tr><th>org-remember</th><th>select template and</th><th>select template and</th><th>goto location</th></tr>
-<tr><th></th><th>store a note</th><th>go to its default</th><th>last used by</th></tr>
-<tr><th></th><th></th><th>target</th><th>remember</th></tr>
-<tr><th>org-refile</th><th>select a targer and</th><th>goto a target</th><th>goto location</th></tr>
-<tr><th></th><th>refile subtree</th><th></th><th>last used by</th></tr>
-<tr><th></th><th></th><th></th><th>refile</th></tr>
-<tr><th>org-goto</th><th>go to a headline</th><th>Use outline-path-</th><th></th></tr>
-<tr><th></th><th>selected from</th><th>completion to</th><th></th></tr>
-<tr><th></th><th>outline f current</th><th>select the</th><th></th></tr>
-<tr><th></th><th>buffer.</th><th>headline</th><th></th></tr>
 <tr><th>Org</th><th>Description</th><th>HTML</th></tr>
 </thead>
 <tbody>
@@ -5144,7 +5416,7 @@ The prefix and the sorting strategy for agenda items can depend
 upon the agenda type.
 </li>
 <li>
-The handling of `<a href="mailto:'">mailto:'</a> links can be customized, see the new
+The handling of `mailto:' links can be customized, see the new
 variable `org-link-mailto-program'.
 </li>
 <li>
@@ -6349,6 +6621,6 @@ HTML exporter upgrade, in particular table of contents
 <div id="postamble"><p class="author"> Author: Carsten Dominik
 <a href="mailto:carsten at orgmode dot org">&lt;carsten at orgmode dot org&gt;</a>
 </p>
-<p class="date"> Date: 2008/01/25 14:14:58</p>
+<p class="date"> Date: 2008/02/19 08:08:42</p>
 </div></body>
 </html>

+ 25 - 4
ORGWEBPAGE/Changes.org

@@ -19,12 +19,33 @@
 
     There is now more control over which state changes are being
     logged in what way.  Please read carefully the corresponding
-    sections in the manual.
-
-*** Misc
+    sections in the manual.  Basically: 
+
+    - The variable `org-log-done' has been simplified, it no
+      longer influences logging state changes and clocking out.
+    - There is a new variable for triggering note-taking when
+      clocking out an item: `org-log-note-clock-out'.
+    - Logging of state changes now has to be configured on a
+      pre-keyword basis, either in `org-todo-keywords' or in the
+      #+TODO in-buffer setting.
+    - These per-keyword settings allow more control.  For example
+
+      : WAIT(w@)    Record a note when entering this state.
+      : WAIT(w!)    Record a timestamp when entering this state.
+      : WAIT(w@/!)  Recore a note when entering and timestamp
+      :             when leaving this state.  This is great for
+      :             getting a record when switching *back* from
+      :              WAIT to TODO.
+      : WAIT(/!)    Record a timestamp when leaving this state.
+      :             Here we not even define a fast access
+      :             character, but just the logging stuff.
+
+    This was triggered by requests from Wanrong Lin and Bernt Hansen.
+
+*** Other
 
    - M-RET no longer brakes a line in the middle, it will make a
-     new line ofter the current or (if cursor is at the beginning
+     new line after the current or (if cursor is at the beginning
      of the line) before the current line.
 
    - RET, when executed in a headline after the main text and

+ 40 - 36
org.el

@@ -1643,12 +1643,13 @@ the special #+SEQ_TODO and #+TYP_TODO lines.
 
 Each keyword can optionally specify a character for fast state selection
 \(in combination with the variable `org-use-fast-todo-selection')
-and a specifier for state change logging, using the same syntax
+and specifiers for state change logging, using the same syntax
 that is used in the \"#+TODO:\" lines.  For example, \"WAIT(w)\" says
 that the WAIT state can be selected with the \"w\" key. \"WAIT(w!)\"
 indicates to record a time stamp each time this state is selected.
 \"WAIT(w@)\" says that the user should in addition be prompted for a
-note.
+note, and \"WAIT(w@/@)\" says that a note should be taken both when
+entering and when leaving this state.
 
 For backward compatibility, this variable may also be just a list
 of keywords - in this case the interptetation (sequence or type) will be
@@ -4248,6 +4249,7 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc."
 (declare-function rmail-narrow-to-non-pruned-header "rmail" ())
 (declare-function rmail-show-message "rmail" (&optional n no-summary))
 (declare-function rmail-what-message "rmail" ())
+(defvar rmail-current-message)
 (defvar texmathp-why)
 (declare-function vm-beginning-of-message "ext:vm-page" ())
 (declare-function vm-follow-summary-cursor "ext:vm-motion" ())
@@ -4438,9 +4440,8 @@ means to push this value onto the list in the variable.")
 		 "STARTUP" "ARCHIVE" "TAGS" "LINK" "PRIORITIES"
 		 "CONSTANTS" "PROPERTY" "DRAWERS")))
 	  (splitre "[ \t]+")
-	  kwds kws0 kwsa key value cat arch tags const links hw dws
-	  tail sep kws1 prio props drawers
-	  ex note time)
+	  kwds kws0 kwsa key log value cat arch tags const links hw dws
+	  tail sep kws1 prio props drawers)
       (save-excursion
 	(save-restriction
 	  (widen)
@@ -4522,18 +4523,14 @@ means to push this value onto the list in the variable.")
 		kwsa nil
 		kws1 (mapcar
 		      (lambda (x)
-			(if (string-match "^\\(.*?\\)\\(?:(\\(..?\\))\\)?$" x)
+			;;                     1              2
+			(if (string-match "^\\(.*?\\)\\(?:(\\([^!@/]\\)?.*?)\\)?$" x)
 			    (progn
 			      (setq kw (match-string 1 x)
-				    ex (and (match-end 2) (match-string 2 x))
-				    note (and ex (string-match "@" ex))
-				    time (or note (and ex (string-match "!" ex)))
-				    key (and ex (substring ex 0 1)))
-			      (if (member key '("@" "!")) (setq key nil))
+				    key (and (match-end 2) (match-string 2 x))
+				    log (org-extract-log-state-settings x))
 			      (push (cons kw (and key (string-to-char key))) kwsa)
-			      (and (or note time)
-				   (push (cons kw (if note 'note 'time))
-					 org-todo-log-states))
+			      (and log (push log org-todo-log-states))
 			      kw)
 			  (error "Invalid TODO keyword %s" x)))
 		      kws0)
@@ -4657,6 +4654,20 @@ means to push this value onto the list in the variable.")
     (org-compute-latex-and-specials-regexp)
     (org-set-font-lock-defaults)))
 
+(defun org-extract-log-state-settings (x)
+  "Extract the log state setting from a TODO keyword string.
+This will extract info from a string like \"WAIT(w@/!)\"."
+  (let (kw key log1 log2)
+    (when (string-match "^\\(.*?\\)\\(?:(\\([^!@/]\\)?\\([!@]\\)?\\(?:/\\([!@]\\)\\)?)\\)?$" x)
+      (setq kw (match-string 1 x)
+	    key (and (match-end 2) (match-string 2 x))
+	    log1 (and (match-end 3) (match-string 3 x))
+	    log2 (and (match-end 4) (match-string 4 x)))
+      (and (or log1 log2)
+	   (list kw
+		 (and log1 (if (equal log1 "!") 'time 'note))
+		 (and log2 (if (equal log2 "!") 'time 'note)))))))
+
 (defun org-remove-keyword-keys (list)
   (mapcar (lambda (x)
 	    (if (string-match "(..?)$" x)
@@ -7309,8 +7320,8 @@ so this really moves item trees."
 Subitems (items with larger indentation) are considered part of the item,
 so this really moves item trees."
   (interactive "p")
-  (let (beg beg0 end end0 ind ind1 (pos (point)) txt
-	    ne-beg ne-end ne-ins ins-end)
+  (let (beg beg0 end ind ind1 (pos (point)) txt
+	    ne-beg ne-ins ins-end)
     (org-beginning-of-item)
     (setq beg0 (point))
     (setq ind (org-get-indentation))
@@ -7319,7 +7330,6 @@ so this really moves item trees."
       (setq beg (point)))
     (goto-char beg0)
     (org-end-of-item)
-    (setq ne-end (org-back-over-empty-lines))
     (setq end (point))
     (goto-char beg0)
     (catch 'exit
@@ -12466,7 +12476,6 @@ With three \\[universal-argument] prefixes, negate the meaning of
     (when (string-match "\\<file:\\(.*\\)" link)
       (let* ((path (match-string 1 link))
 	     (origpath path)
-	     (desc-is-link (equal link desc))
 	     (case-fold-search nil))
 	(cond
 	 ((eq org-link-file-path-type 'absolute)
@@ -14061,7 +14070,6 @@ heading in the current buffer."
   (interactive "P")
   (let* ((cbuf (current-buffer))
 	 (filename (buffer-file-name (buffer-base-buffer cbuf)))
-	 (fname (and filename (file-truename filename)))
 	 pos it nbuf file re level reversed)
     (if (equal goto '(16))
 	(org-refile-goto-last-stored)
@@ -14123,8 +14131,7 @@ heading in the current buffer."
 			   (cdr x))
 		   x))
 	       org-refile-target-table))
-	 (completion-ignore-case t)
-	 pos it nbuf file re level reversed)
+	 (completion-ignore-case t))
     (assoc (completing-read prompt tbl nil t nil 'org-refile-history)
 	   tbl)))
 
@@ -14584,7 +14591,8 @@ For calling through lisp, arg is also interpreted in the following way:
 	(when (and (or org-todo-log-states org-log-done)
 		   (not (memq arg '(nextset previousset))))
 	  ;; we need to look at recording a time and note
-	  (setq dolog (cdr (assoc state org-todo-log-states)))
+	  (setq dolog (or (nth 1 (assoc state org-todo-log-states))
+			  (nth 2 (assoc this org-todo-log-states))))
 	  (when (and state
 		     (member state org-not-done-keywords)
 		     (not (member this org-not-done-keywords)))
@@ -14620,25 +14628,22 @@ For calling through lisp, arg is also interpreted in the following way:
 	  (save-excursion
 	    (run-hook-with-args 'org-trigger-hook change-plist)))))))
 
-(defun org-local-logging (property)
-  "Get logging settings from a property."
+(defun org-local-logging (value)
+  "Get logging settings from a property VALUE."
   (let* (words w a)
     ;; directly set the variables, they are already local.
     (setq org-log-done nil
 	  org-log-repeat nil
 	  org-todo-log-states nil)
-    (setq words (org-split-string property))
+    (setq words (org-split-string value))
     (while (setq w (pop words))
       (cond
        ((setq a (assoc w org-startup-options))
 	(and (member (nth 1 a) '(org-log-done org-log-repeat))
 	     (set (nth 1 a) (nth 2 a))))
-       ((string-match "\\([a-zA-Z0-9]+\\)\\(([@!])\\)?" w)
-	(and (member (match-string 1 w) org-todo-keywords-1)
-	     (match-end 2)
-	     (push (cons (match-string 1 w)
-			 (if (equal (match-string 2 w) "(@)") 'note 'time))
-		   org-todo-log-states)))))))
+       ((setq a (org-extract-log-state-settings w))
+	(and (member (car a) org-todo-keywords-1)
+	     (push a org-todo-log-states)))))))
 
 (defun org-get-todo-sequence-head (kwd)
   "Return the head of the TODO sequence to which KWD belongs.
@@ -14726,6 +14731,7 @@ Returns the new TODO keyword, or nil if no state change should occur."
 
 (defvar org-last-changed-timestamp)
 (defvar org-log-post-message)
+(defvar org-log-note-purpose)
 (defun org-auto-repeat-maybe (done-word)
   "Check if the current headline contains a repeated deadline/schedule.
 If yes, set TODO state back to what it was and change the base date
@@ -16843,9 +16849,8 @@ Where possible, use the standard interface for changing this line."
 
 (defun org-columns-open-link (&optional arg)
   (interactive "P")
-  (let ((key (get-char-property (point) 'org-columns-key))
-	(value (get-char-property (point) 'org-columns-value)))
-    (org-open-link-from-string arg)))
+  (let ((value (get-char-property (point) 'org-columns-value)))
+    (org-open-link-from-string value arg)))
 
 (defun org-open-link-from-string (s &optional arg)
   "Open a link in the string S, as if it was in Org-mode."
@@ -16877,7 +16882,7 @@ Where possible, use the standard interface for changing this line."
   (org-verify-version 'columns)
   (org-columns-remove-overlays)
   (move-marker org-columns-begin-marker (point))
-  (let (beg end fmt cache maxwidths clocksump)
+  (let (beg end fmt cache maxwidths)
     (setq fmt (org-columns-get-format-and-top-level))
     (save-excursion
       (goto-char org-columns-top-level-marker)
@@ -16889,7 +16894,6 @@ Where possible, use the standard interface for changing this line."
       ;; Get and cache the properties
       (goto-char beg)
       (when (assoc "CLOCKSUM" org-columns-current-fmt-compiled)
-	(setq clocksump t)
 	(save-excursion
 	  (save-restriction
 	    (narrow-to-region beg end)

+ 16 - 13
org.texi

@@ -2932,12 +2932,11 @@ in-buffer setting is: @code{#+STARTUP: logdone}}.
 @end lisp
 
 @noindent
-Then each time you turn an entry from an arbitrary TODO (not-done) state
-into any of the DONE states using the dedicated commands like @kbd{C-c
-C-t}, a line @samp{CLOSED: [timestamp]} will be inserted just after the
-headline.  If you turn the entry back into a TODO item through further
-state cycling, that line will be removed again.  If you want
-to record a note along with the timestamp, use@footnote{The
+Then each time you turn an entry from a TODO (not-done) state into any
+of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
+just after the headline.  If you turn the entry back into a TODO item
+through further state cycling, that line will be removed again.  If you
+want to record a note along with the timestamp, use@footnote{The
 corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
 
 @lisp
@@ -2958,15 +2957,15 @@ giving you an overview of what has been done.
 
 When TODO keywords are used as workflow states (@pxref{Workflow
 states}), you might want to keep track of when a state change occurred
-and record a note about this change.  Since it is normally too much to
-record a note for every state, Org-mode expects configuration on a
+and maybe take a note about this change.  Since it is normally too much
+to record a note for every state, Org-mode expects configuration on a
 per-keyword basis for this.  This is achieved by adding special markers
-@samp{!} and @samp{@@} in parenthesis behind each keyword.  For example,
-with the setting
+@samp{!} (for a time stamp) and @samp{@@} (for a note) in parenthesis
+after each keyword.  For example, with the setting
 
 @lisp
 (setq org-todo-keywords
-      '((sequence "TODO(t)" "WAIT(w@@)" "|" "DONE(d!)" "CANCELED(c@@)")))
+      '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
 @end lisp
 
 @noindent
@@ -2977,12 +2976,16 @@ when you are using both @code{org-log-done} and state change logging.
 However, it will never prompt for two notes - if you have configured
 both, the state change recording note will take precedence and cancel
 the @samp{Closing Note}.}, and that a special note is recorded when
-switching to WAIT or CANCELED.
+switching to WAIT or CANCELED.  The setting for WAIT is even more
+special: The @samp{!} after the slash means that a time stamp should be
+recorded when @i{leaving} the WAIT state.  This allows you to get a
+record when switching from WAIT back to TODO, without getting one when
+first turning an entry into a TODO.
 
 You can use the exact same syntax for setting logging preferencs local
 to a buffer:
 @example
-#+SEQ_TODO: TODO(t) WAIT(w@@) | DONE(d!) CANCELED(c@@)
+#+SEQ_TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
 @end example
 
 In order to define logging settings that are local to a subtree or a