From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rahed Newsgroups: gmane.emacs.help Subject: Re: writing a file to disc Date: Wed, 28 Nov 2007 18:32:38 +0000 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196275175 25884 80.91.229.12 (28 Nov 2007 18:39:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Nov 2007 18:39:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 28 19:39:44 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IxRop-0005X9-VZ for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2007 19:39:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxRoa-0004IQ-FL for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2007 13:39:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IxRoK-0004EV-5T for help-gnu-emacs@gnu.org; Wed, 28 Nov 2007 13:39:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IxRoF-00044s-E8 for help-gnu-emacs@gnu.org; Wed, 28 Nov 2007 13:38:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxRoF-00044S-8j for help-gnu-emacs@gnu.org; Wed, 28 Nov 2007 13:38:55 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IxRoE-0000tF-Ph for help-gnu-emacs@gnu.org; Wed, 28 Nov 2007 13:38:55 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IxRmH-0003Bp-L4 for help-gnu-emacs@gnu.org; Wed, 28 Nov 2007 18:36:55 +0000 Original-Received: from 88.103.41.197 ([88.103.41.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Nov 2007 18:36:53 +0000 Original-Received: from raherh by 88.103.41.197 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Nov 2007 18:36:53 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 88.103.41.197 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) Cancel-Lock: sha1:1AGUqog2ulF/TbHKcBAyj1bFJLQ= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49653 Archived-At: Kevin Rodgers 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