From 7eec8794f60ca6b6154943d61ef90228d276c8c4 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 13 Mar 2008 12:00:08 +0100 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ ORGWEBPAGE/Changes.org | 14 ++++++++++++++ org-mouse.el | 2 +- org.el | 30 ++++++++++++++++++++++++++---- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc00ab4d9..4f6981f65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,14 @@ +2008-03-13 Carsten Dominik + * org.el (org-html-level-start): Always have id's in HTML headlines, even if there is no TOC to jump from. Put extra in. One around the toc, one around the text between a headline and its first subsection. Insert ids into div's that surround 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 diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index 8d7569ae1..c3cb55608 100644 --- a/ORGWEBPAGE/Changes.org +++ b/ORGWEBPAGE/Changes.org @@ -5,6 +5,20 @@ #+EMAIL: carsten at orgmode dot org #+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 ** Overview diff --git a/org-mouse.el b/org-mouse.el index f363dcac6..52770899f 100644 --- a/org-mouse.el +++ b/org-mouse.el @@ -1,6 +1,6 @@ ;;; 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 ;; Maintainer: Carsten Dominik diff --git a/org.el b/org.el index 1e9085008..c9c4307e3 100644 --- a/org.el +++ b/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)))))) (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 () "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 be removed." (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 (member what '(scheduled deadline))) (insert -- 2.11.4.GIT