From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kiwon Um Newsgroups: gmane.emacs.help Subject: Re: way to get the file name except the extension Date: Wed, 4 Feb 2009 22:45:09 -0800 (PST) Organization: http://groups.google.com Message-ID: <2e5d7a87-d118-4aac-bdb7-aaf6ab8aac14@w1g2000prm.googlegroups.com> 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 1233819652 8352 80.91.229.12 (5 Feb 2009 07:40:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 07:40:52 +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 08:42:04 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 1LUys7-0003mH-NN for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 08:42:03 +0100 Original-Received: from localhost ([127.0.0.1]:50254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUyqo-0005ci-RK for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 02:40:42 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!postnews.google.com!w1g2000prm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 37 Original-NNTP-Posting-Host: 163.152.71.53 Original-X-Trace: posting.google.com 1233816310 3798 127.0.0.1 (5 Feb 2009 06:45:10 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 5 Feb 2009 06:45:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w1g2000prm.googlegroups.com; posting-host=163.152.71.53; posting-account=6v9_LQoAAACIrmHTUxB_-iw-j364OtYr User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121300 SUSE/3.0.5-0.1 Firefox/3.0.5,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166601 comp.emacs:97746 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:61915 Archived-At: On 2=EC=9B=945=EC=9D=BC, =EC=98=A4=ED=9B=843=EC=8B=9C03=EB=B6=84, Xah Lee <= xah...@gmail.com> wrote: > 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 > =C2=A0http://xahlee.org/elisp/File-Names.html > > =C2=A0 Xah > =E2=88=91http://xahlee.org/ > > =E2=98=84 Thanks. It really works well. : (file-name-sans-extension (buffer-name)) P.s. Is there any good reference point of the manual to manipulate the time related strings, time, date, month, year, etc, like file name?