unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: emacs-devel@gnu.org
Subject: Re: Undesired interactive call of major mode command
Date: Sun, 23 Nov 2014 22:56:16 -0500	[thread overview]
Message-ID: <jwvppcdi79z.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ppceop33.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Sat, 22 Nov 2014 23:19:44 +0100")

> - 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	other threads:[~2014-11-24  3:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22 14:23 Undesired interactive call of major mode command Stephen Berman
2014-11-22 16:15 ` Stefan Monnier
2014-11-22 22:19   ` Stephen Berman
2014-11-24  3:56     ` Stefan Monnier [this message]
2014-11-25 21:58       ` Stephen Berman
2014-11-26  2:16         ` Stefan Monnier
2014-11-26 13:39           ` Stephen Berman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvppcdi79z.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).