From a1a7d89e1a808bf3aaedb23fc0b556712a949854 Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Sat, 5 Jan 2013 00:28:17 +0100 Subject: [PATCH] * calendar/todos.el (todos-reset-global-current-todos-file) (todos-display-categories-1): Use absolute name of todos-default-todos-file. --- lisp/ChangeLog | 6 ++++++ lisp/calendar/todos.el | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8c52196c5ac..5ac573dc06b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-01-04 Stephen Berman + + * 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 * calendar/todos.el (todos-insert-item): Fix copy and paste error diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el index 75af84b8812..f1876db459c 100644 --- a/lisp/calendar/todos.el +++ b/lisp/calendar/todos.el @@ -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) -- 2.39.5