help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: todo mode broken?


From: Stephen Berman
Subject: Re: todo mode broken?
Date: Sun, 03 Oct 2004 23:06:57 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

On Wed, 29 Sep 2004 22:27:34 -0500 Daniel L Elliott 
<dan_elliott_at_cox_dot_net@spam_is_pathetic.com> wrote:

> All,
>
> I am using GNU Emacs 21.3.1 which installed with Fedora Core 1.  I am
> having repeated difficulties with the todo mode.  Apparently, it is not
> adding categories to the .todo file correctly.  I have tried deleting any
> .todo file(s) on my machine and this continues to happen.
>
> Should I just download the latest version?  Any other potential fix?
>
> - dan

If the problem you're experiencing is the same as the one described
below, then updating won't help, since the relevant code
(todo-initial-setup) is the same in Emacs 21.3 and CVS Emacs.  Perhaps
the following patch I submitted to bug-gnu-emacs back in January 2002
might help you.

--Steve Berman
(My email address is no longer the one below, but the one in the From
line of this email.)


From: Stephen Berman <steve@IMS.Uni-Stuttgart.DE>
Subject: Re: todo-mode error "todo-category-select: Search failed: ..."
To: Klaus Zeitler <kzeitler@lucent.com>
Cc: bug-gnu-emacs@gnu.org
Date: 24 Jan 2002 16:54:49 +0100

Klaus Zeitler <kzeitler@lucent.com> writes:

> In GNU Emacs 21.1.1 (hppa2.0-hp-hpux10.20, OSF/Motif Version 1.2.6)
[...] 
> 1. start emacs with options -q --no-site-file
> 2. M-x todo-insert-item "entry1"
>    specify a category e.g. "cat1"
> 3. type s and q to save and quit
> 4. M-x todo-show
>    shows the item in category "Todo" instead of category "cat1"
>    and now entering "+" i.e. todo-forward-category results in error:
>    
>    todo-category-select: Search failed: "^\\*/\\* --- cat1$"
> 
> the todo-do file contains:
> 
> -*- mode: todo; todo-categories: ("Todo" "cat1" "Todo" "Todo"); -*-
> */* --- Todo
> */* 2001-12-07 15:08 kzeitler: entry1
> --- End
> */* 
> ---------------------------------------------------------------------------
> 
> i.e. the new category "cat1" is entered in the list of categories but the
> item is entered in the block of "Todo" items and there's no block
> for "cat1" items.
> 
> Besides the variable todo-categories in the mode header
> looks a bit odd too: ("Todo" "cat1" "Todo" "Todo")

The following patch fixes this problem (to do this it was convenient
to eliminate the default "Todo" category, so you just have to specify
an initial category; I hope that's acceptable).  In fixing this I also
noticed that the original code for todo-insert-item with a prefix
argument does just the opposite of what the docstring says; I've now
made it comply with the docstring.

--Steve Berman


*** todo-mode.el        Tue Jan 15 15:58:49 2002 (version 1.50)
--- todo-mode.el        Thu Jan 24 16:31:35 2002
***************
*** 609,618 ****
           (current-category (nth todo-category-number todo-categories))
           (category
            (if arg
!               current-category
!             (completing-read (concat "Category [" current-category "]: ")
!                              (todo-category-alist) nil nil nil
!                              history current-category))))
        (todo-add-item-non-interactively new-item category))))
  
  (defalias 'todo-cmd-inst 'todo-insert-item)
--- 727,736 ----
           (current-category (nth todo-category-number todo-categories))
           (category
            (if arg
!               (completing-read (concat "Category [" current-category "]: ")
!                                (todo-category-alist) nil nil nil
!                                history current-category)
!             current-category)))
        (todo-add-item-non-interactively new-item category))))
  
  (defalias 'todo-cmd-inst 'todo-insert-item)
***************
*** 954,963 ****
  
  (defun todo-initial-setup ()
    "Set up things to work properly in TODO mode."
!   (find-file todo-file-do)
!   (erase-buffer)
!   (todo-mode)
!   (todo-add-category "Todo"))
  
  (provide 'todo-mode)
  
--- 1202,1213 ----
  
  (defun todo-initial-setup ()
    "Set up things to work properly in TODO mode."
!   (let ((first (read-from-minibuffer "Enter a new category: ")))
!     (find-file todo-file-do)
!     (erase-buffer)
!     (todo-mode)
!     (todo-add-category first)
!     (write-file todo-file-do)))
  
  (provide 'todo-mode)
  

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs





reply via email to

[Prev in Thread] Current Thread [Next in Thread]