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: Thu, 29 Nov 2007 08:59:27 +0100 Message-ID: References: <21c50cdb-4ee0-4796-9cfb-cca2adc89b9d@e23g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196323255 29613 80.91.229.12 (29 Nov 2007 08:00:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Nov 2007 08:00:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 29 09:01:02 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 1IxeKN-0004tE-7K for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Nov 2007 09:00:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxeK7-0002A3-P0 for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Nov 2007 03:00:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IxeJo-00029p-G2 for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 03:00:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IxeJm-00029G-RB for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 03:00:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxeJm-00029D-Ld for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 03:00:18 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IxeJk-0006Fl-F9 for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 03:00:18 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IxeJg-0007id-OI for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 03:00:12 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IxeJF-0001hR-Un for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 07:59:45 +0000 Original-Received: from 80.188.171.52 ([80.188.171.52]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Nov 2007 07:59:45 +0000 Original-Received: from raherh by 80.188.171.52 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Nov 2007 07:59:45 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 16 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 80.188.171.52 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) Cancel-Lock: sha1:2gz7dkAdgHFfk5CftsB2GJuNipE= X-detected-kernel: by mx20.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:49676 Archived-At: Scott Frazer writes: > My newsreader was acting funny, so sorry if this is a duplicate. > > (defun clone-file (filename) > "Clone the current buffer and write it into FILENAME." > (interactive "FClone to file: ") > (let ((buffer-file-name nil)) > (kill-buffer (with-current-buffer (clone-buffer) > (write-file filename (interactive-p)) > (current-buffer))))) Thank you (and others). -- Radek