[Top][All Lists]

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

Re: emacs refuses to save file in the same encoding it was read

From: Stefan Monnier
Subject: Re: emacs refuses to save file in the same encoding it was read
Date: 24 Oct 2003 10:14:22 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>     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.


reply via email to

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