* calendar/todos.el (todos-reset-global-current-todos-file)
authorStephen Berman <stephen.berman@gmx.net>
Fri, 4 Jan 2013 23:28:17 +0000 (00:28 +0100)
committerStephen Berman <stephen.berman@gmx.net>
Fri, 4 Jan 2013 23:28:17 +0000 (00:28 +0100)
(todos-display-categories-1): Use absolute name of
todos-default-todos-file.

lisp/ChangeLog
lisp/calendar/todos.el

index 8c52196..5ac573d 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-04  Stephen Berman  <Stephen.Berman@rub.de>
+
+       * calendar/todos.el (todos-reset-global-current-todos-file)
+       (todos-display-categories-1): Use absolute name of
+       todos-default-todos-file.
+
 2013-01-04  Stephen Berman  <Stephen.Berman@rub.de>
 
        * calendar/todos.el (todos-insert-item): Fix copy and paste error
index 75af84b..f1876db 100644 (file)
@@ -954,8 +954,9 @@ the value of `todos-default-todos-file'.
 This function is added to `kill-buffer-hook' in Todos mode."
   (let ((filename (file-truename (buffer-file-name))))
     (setq todos-file-buffers (delete filename todos-file-buffers))
-    (setq todos-global-current-todos-file (or (car todos-file-buffers)
-                                             todos-default-todos-file))))
+    (setq todos-global-current-todos-file
+         (or (car todos-file-buffers)
+             (todos-absolute-file-name todos-default-todos-file)))))
 
 (defvar todos-categories nil
   "Alist of categories in the current Todos file.
@@ -1292,6 +1293,7 @@ With nil or omitted CATEGORY, default to the current category."
                   ;; to this file, so have to initialize Todos file and
                   ;; categories variables in order e.g. to enable categories
                   ;; display.
+                  ;; FIXME: is this right?
                   (setq todos-default-todos-file (buffer-file-name))
                   (setq todos-categories (todos-make-categories-list t)))
          ;; With empty buffer (e.g. with new archive in
@@ -2298,8 +2300,9 @@ which is the value of the user option
 (defun todos-display-categories-1 ()
   "Prepare buffer for displaying table of categories and item counts."
   (unless (eq major-mode 'todos-categories-mode)
-    (setq todos-global-current-todos-file (or todos-current-todos-file
-                                             todos-default-todos-file))
+    (setq todos-global-current-todos-file
+         (or todos-current-todos-file
+             (todos-absolute-file-name todos-default-todos-file)))
     (set-window-buffer (selected-window)
                       (set-buffer (get-buffer-create todos-categories-buffer)))
     (kill-all-local-variables)