all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* rename existing *shell* to *MYshell.txt.  Now, how making "C-x s" SAVE it?
@ 2008-06-29  5:18 David Combs
  2008-06-29  6:21 ` Barry Margolin
  0 siblings, 1 reply; 3+ messages in thread
From: David Combs @ 2008-06-29  5:18 UTC (permalink / raw)
  To: help-gnu-emacs

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?


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.


-----

Thanks!

David




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rename existing *shell* to *MYshell.txt.  Now, how making "C-x s" SAVE it?
  2008-06-29  5:18 rename existing *shell* to *MYshell.txt. Now, how making "C-x s" SAVE it? David Combs
@ 2008-06-29  6:21 ` Barry Margolin
  2008-06-29  8:23   ` Xah
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Margolin @ 2008-06-29  6:21 UTC (permalink / raw)
  To: help-gnu-emacs

In article <g475vf$13v$1@panix2.panix.com>,
 dkcombs@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, barmar@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 ***


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rename existing *shell* to *MYshell.txt. Now, how making "C-x s" SAVE it?
  2008-06-29  6:21 ` Barry Margolin
@ 2008-06-29  8:23   ` Xah
  0 siblings, 0 replies; 3+ messages in thread
From: Xah @ 2008-06-29  8:23 UTC (permalink / raw)
  To: help-gnu-emacs

David Combs wrote:
«So I have this existing *shell* that I've been working with,
...
Question: now, how to "bind" it to a disk file of the same name?
»

Barry Margolin
«
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.
»

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
∑ http://xahlee.org/

☄


On Jun 28, 11:21 pm, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article <g475vf$13...@panix2.panix.com>,
>  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 ***



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-29  8:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-29  5:18 rename existing *shell* to *MYshell.txt. Now, how making "C-x s" SAVE it? David Combs
2008-06-29  6:21 ` Barry Margolin
2008-06-29  8:23   ` Xah

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.