From: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
To: Gradivus <mondifero@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: insert name of current file
Date: Wed, 26 Jan 2011 00:09:42 +0200 [thread overview]
Message-ID: <20110125220942.50B8F39C207@djcbsoftware.nl> (raw)
In-Reply-To: <AANLkTimdhrV-LssjDyV0rKXXDR0_+gYxxTKi6UMTjWvh@mail.gmail.com>
>>>>> On Tue, 25 Jan 2011 16:59:03 -0500, Gradivus wrote:
> [1 <text/plain; ISO-8859-1 (7bit)>]
> Hi,
> Sorry I'm a noob.
> I wonder if someone knows how I can insert the current file's name
> (i.e., the name of the file I'm editing) at the cursor, and without the full
> path.
M-: (insert-string (file-name-nondirectory (buffer-file-name))) RET
If you need it more often, you can of course write a function for it.
Best wishes,
Dirk.
--
Dirk-Jan C. Binnema Helsinki, Finland
e:djcb@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
next prev parent reply other threads:[~2011-01-25 22:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 21:59 insert name of current file Gradivus
2011-01-25 22:09 ` Dirk-Jan C. Binnema [this message]
2011-01-25 22:10 ` Deniz Dogan
2011-01-25 22:33 ` Oleksandr Gavenko
2011-01-26 3:41 ` Steven W. Orr
[not found] <mailman.7.1295992748.30245.help-gnu-emacs@gnu.org>
2011-01-25 23:15 ` Tim X
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=20110125220942.50B8F39C207@djcbsoftware.nl \
--to=djcb@djcbsoftware.nl \
--cc=help-gnu-emacs@gnu.org \
--cc=mondifero@gmail.com \
/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).