|
From: | Kevin Rodgers |
Subject: | Re: writing a file to disc |
Date: | Wed, 28 Nov 2007 08:56:36 -0700 |
User-agent: | Thunderbird 1.5.0.13 (Macintosh/20070809) |
rahed wrote:
Hi, I have a file in a buffer and want to write it (C-x C-w) to disc under a different name. At the same time I want to leave in the buffer only the original one. Is there a some simple key binding to do it?
How about: (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) -- Kevin Rodgers Denver, Colorado, USA
[Prev in Thread] | Current Thread | [Next in Thread] |