all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: rahed <raherh@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: writing a file to disc
Date: Wed, 28 Nov 2007 18:32:38 +0000	[thread overview]
Message-ID: <uoddei5kp.fsf@gmail.com> (raw)
In-Reply-To: fik33j$l3g$1@ger.gmane.org

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:

> (defun clone-file (filename)
>   "Clone the current buffer and write the new buffer into file FILENAME."
>   (interactive "FWrite file: ")
>   (let* ((buffer-file-name nil))
>     (with-current-buffer (clone-buffer nil (interactive-p))
>       (write-file filename (interactive-p)))))
>
> (global-set-key "\C-xW" 'clone-file)

It makes two buffers, a new one and the original. I don't know
lisp, could you possibly trim it so that only the original occupy the
buffer?

Many thanks.

-- 
Radek

  reply	other threads:[~2007-11-28 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28 13:17 writing a file to disc rahed
2007-11-28 14:30 ` Peter Dyballa
2007-11-28 15:56 ` Kevin Rodgers
2007-11-28 18:32   ` rahed [this message]
     [not found]   ` <mailman.4266.1196275142.18990.help-gnu-emacs@gnu.org>
2007-11-28 21:02     ` Scott Frazer
2007-11-29  7:59       ` rahed
     [not found] ` <mailman.4255.1196265534.18990.help-gnu-emacs@gnu.org>
2007-11-29  1:01   ` Johan Bockgård
     [not found] <mailman.4235.1196255887.18990.help-gnu-emacs@gnu.org>
2007-11-30 17:02 ` Stefan Monnier

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=uoddei5kp.fsf@gmail.com \
    --to=raherh@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.