>>>> "juhp" == Jens-Ulrik Petersen
<petersen(a)kurims.kyoto-u.ac.jp> writes:
juhp> A leading dot should never be considered to be an extension
juhp> separator. I can't think of any example where
juhp> (file-name-sans-extension ".file") => "" would be
useful.
But I can think of a case where the Scheme semantics can be dangerous.
If you take the name literally, you would think you could safely
delete all files whose full name is (file-name-sans-extension ".emacs"
file). I would personally prefer that by default stripping ".emacs"
from ".emacs" not result in ".emacs".
And confusing: Scheme semantics means that both .emacs and
.emacs.emacs would be operated on, which is different from all other
cases. Or would .emacs.emacs -> .emacs? What *does* Scheme do there?
I don't see a good argument for either.
;; operate on dotfiles, too, as a special case
(let ((basename (file-name-sans-extension ".file" filename)))
(if (equal basename "")
filename
basename))
just isn't that bad; my intuition is that normally dotfiles are
dotfiles with the intention that they not be operated on by default,
so you should have to explicitly include them in the list by special
casing. The reverse
;; do not operate on dotfiles; special case in JUHP's version
(let ((basename (file-name-sans-extension ".file" filename)))
(if (equal basename filename)
""
basename))
seems quite confusing to me. And if you don't like the default
behavior in the case of .emacs.emacs, it would be worse. No?