From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: how having the basename of a file or directory Date: Mon, 31 Jan 2011 13:53:45 +0100 Message-ID: References: <8739o9ilfs.fsf@gmail.com> <877hdl4grd.fsf@uwakimon.sk.tsukuba.ac.jp> <87y661h2ju.fsf@gmail.com> <877hdl5o99.fsf@gmail.com> <8739o95kpy.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 1296478445 24415 80.91.229.12 (31 Jan 2011 12:54:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2011 12:54:05 +0000 (UTC) Cc: "Stephen J. Turnbull" , emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 31 13:54:00 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 1PjtGa-0007KD-BM for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 13:54:00 +0100 Original-Received: from localhost ([127.0.0.1]:36972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjtGZ-0002gp-Oa for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 07:53:59 -0500 Original-Received: from [140.186.70.92] (port=50344 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjtGT-0002gY-Lb for emacs-devel@gnu.org; Mon, 31 Jan 2011 07:53:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjtGQ-0006KJ-AP for emacs-devel@gnu.org; Mon, 31 Jan 2011 07:53:53 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.10]:34023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjtGQ-0006JC-50 for emacs-devel@gnu.org; Mon, 31 Jan 2011 07:53:50 -0500 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id C4AC8186DEE1; Mon, 31 Jan 2011 13:53:46 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 2886F1C00164; Mon, 31 Jan 2011 13:53:47 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id RVU-gW37ONWY; Mon, 31 Jan 2011 13:53:45 +0100 (CET) Original-Received: from hase (ppp-88-217-107-21.dynamic.mnet-online.de [88.217.107.21]) by mail.mnet-online.de (Postfix) with ESMTP; Mon, 31 Jan 2011 13:53:45 +0100 (CET) X-Yow: Don't worry, nobody really LISTENS to lectures in MOSCOW, either! .. FRENCH, HISTORY, ADVANCED CALCULUS, COMPUTER PROGRAMMING, BLACK STUDIES, SOCIOBIOLOGY!.. Are there any QUESTIONS?? In-Reply-To: <8739o95kpy.fsf@gmail.com> (Thierry Volpiatto's message of "Mon, 31 Jan 2011 13:19:37 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 212.18.0.10 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:135299 Archived-At: Thierry Volpiatto writes: > Andreas Schwab writes: > >> Thierry Volpiatto writes: >> >>> Andreas Schwab writes: >>> >>>> Thierry Volpiatto writes: >>>> >>>>> (file-name-nondirectory "path/to/a/directory") >>>>> should return ==> directory >>>> >>>> It does. >>> Not really. >>> It does if PATH doesn't end with "/" otherwise no, it's why >> >> file-name-nondirectory doesn't care whether the argument is a directory >> or not, it looks only at the contents of the string. > Yes, i understood that, i am just pointing out that we should not have > to take care if string end with / or not, like shell command basename. file-name-nondirectory is not basename. The empty string is a valid file name in Emacs. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."