all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xah Lee <xahlee@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:03:19 -0800 (PST)	[thread overview]
Message-ID: <bb880f36-05e4-487d-a657-89c8128bdc7a@a39g2000prl.googlegroups.com> (raw)
In-Reply-To: 1858f41f-2d50-47a5-8084-80d78a89e89b@e1g2000pra.googlegroups.com

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/

  reply	other threads:[~2009-02-05  6:03 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 [this message]
2009-02-05  6:45   ` Kiwon Um
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb880f36-05e4-487d-a657-89c8128bdc7a@a39g2000prl.googlegroups.com \
    --to=xahlee@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.