From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs refuses to save file in the same encoding it was read Date: 24 Oct 2003 10:14:22 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87u1617hxe.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1067005372 31068 80.91.224.253 (24 Oct 2003 14:22:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2003 14:22:52 +0000 (UTC) Cc: juri@jurta.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Oct 24 16:22:50 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AD2q2-00079G-00 for ; Fri, 24 Oct 2003 16:22:50 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AD2q1-0000iQ-00 for ; Fri, 24 Oct 2003 16:22:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AD2nW-00089R-G0 for emacs-devel@quimby.gnus.org; Fri, 24 Oct 2003 10:20:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AD2jz-000721-Ux for emacs-devel@gnu.org; Fri, 24 Oct 2003 10:16:35 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AD2ia-0006bv-5L for emacs-devel@gnu.org; Fri, 24 Oct 2003 10:15:39 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AD2hz-0006RO-2l; Fri, 24 Oct 2003 10:14:31 -0400 Original-Received: from vor.iro.umontreal.ca (vor.iro.umontreal.ca [132.204.24.42]) by mercure.iro.umontreal.ca (8.12.9/8.12.9) with ESMTP id h9OEENnR004419; Fri, 24 Oct 2003 10:14:23 -0400 Original-Received: by vor.iro.umontreal.ca (Postfix, from userid 20848) id 2B53B3C63E; Fri, 24 Oct 2003 10:14:23 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: Original-Lines: 28 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner: Found to be clean X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17404 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17404 > I think the code is already pretty messy, so I'd rather avoid adding > yet-another-test. Could you explain the reason for the recent change > that introduced the new problem? Maybe we can fix it in some other way? > sorry, i don't remember, but i think i saw a bug in some case. It would be helpful if you could remember. I can't think of any case where the old code could be wrong. The logic is as follows: If t is not a member of (symbol-value hook), then use `setq' rather than `setq-default' to modify the value. There's no need to distinguish between the case where the variable is buffer-local or not: if it is local-variable-if-set-p then the code does the same as the new code and if it is not, `setq' and `setq-default' do the same anyway. > does my fix work? It does, but I'd rather remove the recent patch which does not fix anthing as far as I can tell. Or at least I'd rather fix it by replacing `local-variable-p' by `local-variable-if-set-p' in your recent patch. The fact that you did not notice the bug even after I pointed out the faulty code shows that the logic of the code is already complex enough and should not be made worse as your two patches do. Stefan