From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: way to get the file name except the extension Date: Wed, 4 Feb 2009 22:03:19 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1858f41f-2d50-47a5-8084-80d78a89e89b@e1g2000pra.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1233846574 29555 80.91.229.12 (5 Feb 2009 15:09:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 15:09:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 05 16:10:49 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LV5sL-0006YR-Ne for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 16:10:45 +0100 Original-Received: from localhost ([127.0.0.1]:59965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LV5r2-0001EA-K7 for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 10:09:24 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!a39g2000prl.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 28 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1233813799 10003 127.0.0.1 (5 Feb 2009 06:03:19 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 5 Feb 2009 06:03:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a39g2000prl.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166599 comp.emacs:97745 X-Mailman-Approved-At: Thu, 05 Feb 2009 10:01:29 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61924 Archived-At: On Feb 4, 9:09 pm, Kiwon Um wrote: > Hello. I'm a newbie to elisp. > > I'm wondering a built-in function or lisp codes to get the file name > except the extension from (buffer-name): > TestCode.cpp -> TestCode > > Any advise? :) easy. you want file-name-sans-extension and file-name-nondirectory. of langs i know that i've used extensively for processing file and dir names, namely Python and Perl, none comes as easy to use as the funcs provided in elisp. you can get file dir name, file name, file suffix, strip suffix, create dir including non existing parent dir, convert from full path to relative path, etc, all built in in elisp with a simple function. =E2=80=A2 File Names - GNU Emacs Lisp Reference Manual http://xahlee.org/elisp/File-Names.html Xah =E2=88=91 http://xahlee.org/ =E2=98=84