From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#28258: 26.0.50; [PATCH] Let file-name-base succeed when buffer-file-name is nil Date: Tue, 29 Aug 2017 13:02:31 -0400 Message-ID: References: <87k21o8m8x.fsf@rose> <1188947996.68721.1504023031457@webmail.mailhostbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1504026219 11179 195.159.176.226 (29 Aug 2017 17:03:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Aug 2017 17:03:39 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: 28258@debbugs.gnu.org To: Mohammed Sadiq Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 29 19:03:30 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmjux-0001Ti-2v for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Aug 2017 19:03:11 +0200 Original-Received: from localhost ([::1]:46161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmjv0-0001PD-FK for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Aug 2017 13:03:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmjuq-0001Om-5k for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 13:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmjup-0007vF-HF for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 13:03:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmjup-0007v0-ET for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 13:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dmjun-0006QQ-In for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 13:03:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Aug 2017 17:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28258 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28258-submit@debbugs.gnu.org id=B28258.150402617624688 (code B ref 28258); Tue, 29 Aug 2017 17:03:01 +0000 Original-Received: (at 28258) by debbugs.gnu.org; 29 Aug 2017 17:02:56 +0000 Original-Received: from localhost ([127.0.0.1]:60960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmjui-0006Q7-LP for submit@debbugs.gnu.org; Tue, 29 Aug 2017 13:02:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmjuf-0006Pt-Mi for 28258@debbugs.gnu.org; Tue, 29 Aug 2017 13:02:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmjuV-0007lA-3Y for 28258@debbugs.gnu.org; Tue, 29 Aug 2017 13:02:48 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmjuJ-0007gQ-O8; Tue, 29 Aug 2017 13:02:31 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dmjuJ-0001NK-D5; Tue, 29 Aug 2017 13:02:31 -0400 X-Spook: Attorney General e-cash Bacteria Toxic Al-Qaeda Brush X-Ran: r4kk@g?X4z!/dU^~5BQ5Xn_gxL_?TE#w&IH3yiR (Mohammed Sadiq's message of "Tue, 29 Aug 2017 21:40:31 +0530 (IST)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136339 Archived-At: Mohammed Sadiq wrote: >> 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. Thanks for explaining. I don't think I agree, but then the fact that the 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.