Closed phillord closed 9 years ago
I don't like the "empty" case here. The name of the function is to "swap the extension", so I think the API should require another. To remove the extension, simply use f-no-ext
.
In a sense, I agree with you. However, I didn't like
(f-swap-ext "hello.txt" ""); => "hello."
either. For me, this result is counter intuitive also, as a "." at the end of the a file name appears broken (even if it is technically valid). And it seemed to me that both swapping and removing an extension is a reasonable thing to want to do a number of paths in a single operation.
I'm not totally attached to it, though, and is not necessary for my use case. If you would prefer an error condition with "" or nil, I can stick that it. Silently removing the extension with a "." I would dislike.
Added this now. And fixed the tests which weren't testing!
Could you also update the docs!?
oops
Johan Andersson notifications@github.com writes:
Could you also update the docs!?
Reply to this email directly or view it on GitHub: https://github.com/rejeep/f.el/pull/38#issuecomment-73237696
Phillip Lord, Phone: +44 (0) 191 208 7827 Lecturer in Bioinformatics, Email: phillip.lord@newcastle.ac.uk School of Computing Science, http://homepages.cs.ncl.ac.uk/phillip.lord Room 914 Claremont Tower, skype: russet_apples Newcastle University, twitter: phillord NE1 7RU
Bump!
Thanks, merged! Skipped updating the version number though as I will release v0.18 soon.
Given a file name, replaces the extension with another.
I might be the only person in the world to need this, but I (would) use this a lot. Not sure if I have done the readme properly.