GNU bug report logs -
#24759
25.1.50; electric-quote-mode
Previous Next
Reported by: Dani Moncayo <dmoncayo <at> gmail.com>
Date: Fri, 21 Oct 2016 19:39:02 UTC
Severity: minor
Found in version 25.1.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 24759 <at> debbugs.gnu.org (full text, mbox):
> Cc: 24759 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Fri, 21 Oct 2016 14:04:56 -0700
>
> On 10/21/2016 12:58 PM, Eli Zaretskii wrote:
> > I think this condition:
> >
> > (defun electric--insertable-p (string)
> > (or (not buffer-file-coding-system)
> > (eq (coding-system-base buffer-file-coding-system) 'undecided)
> > (not (unencodable-char-position nil nil buffer-file-coding-system
> > nil string))))
> >
> > should also accept a coding-system that is the default-value of
> > buffer-file-coding-system, because that's how buffers are created.
> > When the file is saved, Emacs will ask for a proper encoding, which is
> > not a catastrophe.
>
> Wouldn't this lead to problems? If I use electric quoting in a unibyte
> French locale, where I the default is an ISO 8859 encoding and
> buffer-file-coding-system is something like iso-latin-1-unix, when I
> later save the file Emacs will say "Select coding system (default
> chinese-iso-8bit): ". This is hardly user-friendly, even if we improve
> Emacs to guess UTF-8, as there may be a long interval between typing `
> and saving the buffer.
This is standard Emacs behavior. Emacs never makes any tests of the
current buffer-file-coding-system when you insert characters. You
will see the same at save-buffer time if you insert the curved quotes
with, e.g., "C-x 8 [", where we insert the character no matter what is
the current buffer-file-coding-system. Users who use
electric-quote-mode and don't have UTF-8 as their default encoding
will get accustomed to this prompt soon enough.
So I actually question the need for any test in electric--insertable-p.
What bad things, besides the prompt at save-buffer time, will happen
if we remove the test, and insert the characters unconditionally?
This bug report was last modified 8 years and 271 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.