"The Linux Gazette...making Linux just a little more fun!"


(?) The Answer Guy (!)


By James T. Dennis, [email protected]
LinuxCare, http://www.linuxcare.com/


(!) When "Quit Confirm" Dialogs are NOT Enough...

From Bryan Henderson on Tue, 21 Mar 2000

In the moral to your sad tale of discarding the article you just wrote, you advise emacs users to use autosave. Actually, emacs users have better protection available, by default. The normal quit command always prompts you if you have changes you haven't saved. Even the command for discarding changes prompts you. There may be a command to discard changes and exit without prompting, but I doubt anyone would have it installed on a key.

Autosave is nice for protection against system failures. But I don't like it precisely because it takes away my ability to change my mind and throw away my edits, and in the event of a system failure, it can be hard to pick up from where the last autosave randomly happened. I prefer just to hit 'save' every time I reach a reasonable commit point. It's an easy habit to forge.

Now if I could just find a way to keep from rm'ing a file moments after I spent an hour creating it... I've done that a few times.

-- Bryan Henderson

(!) Ahhh... but you miss my whole point. I did NOT "quit" out of xemacs. I (accidentally) issued a 'screen' command to send a SIGQUIT (die now with a core dump!) signal to all of its processes.
xemacs never had a chance to confirm (or refute) my wishes in the matter.
As for having the choice to revert to earlier versions, I've used the emacs "version-control" option for years. It creates backup files of the form foo.~X~ (where X is a number). I occasionally run a skulker to find old *.~*~ files, look them over and pass them onto to an "xargs rm" command. You can set that using
(setq version-control 't)
In your init.elc (or .emacs) file. (I use a common emacs method of having a simple .emacs file like:
(load (expand-file-name "~/.elisp/init.elc"))
and I maintain a ~/.elisp/init.el file, which I byte-compile into a .elc when I change it. That's an old trick.
Anyway, I've now added:
(setq auto-save-default 't)
(setq auto-save-timeout 600)
(setq auto-save-interval 500)
... which sets the auto-save flag to on, saves if I leave my keyboard for ten minutes (actually depends on buffer size, but I tend not to spend too much time editing 200K and larger buffers) and sets the editor to save every 500 keystrokes (which is about every quarter page.
That should keep me out of too much trouble.

(?) March Linux Gazette blurb

Answered by Bryan Henderson on Tue, 21 Mar 2000

Ahhh... but you miss my whole point. I did NOT "quit" out of xemacs. I (accidentally) issued a 'screen' command

(!) Yeah, I did. I didn't (and still don't) know what 'screen' is. Thanks for the info.

[ screen is an application designed to allow you to have multiple screens available when you're logged into one console. When I use an ssh session, it allows me to maintain much the same habits as I normally do on virtual consoles, by switching amid the several possible screens.

Jim's favorite use for it is the keyboard driven cut and paste buffer. It also can be used to maintain state while you leave one terminal (say, your desktop) and return from another one (say, across an ssh link from your other office).

-- Heather ]

And I am also grateful for the tip on running a compiled init file. I've been struggling recently with whether to use an old Emacs or a new one, considering that the new one is painfully slow, especially to start up. compiling the init file could make a noticeable difference.
-- Bryan Henderson


Copyright © 2000, James T. Dennis
Published in The Linux Gazette Issue 52 April 2000
HTML transformation by Heather Stern of Tuxtops, Inc., http://www.tuxtops.com/


[ Answer Guy Current Index ] [ Index of Past Answers ] greetings 1 2 3 4
5 6 7 8 9
10 11 12 13 14 15 16 17
18 19 20 21 22 23 24


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Linux Gazette FAQ ] [ Next Section ]