unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: juri@jurta.org, emacs-devel@gnu.org
Subject: Re: emacs refuses to save file in the same encoding it was read
Date: 24 Oct 2003 10:14:22 -0400	[thread overview]
Message-ID: <jwvsmliu3wq.fsf-monnier+emacs/devel@vor.iro.umontreal.ca> (raw)
In-Reply-To: <E1ACzON-0001ke-Sz@fencepost.gnu.org>

>     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

  reply	other threads:[~2003-10-24 14:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10 20:08 emacs refuses to save file in the same encoding it was read Sam Steingold
2003-10-14  0:52 ` Kenichi Handa
2003-10-14  3:42   ` Pascal J.Bourguignon
2003-10-22  9:14 ` Juri Linkov
2003-10-22 12:43   ` Stefan Monnier
2003-10-22 15:17     ` Juri Linkov
2003-10-22 17:15       ` Stefan Monnier
2003-10-23 18:38   ` Richard Stallman
2003-10-23 19:15     ` Stefan Monnier
2003-10-24 10:42       ` Richard Stallman
2003-10-24 14:14         ` Stefan Monnier [this message]
2003-10-25 22:26           ` Richard Stallman
2003-10-26 18:52             ` Stefan Monnier
2003-10-23 19:27     ` Alan Shutko

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=jwvsmliu3wq.fsf-monnier+emacs/devel@vor.iro.umontreal.ca \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /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).