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

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

Re: buffer-read-only is always t at text-mode-hook time


From: Kevin Rodgers
Subject: Re: buffer-read-only is always t at text-mode-hook time
Date: Fri, 13 Aug 2004 16:13:11 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Dan Jacobson wrote:
> Ok it is not true that "buffer-read-only is always t at text-mode-hook time".
>
> Of course my bogus bug report is not my fault,

Why not?

>  > tell folks how also to set a hook just in case they need to
>  > override. Don't only mention just add-hook.
>
> Rogers> Bad idea.

Could you do me the small favor of spelling my name correctly?

> Well, with all the setq examples from the 80's gone, we'll just add
> and add, and produce bogus bug reports.

add-hook's doc string clearly states that the HOOK symbol is a
variable, from which you can infer that you can modify it with
set/setq like any other.  The reason users should not be encouraged to
do so is obvious: a hook is a list-valued variable that should be
modified incrementally to limit the scope of the change to what is
intended and not not affect other aspects of the system of which the
user may not be aware.

How does add-hook/remove-hook contribute to more bogus bug reports
than set/setq?

> rms>     (add-hook 'text-mode-hook 'turn-on-auto-fill)
> rms> should also show how to not turn it on for files one has no
  hope of editing.
> rms> Why bother to check?  If you don't edit, it won't do anything.
>
> Well, at least do so for flyspell.el where it counts.

I don't agree.  If a user expects flyspell to work regardless of
whether the buffer is read-only or writeable (i.e. checking the
current word after each command), then disabling it automatically is
clearly wrong (and doesn't allow him/her to control Emacs' behavior).
Leaving it as is at least gives users like you the opportunity to turn
it off.

> OK, using (and (not buffer-read-only)(> 88888 (buffer-size))(flyspell-mode 1))
> Over and out.

Ah, the magic 86.8046875 KB buffer size.  :-)

--
Kevin Rodgers





reply via email to

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