Browse Source

Make marker-resetting more robust.

Carsten Dominik 17 years ago
parent
commit
e16c85fc4b
2 changed files with 20 additions and 13 deletions
  1. 8 1
      ChangeLog
  2. 12 12
      org.el

+ 8 - 1
ChangeLog

@@ -1,3 +1,10 @@
+2008-02-13  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.el (org-agenda-reset-markers): Renamed from
+	`org-agenda-maybe-reset-markers'.  FORCE argument removed.
+	(org-diary, org-agenda-quit, org-prepare-agenda): Call the renamed
+	function, without force argument.
+
 2008-02-12  Carsten Dominik  <dominik@science.uva.nl>
 2008-02-12  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-make-tags-matcher): Allow "" to match an empty or
 	* org.el (org-make-tags-matcher): Allow "" to match an empty or
@@ -10,7 +17,7 @@
 2008-02-12  Bastien Guerry  <bzg@altern.org>
 2008-02-12  Bastien Guerry  <bzg@altern.org>
 
 
 	* org.el (org-export-as-html): Use :html-extension instead of
 	* org.el (org-export-as-html): Use :html-extension instead of
-	org-export-html-extension. 
+	org-export-html-extension.
 	(org-store-link): Support for links from `rmail-summary-mode'.
 	(org-store-link): Support for links from `rmail-summary-mode'.
 
 
 2008-02-11  Carsten Dominik  <dominik@science.uva.nl>
 2008-02-11  Carsten Dominik  <dominik@science.uva.nl>

+ 12 - 12
org.el

@@ -16914,6 +16914,7 @@ Where possible, use the standard interface for changing this line."
 (defun org-columns-widen (arg)
 (defun org-columns-widen (arg)
   "Make the column wider by ARG characters."
   "Make the column wider by ARG characters."
   (interactive "p")
   (interactive "p")
+  (debug)
   (let* ((n (current-column))
   (let* ((n (current-column))
 	 (entry (nth n org-columns-current-fmt-compiled))
 	 (entry (nth n org-columns-current-fmt-compiled))
 	 (width (or (nth 2 entry)
 	 (width (or (nth 2 entry)
@@ -17026,7 +17027,7 @@ display, or in the #+COLUMNS line of the current buffer."
 (defun org-columns-get-autowidth-alist (s cache)
 (defun org-columns-get-autowidth-alist (s cache)
   "Derive the maximum column widths from the format and the cache."
   "Derive the maximum column widths from the format and the cache."
   (let ((start 0) rtn)
   (let ((start 0) rtn)
-    (while (string-match (org-re "%\\([[:alpha:]]\\S-*\\)") s start)
+    (while (string-match (org-re "%\\([[:alpha:]][[:alnum:]_-]*\\)") s start)
       (push (cons (match-string 1 s) 1) rtn)
       (push (cons (match-string 1 s) 1) rtn)
       (setq start (match-end 0)))
       (setq start (match-end 0)))
     (mapc (lambda (x)
     (mapc (lambda (x)
@@ -20194,7 +20195,7 @@ Optional argument FILE means, use this file instead of the current."
 	(unless (or (bobp) org-agenda-compact-blocks)
 	(unless (or (bobp) org-agenda-compact-blocks)
 	  (insert "\n" (make-string (window-width) ?=) "\n"))
 	  (insert "\n" (make-string (window-width) ?=) "\n"))
 	(narrow-to-region (point) (point-max)))
 	(narrow-to-region (point) (point-max)))
-    (org-agenda-maybe-reset-markers 'force)
+    (org-agenda-reset-markers)
     (org-prepare-agenda-buffers (org-agenda-files))
     (org-prepare-agenda-buffers (org-agenda-files))
     (setq org-todo-keywords-for-agenda
     (setq org-todo-keywords-for-agenda
 	  (org-uniquify org-todo-keywords-for-agenda))
 	  (org-uniquify org-todo-keywords-for-agenda))
@@ -20358,14 +20359,10 @@ no longer in use."
     (push m org-agenda-markers)
     (push m org-agenda-markers)
     m))
     m))
 
 
-(defun org-agenda-maybe-reset-markers (&optional force)
-  "Reset markers created by `org-agenda'.  But only if they are old enough."
-  (if (or (and force (not org-agenda-multi))
-	  (> (- (time-to-seconds (current-time))
-		org-agenda-last-marker-time)
-	     5))
-      (while org-agenda-markers
-	(move-marker (pop org-agenda-markers) nil))))
+(defun org-agenda-reset-markers ()
+  "Reset markers created by `org-agenda'."
+  (while org-agenda-markers
+    (move-marker (pop org-agenda-markers) nil)))
 
 
 (defun org-get-agenda-file-buffer (file)
 (defun org-get-agenda-file-buffer (file)
   "Get a buffer visiting FILE.  If the buffer needs to be created, add
   "Get a buffer visiting FILE.  If the buffer needs to be created, add
@@ -21097,7 +21094,10 @@ So the example above may also be written as
 The function expects the lisp variables `entry' and `date' to be provided
 The function expects the lisp variables `entry' and `date' to be provided
 by the caller, because this is how the calendar works.  Don't use this
 by the caller, because this is how the calendar works.  Don't use this
 function from a program - use `org-agenda-get-day-entries' instead."
 function from a program - use `org-agenda-get-day-entries' instead."
-  (org-agenda-maybe-reset-markers)
+  (when (> (- (time-to-seconds (current-time))
+	      org-agenda-last-marker-time)
+	   5)
+    (org-agenda-reset-markers))
   (org-compile-prefix-format 'agenda)
   (org-compile-prefix-format 'agenda)
   (org-set-sorting-strategy 'agenda)
   (org-set-sorting-strategy 'agenda)
   (setq args (or args '(:deadline :scheduled :timestamp :sexp)))
   (setq args (or args '(:deadline :scheduled :timestamp :sexp)))
@@ -22088,7 +22088,7 @@ If ERROR is non-nil, throw an error, otherwise just return nil."
   (let ((buf (current-buffer)))
   (let ((buf (current-buffer)))
     (if (not (one-window-p)) (delete-window))
     (if (not (one-window-p)) (delete-window))
     (kill-buffer buf)
     (kill-buffer buf)
-    (org-agenda-maybe-reset-markers 'force)
+    (org-agenda-reset-markers)
     (org-columns-remove-overlays))
     (org-columns-remove-overlays))
   ;; Maybe restore the pre-agenda window configuration.
   ;; Maybe restore the pre-agenda window configuration.
   (and org-agenda-restore-windows-after-quit
   (and org-agenda-restore-windows-after-quit