[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: writing a file to disc
From: |
rahed |
Subject: |
Re: writing a file to disc |
Date: |
Wed, 28 Nov 2007 18:32:38 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) |
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