From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: rename existing *shell* to *MYshell.txt. Now, how making "C-x s" SAVE it? Date: Sun, 29 Jun 2008 01:23:00 -0700 (PDT) Organization: http://groups.google.com Message-ID: <90a2e4c3-a904-41e6-a834-b0f56810f4e2@c19g2000prf.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1214728883 11235 80.91.229.12 (29 Jun 2008 08:41:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Jun 2008 08:41:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 29 10:42:08 2008 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 1KCsU2-0000C0-KV for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Jun 2008 10:42:06 +0200 Original-Received: from localhost ([127.0.0.1]:56117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KCsTC-0001QX-Fl for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Jun 2008 04:41:14 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!c19g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 85 Original-NNTP-Posting-Host: 24.6.97.120 Original-X-Trace: posting.google.com 1214727780 2568 127.0.0.1 (29 Jun 2008 08:23:00 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 29 Jun 2008 08:23:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c19g2000prf.googlegroups.com; posting-host=24.6.97.120; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:159775 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:55129 Archived-At: David Combs wrote: =C2=ABSo I have this existing *shell* that I've been working with, =2E.. Question: now, how to "bind" it to a disk file of the same name? =C2=BB Barry Margolin =C2=AB C-x C-w MYshell.txt RET I don't know of a way to make it automatically update the file. But once you associate it with a file with C-x C-w, you can then use C-x C- s to update the file manually. =C2=BB adding to Barry Margolin's comments... you can use a timer that performs a action periodically. So, say every 10 min, your shell will be saved to disk. for example, i have the following: (run-with-timer 600 600 'desktop-save "~/") which record opened files every 10 min. So in case of system crash, i still know which files are left open in previous session (that i was working on or still needs to work on) to write your function to save would be pretty easy... your function will just call save-buffer... depending how robust or elaborate you want, you may need to check whether you have that particularly named buffer... and what file you want it to save to. etc and if the buffer doesn't exist, kill the timer. the basic functions you might need are: (buffer-name) (buffer-file-name) (write-file ...) or (save-buffer) (kill-buffer ...) Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Jun 28, 11:21 pm, Barry Margolin wrote: > In article , > dkco...@panix.com (David Combs) wrote: > > > So I have this existing *shell* that I've been working with, > > and it belatedly turns out that I want it to "also live > > as a disk file" -- to be a physical record of what I've > > been doing (in *that* shell). > > > So I M-x rename-buffer it to MYshell.txt. > > > Question: now, how to "bind" it to a disk file of the > > same name? > > You don't need to rename it, just write it to a file: > > C-x C-w MYshell.txt RET > > > > > Or if not that ( > > > bind implying that by some magic that > > whatever chars appear in *shell* (Well, MYshell.txt buffer) > > automatically appears in the disk file too, maybe > > > ), then where all I need to do is C-x s and the disk-file > > gets updated. > > I don't know of a way to make it automatically update the file. But > once you associate it with a file with C-x C-w, you can then use C-x C-s > to update the file manually. > > -- > Barry Margolin, bar...@alum.mit.edu > Arlington, MA > *** PLEASE post questions in newsgroups, not directly to me *** > *** PLEASE don't copy me on replies, I'll read them in the group ***