From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: how having the basename of a file or directory Date: Tue, 01 Feb 2011 11:52:46 -0500 Message-ID: <874o8nvgrl.fsf@red-bean.com> References: <8739o9ilfs.fsf@gmail.com> <877hdl4grd.fsf@uwakimon.sk.tsukuba.ac.jp> <87y661h2ju.fsf@gmail.com> <8739o83r6u.fsf@uwakimon.sk.tsukuba.ac.jp> <87tygnwyt8.fsf@red-bean.com> <87sjw73elr.fsf@uwakimon.sk.tsukuba.ac.jp> Reply-To: Karl Fogel NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296579890 17048 80.91.229.12 (1 Feb 2011 17:04:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Feb 2011 17:04:50 +0000 (UTC) Cc: emacs-devel@gnu.org, Thierry Volpiatto To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 01 18:04:46 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 1PkJel-0007a6-1y for ged-emacs-devel@m.gmane.org; Tue, 01 Feb 2011 18:04:43 +0100 Original-Received: from localhost ([127.0.0.1]:49931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkJYG-0002iL-D2 for ged-emacs-devel@m.gmane.org; Tue, 01 Feb 2011 11:58:00 -0500 Original-Received: from [140.186.70.92] (port=42488 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkJTK-0000RP-Jn for emacs-devel@gnu.org; Tue, 01 Feb 2011 11:52:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkJTJ-0008G1-M2 for emacs-devel@gnu.org; Tue, 01 Feb 2011 11:52:54 -0500 Original-Received: from osh-net-219-98.onshore.net ([66.146.219.98]:57576 helo=sanpietro.red-bean.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkJTJ-0008EY-Gc for emacs-devel@gnu.org; Tue, 01 Feb 2011 11:52:53 -0500 Original-Received: from localhost ([127.0.0.1]:41003 helo=floss ident=kfogel) by sanpietro.red-bean.com with esmtp (Exim 4.72) (envelope-from ) id 1PkJTD-0000SR-Dz; Tue, 01 Feb 2011 10:52:47 -0600 In-Reply-To: <87sjw73elr.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Wed, 02 Feb 2011 01:26:56 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 66.146.219.98 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:135407 Archived-At: "Stephen J. Turnbull" writes: >Karl Fogel writes: > > "Stephen J. Turnbull" writes: > > > > or creating a basename function > > > > > >Un-Pythonic. But then, this isn't Python, so I guess it's OK. ;-) > > > > $ python > > Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) > > >>> import os.path > > >>> os.path.basename("/home/kfogel/README") > > 'README' > > >>> quit() > > $ > >You know what I mean. "Not every three-line function needs to be a >built-in." AFAIK Python doesn't have an equivalent to >file-name-directory; you need to write that yourself. Oh, sorry -- I didn't actually know that's what you meant. (Sometimes people use "Pythonic" to mean "whatever matches my taste"; you were being more careful than that, but unfortunately it was lost on me because I've been too degraded by other conversations.) FWIW, for me the compelling argument for a `basename' function is that then M-x apropos will find it (and programmers often need it). Given that "basename" seems to have become the standard term for this functionality, we should take the simplest step that makes it findable via that term. If there's some other method that will accomplish the same thing, that's fine. -Karl