Browse Source

Fix minor issues after release 5.23.

In particular, this implements default dates for deadlines and
scheduled items, taken from previously existing deadline/scheduled
timestamps in the same entry.

Also we fix two minor bugs.
Carsten Dominik 17 years ago
parent
commit
7eec8794f6
4 changed files with 46 additions and 5 deletions
  1. 5 0
      ChangeLog
  2. 14 0
      ORGWEBPAGE/Changes.org
  3. 1 1
      org-mouse.el
  4. 26 4
      org.el

+ 5 - 0
ChangeLog

@@ -1,9 +1,14 @@
+2008-03-13  Carsten Dominik  <dominik@science.uva.nl>
+
 
 
 	* org.el (org-html-level-start): Always have id's in HTML
 	* org.el (org-html-level-start): Always have id's in HTML
 	headlines, even if there is no TOC to jump from.  Put extra <divs>
 	headlines, even if there is no TOC to jump from.  Put extra <divs>
 	in.  One around the toc, one around the text between a headline
 	in.  One around the toc, one around the text between a headline
 	and its first subsection.  Insert ids into div's that surround
 	and its first subsection.  Insert ids into div's that surround
 	whole sections including subsections.
 	whole sections including subsections.
+	(define-obsolete-function-alias): Make work with XEmacs.
+	(org-add-planning-info): Use old date as default when modifying an
+	existing deadline or scheduled item.
 
 
 2008-03-11  Bastien Guerry  <bzg@altern.org>
 2008-03-11  Bastien Guerry  <bzg@altern.org>
 
 

+ 14 - 0
ORGWEBPAGE/Changes.org

@@ -5,6 +5,20 @@
 #+EMAIL:  carsten at orgmode dot org
 #+EMAIL:  carsten at orgmode dot org
 #+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:{} *:t TeX:t LaTeX:nil
 #+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:{} *:t TeX:t LaTeX:nil
 
 
+* Version 5.24
+
+** Details
+
+   - When an entry already has a scheduling or deadline time
+     stamp, calling `C-c C-s' or `C-c C-d', respectively, will no
+     use that old date as the default, and you can can use the
+     "++4d" syntax to invoke shifts relative to that default
+     date.  Simply pressing RET at the prompt will keep the
+     default date, not switch to today.
+
+     This was an omission in the earlier implementation, spotted
+     by Wanrong Lin.  Thanks!
+
 * Version 5.23
 * Version 5.23
 
 
 ** Overview
 ** Overview

+ 1 - 1
org-mouse.el

@@ -1,6 +1,6 @@
 ;;; org-mouse.el --- Better mouse support for org-mode
 ;;; org-mouse.el --- Better mouse support for org-mode
 
 
-;; Copyright (c) 2006, 2007, 2008 Free Software Foundation
+;; Copyright (C) 2006, 2007, 2008 Free Software Foundation
 ;;
 ;;
 ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
 ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>

+ 26 - 4
org.el

@@ -6561,8 +6561,11 @@ even level numbers will become the next higher odd number."
 	    ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
 	    ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
     (max 1 (+ level change))))
     (max 1 (+ level change))))
 
 
-(define-obsolete-function-alias 'org-get-legal-level
-    'org-get-valid-level "23.1")
+(if (featurep 'xemacs)
+    (define-obsolete-function-alias 'org-get-legal-level
+      'org-get-valid-level)
+  (define-obsolete-function-alias 'org-get-legal-level
+    'org-get-valid-level "23.1"))
 
 
 (defun org-promote ()
 (defun org-promote ()
   "Promote the current heading higher up the tree.
   "Promote the current heading higher up the tree.
@@ -15151,8 +15154,27 @@ If non is given, the user is prompted for a date.
 REMOVE indicates what kind of entries to remove.  An old WHAT entry will also
 REMOVE indicates what kind of entries to remove.  An old WHAT entry will also
 be removed."
 be removed."
   (interactive)
   (interactive)
-  (let (org-time-was-given org-end-time-was-given)
-    (when what (setq time (or time (org-read-date nil 'to-time))))
+  (let (org-time-was-given org-end-time-was-given ts
+			   end default-time default-input)
+
+    (when (and (not time) (memq what '(scheduled deadline)))
+      ;; Try to get a default date/time from existing timestamp
+      (save-excursion
+	(org-back-to-heading t)
+	(setq end (save-excursion (outline-next-heading) (point)))
+	(when (re-search-forward (if (eq what 'scheduled)
+				     org-scheduled-time-regexp
+				   org-deadline-time-regexp)
+				 end t)
+	  (setq ts (match-string 1)
+		default-time
+		(apply 'encode-time (org-parse-time-string ts))
+		default-input (and ts (org-get-compact-tod ts))))))
+    (when what
+      ;; If necessary, get the time from the user
+      (setq time (or time (org-read-date nil 'to-time nil nil 
+					 default-time default-input))))
+
     (when (and org-insert-labeled-timestamps-at-point
     (when (and org-insert-labeled-timestamps-at-point
 	       (member what '(scheduled deadline)))
 	       (member what '(scheduled deadline)))
       (insert
       (insert