GNU bug report logs - #28258
26.0.50; [PATCH] Let file-name-base succeed when buffer-file-name is nil

Previous Next

Package: emacs;

Reported by: Mohammed Sadiq <sadiq <at> sadiqpk.org>

Date: Mon, 28 Aug 2017 02:24:01 UTC

Severity: wishlist

Tags: patch

Found in version 26.0.50

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 28258 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 28258 <at> debbugs.gnu.org, Mohammed Sadiq <sadiq <at> sadiqpk.org>
Subject: Re: bug#28258: 26.0.50;
 [PATCH] Let file-name-base succeed when buffer-file-name is nil
Date: Mon, 18 Sep 2017 20:41:52 -0400
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.




This bug report was last modified 7 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.