瀏覽代碼

Make marker-resetting more robust.

Carsten Dominik 17 年之前
父節點
當前提交
e16c85fc4b
共有 2 個文件被更改,包括 20 次插入13 次删除
  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>
 
 	* org.el (org-make-tags-matcher): Allow "" to match an empty or
@@ -10,7 +17,7 @@
 2008-02-12  Bastien Guerry  <bzg@altern.org>
 
 	* 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'.
 
 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)
   "Make the column wider by ARG characters."
   (interactive "p")
+  (debug)
   (let* ((n (current-column))
 	 (entry (nth n org-columns-current-fmt-compiled))
 	 (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)
   "Derive the maximum column widths from the format and the cache."
   (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)
       (setq start (match-end 0)))
     (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)
 	  (insert "\n" (make-string (window-width) ?=) "\n"))
 	(narrow-to-region (point) (point-max)))
-    (org-agenda-maybe-reset-markers 'force)
+    (org-agenda-reset-markers)
     (org-prepare-agenda-buffers (org-agenda-files))
     (setq 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)
     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)
   "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
 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."
-  (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-set-sorting-strategy 'agenda)
   (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)))
     (if (not (one-window-p)) (delete-window))
     (kill-buffer buf)
-    (org-agenda-maybe-reset-markers 'force)
+    (org-agenda-reset-markers)
     (org-columns-remove-overlays))
   ;; Maybe restore the pre-agenda window configuration.
   (and org-agenda-restore-windows-after-quit