emacs-devel
[Top][All Lists]
Advanced

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

Buffer-local variables affect general-purpose functions


From: Eli Zaretskii
Subject: Buffer-local variables affect general-purpose functions
Date: Wed, 26 Mar 2014 21:04:45 +0200

(See bug#17011 for some context.)

In some cases, Emacs uses buffer-local variables in ways that affect
operations which might not have anything with buffer text.  One
example, from bug #17011 is this:

  M-x find-file-literally RET some-file RET
  M-x set-variable RET case-fold-search RET t RET
  M-: (chars-equal ?à ?À) RET

This produces nil, although the characters should compare equal under
case-fold-search.  Why?  Because we are in a unibyte buffer, where
values between 128 and 255 are interpreted as eight-bit raw bytes, not
as Latin characters, and raw bytes don't have lower/upper-case pairs.

Another example, from the same sequence of commands above, is the fact
that setting case-fold-search for the buffer affects comparison of
characters that don't belong to the buffer, merely because that buffer
happens to be current at the moment of comparison.

Yet another example is 'downcase' and 'upcase' functions -- they use
case tables local to the current buffer, even when the functions they
are applied to characters and strings not from the buffer.

This could produce subtle bugs, and is certainly confusing and
unexpected, at least by some.

The question is: do we want to do something about that?




reply via email to

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