From: ken <gebser@speakeasy.net>
Subject: Re: How to insert buffer name into buffer
Date: Sun, 6 Nov 2005 10:47:12 -0500 [thread overview]
Message-ID: <20051106104712.441eb625@dellap> (raw)
In-Reply-To: <pan.2005.11.06.15.40.07.527534@i.hate.spam>
This function should get you part of the way there:
(defun file-name-into-kill-buffer ()
"Put path/filename of current buffer onto kill-ring so to paste
into an X application."
(interactive)
(let ((str (buffer-file-name)))
(and str
(kill-new str)
(message "Copied %s to kill ring" str)))
)
On Sun, 06 Nov 2005 09:40:08 -0600
bturnip <bturnip@i.hate.spam> wrote:
> I am writing a little function that fills out some of my code
> documentation for me. What I want to do is take the buffer name and
> insert it into the comment block. So if I open a new buffer called
> world_domination.c and then call my function, the result looks
> something like this:
>
> /* * * * * * * * * * * * * * * * * * * * *
> * File name: world_domination.c
> * Author: bturnip
> * File date: 11/11/2011
> .
> .
> .
> etc
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
--
A lot of us are working harder than we want, at things we don't like to
do. Why? ...In order to afford the sort of existence we don't care to
live.
-- Bradford Angier
prev parent reply other threads:[~2005-11-06 15:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-06 15:40 How to insert buffer name into buffer bturnip
2005-11-06 15:34 ` Bastien
2005-11-06 15:45 ` bturnip
2005-11-06 16:05 ` Harald Hanche-Olsen
2005-11-06 16:43 ` François Fleuret
2005-11-06 15:47 ` ken [this message]
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=20051106104712.441eb625@dellap \
--to=gebser@speakeasy.net \
/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).