From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: how having the basename of a file or directory Date: Tue, 01 Feb 2011 20:55:05 +0900 Message-ID: <8739o83r6u.fsf@uwakimon.sk.tsukuba.ac.jp> References: <8739o9ilfs.fsf@gmail.com> <877hdl4grd.fsf@uwakimon.sk.tsukuba.ac.jp> <87y661h2ju.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296561835 10082 80.91.229.12 (1 Feb 2011 12:03:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Feb 2011 12:03:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 01 13:03:51 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PkExb-0000uN-2i for ged-emacs-devel@m.gmane.org; Tue, 01 Feb 2011 13:03:51 +0100 Original-Received: from localhost ([127.0.0.1]:47566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkExa-0007J4-31 for ged-emacs-devel@m.gmane.org; Tue, 01 Feb 2011 07:03:50 -0500 Original-Received: from [140.186.70.92] (port=44736 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkExR-0007I7-Sg for emacs-devel@gnu.org; Tue, 01 Feb 2011 07:03:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkExQ-0004fi-T4 for emacs-devel@gnu.org; Tue, 01 Feb 2011 07:03:41 -0500 Original-Received: from mgmt2.sk.tsukuba.ac.jp ([130.158.97.224]:40462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkExQ-0004Zw-IO for emacs-devel@gnu.org; Tue, 01 Feb 2011 07:03:40 -0500 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt2.sk.tsukuba.ac.jp (Postfix) with ESMTP id 41ECA9705E1; Tue, 1 Feb 2011 21:03:31 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 533C31A3007; Tue, 1 Feb 2011 20:55:05 +0900 (JST) In-Reply-To: <87y661h2ju.fsf@gmail.com> X-Mailer: VM undefined under 21.5 (beta29) "garbanzo" ed3b274cc037 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.158.97.224 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135397 Archived-At: Thierry Volpiatto writes: > (file-name-nondirectory "path/to/a/directory") > should return ==> directory > (file-name-nondirectory "path/to/a/file") > should return ==> file They do. (file-name-nondirectory "path/to/a/directory/") => "" is the problem. > So modifying `file-name-nondirectory' This is probably out of the question. It should be the case that (equal fname (concat (file-name-directory fname) (file-name-nondirectory fname)))) > or creating a basename function Un-Pythonic. But then, this isn't Python, so I guess it's OK. ;-)