[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Buffer local variables, let bindings, and read-file-name
From: |
Harald Hanche-Olsen |
Subject: |
Buffer local variables, let bindings, and read-file-name |
Date: |
Wed, 01 May 2013 20:12:57 +0200 (CEST) |
Is there a good explanation for the following behaviour?
Background: This is on OS X, which has a case insensitive filesystem,
so read-file-name-completion-ignore-case is accordingly set to t.
Possibly, the problem can be reproduced on other OSs by setting the
variable first; but I haven't checked.
----------------
Now if I create a new buffer and evaluate (read-file-name "file: ")
in the buffer, I get case insensitive completion, and all is well.
But if I evaluate (setq-local completion-ignore-case t) in the buffer
and try (read-file-name "file: ") again, completion is case sensitive.
----------------
How can this be? I see that the code for read-file-name-default does
(let ((completion-ignore-case read-file-name-completion-ignore-case)) …)
i.e., it let binds a buffer local variable to the same value it has
already, namely t. And yet, it behaves as if it were now nil.
I know that there can be difficulties with let bindings and
buffer-local variables, but not this kind of difficulties?
Starting emacs with -Q produces the same result.
This is emacs from trunk as of April 11.
- Harald
- Buffer local variables, let bindings, and read-file-name,
Harald Hanche-Olsen <=