From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: buffer-read-only is always t at text-mode-hook time Date: Fri, 13 Aug 2004 16:13:11 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <411D3CF7.2050407@yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1092491200 412 80.91.224.253 (14 Aug 2004 13:46:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Aug 2004 13:46:40 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 14 15:46:33 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bvyrg-0003Ia-00 for ; Sat, 14 Aug 2004 15:46:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bvyvg-0007Rs-O4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Aug 2004 09:50:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bvyve-0007Qz-PQ for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2004 09:50:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bvyvc-0007QQ-TK for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2004 09:50:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bvyvc-0007QG-PF for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2004 09:50:36 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BvyrT-0002qN-AL for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2004 09:46:19 -0400 Original-Received: from [130.59.10.2] (helo=chx400.switch.ch) by mx20.gnu.org with esmtp (Exim 4.34) id 1BvkIJ-0004mj-Sh for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2004 18:13:04 -0400 Original-Received: from mail.fu-berlin.de ([130.133.1.2]) by chx400.switch.ch with esmtp (Exim 3.20 #1) id 1BvkIH-0001Jj-00 for gnu-emacs-bug@moderators.isc.org; Sat, 14 Aug 2004 00:13:01 +0200 Original-Received: by Mail.FU-Berlin.DE (Exim 4.41) from curry.zedat.fu-berlin.de ([160.45.10.36]) for gnu-emacs-bug@moderators.isc.org with esmtp id <1BvkIH-0009mo-43>; Sat, 14 Aug 2004 00:13:01 +0200 Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.uni-berlin.de with bsmtp id ; Sat, 14 Aug 2004 00:13:00 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 50 X-Orig-X-Trace: news.uni-berlin.de zQDLhen4E88FYuq448/TQAqJIqJr2D7IqbtgzOruFh30jUC98= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:8702 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8702 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