emacs-devel
[Top][All Lists]
Advanced

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

Re: Undesired interactive call of major mode command


From: Stefan Monnier
Subject: Re: Undesired interactive call of major mode command
Date: Sun, 23 Nov 2014 22:56:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> - If you call todo-mode in an empty non-file buffer, you get the error
>   (wrong-type-argument arrayp nil) because todo-mode calls
>   (file-truename (buffer-file-name)) (this was the error of bug#19112).

Signaling such an error is indeed a bug here.  Better emit a message.

> - If you call todo-mode in a non-empty buffer (whether or not it is
>   visiting a file (except a Todo mode file, of course), you get the
>   Todo mode error "Invalid or missing todo-categories sexp", because the
>   buffer text does not conform to the Todo mode file format.

That's probably OK.

> - If you call todo-mode in a buffer visiting an empty file, you get no
>   error, but since the buffer is then in Todo mode, if you invoke any
>   Todo mode command you'll get an error, again because of the invalid
>   file format for Todo mode.

Of course, an alternative might be to move some of the code outside of
todo-mode to some other function.


        Stefan



reply via email to

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