[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28258: 26.0.50; [PATCH] Let file-name-base succeed when buffer-file-
bug#28258: 26.0.50; [PATCH] Let file-name-base succeed when buffer-file-name is nil
Mon, 18 Sep 2017 20:41:52 -0400
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Philipp Stephani wrote:
> Changing from raising an error to returning nil is a breaking change:
> callers currently can rely on the return value being never nil, and can
> rely on errors being raised. Changing this would break these assumptions.
> Even ignoring that, I think raising an error is the right thing to do:
> unless given a filename, the function can't fulfil its promise, and raising
> an error is the most appropriate reaction to this. (There are already way
> too many Elisp functions that silently ignore errorneous situations.)
I think you've summarized things very well.
> I do agree that the calling convention of `file-name-base' is odd. How
> about making the argument mandatory (initially only by changing the
> advertised calling convention and the docstring)?
Sounds good to me.