From: Kiwon Um <um.kiwon@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: way to get the file name except the extension
Date: Wed, 4 Feb 2009 22:45:09 -0800 (PST) [thread overview]
Message-ID: <2e5d7a87-d118-4aac-bdb7-aaf6ab8aac14@w1g2000prm.googlegroups.com> (raw)
In-Reply-To: bb880f36-05e4-487d-a657-89c8128bdc7a@a39g2000prl.googlegroups.com
On 2월5일, 오후3시03분, Xah Lee <xah...@gmail.com> wrote:
> On Feb 4, 9:09 pm, Kiwon Um <um.ki...@gmail.com> 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.
>
> • File Names - GNU Emacs Lisp Reference Manual
> http://xahlee.org/elisp/File-Names.html
>
> Xah
> ∑http://xahlee.org/
>
> ☄
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?
next prev parent reply other threads:[~2009-02-05 6:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 5:09 way to get the file name except the extension Kiwon Um
2009-02-05 6:03 ` Xah Lee
2009-02-05 6:45 ` Kiwon Um [this message]
2009-02-05 9:11 ` Time-related functions [Was: way to get the file name except the extension] Juanma Bellón
2009-02-05 7:27 ` way to get the file name except the extension Johan Andersson
2009-02-05 8:21 ` Sebastian Tennant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e5d7a87-d118-4aac-bdb7-aaf6ab8aac14@w1g2000prm.googlegroups.com \
--to=um.kiwon@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).