From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
Mohammed Sadiq wrote:
>> IIUC: file-name-base currently errors when called with no applicab= le
>> file name, and you want it to instead return nil? This seems rathe= r
>> unusual for an Emacs file-related function. I would have thought t= his
>> unlikely to be applied, but maybe you could explain why you want i= t?
>
> The signature of `file-name-base' is (file-name-base &optional= FILENAME).
> That is, the FILENAME argument is optional. So I believe it shouldn= 9;t
> be an error to not give the optional argument. And so calling the func= tion
> in a buffer with no file associated shouldn't be an error. I'm= not sure
> if my assertion is right.
Thanks for explaining. I don't think I agree, but then the fact that th= e
argument is optional and defaults to buffer-file-name also seems
atypical to me (eg I don't think any other file-name- functions behaves=
like that). Let's wait and see if anyone else feels strongly one way or=
the other.