all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jude DaShiell <jdashiel@shellworld.net>
To: dont.spam.earl@gmail.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: Auto-saved files unexpectedly deleted
Date: Sun, 25 May 2014 10:17:01 -0400 (EDT)	[thread overview]
Message-ID: <alpine.BSF.2.01.1405251014020.53361@freire1.furyyjbeyq.arg> (raw)
In-Reply-To: <e76ebf38-131a-41b7-a08b-e0766b92960f@googlegroups.com>

man script for some interesting reading.  Emacs could run that for you 
inside one of its shells and you catch everything that happens and can 
if you like append to existing files.  Afterwards, it may be necessary 
to clean up the output file.

On Sun, 18 May 2014, dont.spam.earl@gmail.com wrote:

> On Thursday, May 15, 2014 10:32:36 PM UTC-7, Kevin Rodgers wrote:
> > On 5/15/14 11:40 AM, dont.spam.earl@gmail.com wrote:
> > 
> > > On Thursday, May 15, 2014 2:55:21 AM UTC-7, Michael Heerdegen wrote:
> > 
> > >> dont.spam.earl@gmail.com writes:
> > 
> > >>> I'd like to save "transcripts" of my Shell and other comint sessions
> > 
> > >>> with all I/O, not just the command history. I've created a "comint
> > 
> > >>> transcript" major-mode by adapting auto-saving but I'm running into a
> > 
> > >>> problem.
> > 
> > >>
> > 
> > >> I think it would be better not to hack into auto-save-mode.  Why don't
> > 
> > >> you just save the buffer contents to your own file, e.g. using
> > 
> > >> `write-region'?
> > 
> > >
> > 
> > > Yes, I'll admit that occurred to me ;) ...especially when I saw that it's part of files.el and not factored out.
> > 
> > >
> > 
> > > I'm reluctant though because I want to do auto-saving of these buffers and I don't want to reimplement and maintain a lot of the auto-save functionality.
> > 
> > 
> > 
> > I'd start with something minimal, like:
> > 
> > 
> > 
> > (defun set-comint-buffer-file-name ()
> > 
> >    "Set `buffer-file-name' so that input and output are saved.
> > 
> > Also set `buffer-offer-save', but assume that `auto-save-default' is non-nil."
> > 
> >    (setq buffer-file-name
> > 
> > 	(format "~/.emacs_comint_%d.txt"
> > 
> > 		;; TO DO: handle `network' and `serial' process-type, in
> > 
> > 		;; addition to `real'.
> > 
> > 		(process-id (get-buffer-process (current-buffer)))))
> > 
> >    (setq buffer-offer-save t))		; just in case
> > 
> > 
> > 
> > (add-hook 'comint-exec-hook 'set-comint-buffer-file-name)
> > 
> > 
> > 
> > -- 
> > 
> > Kevin Rodgers
> > 
> > Denver, Colorado, USA
> 
> Yes, that's a good idea to use 'comint-exec-hook. I hadn't thought of that. Thanks!
> 
> 

jude <jdashiel@shellworld.net>




      reply	other threads:[~2014-05-25 14:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15  5:29 Auto-saved files unexpectedly deleted dont.spam.earl
2014-05-15  9:55 ` Michael Heerdegen
     [not found] ` <mailman.1389.1400147758.1147.help-gnu-emacs@gnu.org>
2014-05-15 17:40   ` dont.spam.earl
2014-05-16  5:32     ` Kevin Rodgers
     [not found]     ` <mailman.1440.1400218387.1147.help-gnu-emacs@gnu.org>
2014-05-18 17:03       ` dont.spam.earl
2014-05-25 14:17         ` Jude DaShiell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.BSF.2.01.1405251014020.53361@freire1.furyyjbeyq.arg \
    --to=jdashiel@shellworld.net \
    --cc=dont.spam.earl@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.