changeset 73966:3e367f69c68c

(org-metaleft): Call `org-outdent-item' on bullets. (org-metaright): Call `org-indent-item' on bullets. (org-timestamp-change): Set `org-last-changed-timestamp'. (org-current-line): Make sure (bolp) returns correct result. (org-agenda-change-all-lines): Make sure highlighting TODO always works.
author Carsten Dominik <dominik@science.uva.nl>
date Mon, 13 Nov 2006 08:37:36 +0000
parents b767b7961452
children 8aa00b07ec99
files lisp/textmodes/org.el
diffstat 1 files changed, 20 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/org.el	Mon Nov 13 08:20:48 2006 +0000
+++ b/lisp/textmodes/org.el	Mon Nov 13 08:37:36 2006 +0000
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <dominik at science dot uva dot nl>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.54
+;; Version: 4.55
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -61,6 +61,9 @@
 ;;
 ;; Recent changes
 ;; --------------
+;; Version 4.55
+;;    - Bug fixes.
+;;
 ;; Version 4.54
 ;;    - Improvements to fast tag selection
 ;;      + show status also in target line.
@@ -164,7 +167,7 @@
 
 ;;; Customization variables
 
-(defvar org-version "4.54"
+(defvar org-version "4.55"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
@@ -467,7 +470,7 @@
   :group 'org-time
   :type 'boolean)
 
-(defcustom org-show-hierarchy-above '((default t))
+(defcustom org-show-hierarchy-above '((default . t))
   "Non-nil means, show full hierarchy when showing a spot in the tree.
 Turning this off makes sparse trees more compact, but also less clear.
 Instead of t, this can also be an alist specifying this option for different
@@ -497,7 +500,7 @@
 		    (const default))
 		   (boolean)))))
 
-(defcustom org-show-following-heading '((default t))
+(defcustom org-show-following-heading '((default . t))
   "Non-nil means, show heading following match in `org-occur'.
 When doing an `org-occur' it is useful to show the headline which
 follows the match, even if they do not match the regexp.  This makes it
@@ -3275,7 +3278,9 @@
   (let ((current-prefix-arg arg)) (call-interactively command)))
 
 (defsubst org-current-line (&optional pos)
-  (+ (if (bolp) 1 0) (count-lines (point-min) (or pos (point)))))
+  (save-excursion
+    (and pos (goto-char pos))
+    (+ (if (bolp) 1 0) (count-lines (point-min) (point)))))
 
 (defun org-current-time ()
   "Current time, possibly rounded to `org-time-stamp-rounding-minutes'."
@@ -6412,7 +6417,8 @@
 	  (setcar (nthcdr 1 time0) (or (nth 1 time0) 0))
 	  (setcar (nthcdr 2 time0) (or (nth 1 time0) 0))
 	  (setq time (apply 'encode-time time0))))
-    (org-insert-time-stamp time with-hm inactive)
+    (setq org-last-changed-timestamp
+	  (org-insert-time-stamp time with-hm inactive))
     (org-clock-update-time-maybe)
     (goto-char pos)
     ;; Try to recenter the calendar window, if any
@@ -6774,7 +6780,7 @@
 		     (apply 'encode-time (org-parse-time-string te)))))
     (move-marker ins (point))
     (setq ipos (point))
-    ;; FIXME: does not yet use org-insert-time-stamp or custom format
+    ;; FIXME: does not yet use org-insert-time-stamp
     (insert-before-markers "Clock summary at ["
 			   (substring
 			    (format-time-string (cdr org-time-stamp-formats))
@@ -7472,7 +7478,7 @@
 			 (d (- nt n1)))
 		    (- sd (+ (if (< d 0) 7 0) d)))))
 	 (day-numbers (list start))
-;FIXME	 (inhibit-redisplay t)
+	 (inhibit-redisplay t)
 	 s e rtn rtnall file date d start-pos end-pos todayp nd)
     (setq org-agenda-redo-command
 	  (list 'org-agenda-list (list 'quote include-all) start-day ndays))
@@ -7575,6 +7581,7 @@
 for a keyword.  A numeric prefix directly selects the Nth keyword in
 `org-todo-keywords'."
   (interactive "P")
+  (require 'calendar)
   (org-compile-prefix-format 'todo)
   (org-set-sorting-strategy 'todo)
   (let* ((today (time-to-days (current-time)))
@@ -8249,7 +8256,7 @@
 			 "[^\n\r]*\\)"))
 	 (deadline-re (concat ".*\\(\n[^*].*\\)?" org-deadline-time-regexp))
 	 (sched-re (concat ".*\\(\n[^*].*\\)?" org-scheduled-time-regexp))
-; FIXME why was this wriong?	 (sched-re (concat ".*\n?.*?" org-scheduled-time-regexp))
+; FIXME why was this wrong?	 (sched-re (concat ".*\n?.*?" org-scheduled-time-regexp))
 	 marker priority category tags
 	 ee txt)
     (goto-char (point-min))
@@ -8990,7 +8997,6 @@
 If FIXFACE is non-nil, the face of each item is modified acording to
 the new TODO state."
   (let* (props m pl undone-face done-face finish new dotime cat tags)
-;    (setq newhead (org-format-agenda-item "x" newhead "x" nil 'noprefix))
     (save-excursion
       (goto-char (point-max))
       (beginning-of-line 1)
@@ -9017,9 +9023,8 @@
 		   (point-at-bol) (point-at-eol)
 		   (list 'face
 			 (if org-last-todo-state-is-todo
-			     undone-face done-face)))
-		  (org-agenda-highlight-todo 'line))
-		;; (org-agenda-align-tags 'line) ;; done below by finalize
+			     undone-face done-face))))
+		(org-agenda-highlight-todo 'line)
 		(beginning-of-line 1))
 	    (error "Line update did not work")))
 	(beginning-of-line 0)))
@@ -9440,37 +9445,6 @@
   (interactive "P")
   (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match))))
 
-;; FIXME: remove this function.
-(defun org-make-tags-matcher-old (match)
-  "Create the TAGS matcher form for the tags-selecting string MATCH."
-  (unless match
-    ;; Get a new match request, with completion
-    (setq org-last-tags-completion-table
-	  (or org-tag-alist
-	      org-last-tags-completion-table))
-    (setq match (completing-read
-		 "Tags: " 'org-tags-completion-function nil nil nil
-		 'org-tags-history)))
-  ;; parse the string and create a lisp form
-  (let ((match0 match) minus tag mm matcher orterms term orlist)
-    (setq orterms (org-split-string match "|"))
-    (while (setq term (pop orterms))
-      (while (string-match "^&?\\([-+:]\\)?\\([A-Za-z_@0-9]+\\)" term)
-	(setq minus (and (match-end 1)
-			 (equal (match-string 1 term) "-"))
-	      tag (match-string 2 term)
-	      term (substring term (match-end 0))
-	      mm (list 'member (downcase tag) 'tags-list)
-	      mm (if minus (list 'not mm) mm))
-	(push mm matcher))
-      (push (if (> (length matcher) 1) (cons 'and matcher) (car matcher))
-	    orlist)
-      (setq matcher nil))
-    (setq matcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist)))
-    ;; Return the string and lisp forms of the matcher
-    (cons match0 matcher)))
-
-
 (defun org-make-tags-matcher (match)
   "Create the TAGS//TODO matcher form for the selection string MATCH."
   (unless match
@@ -16599,6 +16573,7 @@
    ((org-at-table-p) (org-call-with-arg 'org-table-move-column 'left))
    ((or (org-on-heading-p) (org-region-active-p))
     (call-interactively 'org-do-promote))
+   ((org-at-item-p) (call-interactively 'org-outdent-item))
    (t (call-interactively 'backward-word))))
 
 (defun org-metaright (&optional arg)
@@ -16611,6 +16586,7 @@
    ((org-at-table-p) (call-interactively 'org-table-move-column))
    ((or (org-on-heading-p) (org-region-active-p))
     (call-interactively 'org-do-demote))
+   ((org-at-item-p) (call-interactively 'org-indent-item))
    (t (call-interactively 'forward-word))))
 
 (defun org-metaup (&optional arg)