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


View this message in rfc822 format

From: Mohammed Sadiq <sadiq <at> sadiqpk.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 28258 <at> debbugs.gnu.org
Subject: bug#28258: 26.0.50; [PATCH] Let file-name-base succeed when buffer-file-name is nil
Date: Tue, 29 Aug 2017 21:40:31 +0530 (IST)
> On August 29, 2017 at 9:24 PM Glenn Morris <rgm <at> gnu.org> wrote:

> Hi, and thanks for the patch.
> IIUC: file-name-base currently errors when called with no applicable
> file name, and you want it to instead return nil? This seems rather
> unusual for an Emacs file-related function. I would have thought this
> unlikely to be applied, but maybe you could explain why you want it?

The signature of `file-name-base' is (file-name-base &optional FILENAME).
That is, the FILENAME argument is optional. So I believe it shouldn't
be an error to not give the optional argument. And so calling the function
in a buffer with no file associated shouldn't be an error. I'm not sure
if my assertion is right.

Feel free to do what it is felt to be right. :)




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

Previous Next


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