From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Earl Newsgroups: gmane.emacs.help Subject: Re: What's your favourite *under_publicized* editing feature ofEmacs? Date: Wed, 23 Feb 2011 16:54:29 -0700 Organization: XMission http://xmission.com/ Message-ID: <874o7utih6.fsf@notengoamigos.org> References: <1578157c-17a0-41ea-9420-9330f68b10fe@glegroupsg2000goo.googlegroups.com> <87ei6zpbor.fsf@rapttech.com.au> <87tyfutv1p.fsf@notengoamigos.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1298508048 14223 80.91.229.12 (24 Feb 2011 00:40:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Feb 2011 00:40:48 +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 Feb 24 01:40:44 2011 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.69) (envelope-from ) id 1PsPG8-0006F6-5K for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Feb 2011 01:40:44 +0100 Original-Received: from localhost ([127.0.0.1]:36738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsPG7-0000XV-FY for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Feb 2011 19:40:43 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!xmission!nnrp.xmission!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp Original-Lines: 145 Original-NNTP-Posting-Host: 67.214.244.122 Original-X-Trace: news.xmission.com 1298505239 11575 67.214.244.122 (23 Feb 2011 23:53:59 GMT) Original-X-Complaints-To: abuse@xmission.com Original-NNTP-Posting-Date: Wed, 23 Feb 2011 23:53:59 +0000 (UTC) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAABGdBTUEAALGPC/xhBQAAAAFz UkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlw SFlzAAASmwAAEpsB4JJZDAAAAAl2cEFnAAAAMAAAADAAzu6MVwAAAaFJREFUSMe1VtuxxSAIzIz9 2Iyl2Aj1bBX0k5+LrwjGjJyPy2ROwtGNBJbVCwwwy1UNoOL3f+SBxkj15Lr4NsboN24DWMZxYQNA TjGmjC1gswJiqBbpDeANYMwXBFyAFB5L7ADMBcoSDgAFBSDHR2tA8ABMSB4AawB76pAnILsKx2lm 1VfpgUi3kxrySylRHdmQj40Jva2/jl8EY3Twv/phhsC9nIQR0hnAOUptYsL3RxvAk+YIH2AWsvTH GYBgKn8GaPYm5jNANaCQ8WfAzyH9x0crFfGl9X4QVdg8gEqN2KjBHi6V/iBq6iyAxTqd+Yvupwai VwM9LZkxQ6otihmS6H+mHlK5URwi0UQgWxHoxS5JagBSed7IzJRCallS2pg2QsamcGUFNSHgLZUv augJIUualv1Bv6+yVat1oeMq92s/mBBWQJH7dQX7CnpvWWs/4CazpHlB2RR1BFSzNGdIaTbbLil8 U76BKKU0GztapXP3C78bNYQ6MTQybY8OkIaITf9HPzyHkXE4YXs4mf5VDz+jAepj3RTQ3Ubv0SPy 9AcCrfKh0TBgvgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMS0wMS0wM1QxMDo1MDo1NC0wNzowMIgC s0IAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTAtMDQtMDVUMTM6MjQ6NDgtMDY6MDCtwF/YAAAAAElF TkSuQmCC User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:jnlfwdguEc1RuYyjbndiuudpXbA= Original-Xref: usenet.stanford.edu gnu.emacs.help:185259 comp.emacs:101097 comp.lang.lisp:299885 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:79419 Archived-At: On Wed, Feb 23 2011, Cthun wrote: > On 23/02/2011 2:22 PM, Jason Earl wrote: >> On Wed, Feb 23 2011, Cthun wrote: >>> This runs into trouble if you do something drastic you later want to >>> undo. >> >> Actually, Emacs warns you before it makes drastic changes to an autosave >> file. This at least gives you the opportunity to do something about it. > > Oh, wonderful. > > Do you know what I'd do if I was in the middle of typing some stuff > into a text editor after just having deleted a bunch of stuff and then > suddenly a box popped up saying something about autosaving and drastic > changes and yadda yadda yadda but I didn't have time to read it before > one of my enter keypresses (intended for the actual document I was > typing into when the box interrupted me) triggers one of the dialog's > buttons (which?) and it disappears again (and does who knows what to > my hard drive?). > > I'd delete that editor and go get a new one, that's what. :) So would I, but, of course, that's not what Emacs does. It just turns off auto-save and warns you in the mini-buffer. Here's the message: Buffer foo.txt has shrunk a lot; auto save disabled in that buffer until next real save Emacs' auto-save is triggered by default on idle, so it should never happen while you are typing. However, even if it does, it is not going to get in your way. And, like all things Emacs, if you do not like the default you can change it easily. >> The solution, of course, is to manually save *before* the fork. > > Yes, but the reality is that people will sometimes forget to do so, or > in that order. It would seem to me that you would basically have to be the sort of person that *relies* on the auto-save feature to do things in any other order. If I am manually going fork a file then it seems like I would want to make sure that I forked from a known good spot. I used to work on a help desk and my experience says that most people don't even know that their editor has an auto-save (or how to get the auto-save files it creates) until something tragic happens. They certainly don't expect their editor to magically save the correct state of a file that they didn't manually save. >> I real life I don't think that this is much of a problem, especially >> with Emacs which has infinite undo > > Infinite undo? On what planet? When I experimented with it, back in > college, I found the undo to just toggle undo/redo like Windows > Notepad's. (I ended up experimenting also with LSD and mescaline and > decided on none of the above.) I thought it was infinite undo, but according to the manual the default limit is 12,000,000 bytes. Needless to say, I have never actually ran out of undo information. >> What's more, Emacs is flexible enough that you can easily set up >> whatever sort of auto-save functionality that you think you want. > > If you're a computer programmer with time to spare reprogramming the > editor instead of actually doing your job, perhaps. I'm just saying that, if you care about auto-save as much as you seem to care about auto-save, that Emacs gives you options that other tools do not. Personally, other than changing where Emacs saves its auto-save files I just stick with the defaults. I personally think that Emacs' superior auto-save features would be a strange reason for choosing Emacs, but who am I to judge. >> Emacs can do that. It has an auto-save-hook that you can add code to > > and ten million ways to subtly or drastically-but-irrecoverably fuck > things up if you make some subtle mistake doing so, no doubt. > > Thanks, but no thanks. Obviously any time you are writing code you have the opportunity to code something that doesn't work. On the other hand, computers are far less likely to "forget" a step than you or I are. Automation is generally a good thing. >> Another alternative, of course, is to simply save the file whenever >> you feel you have something worth saving. > > Well, there you go, then. That's exactly what I was originally > advocating! So, you've come around to agreeing with me at last. > > Ah, progress ... >>> Sequences of numbered files used to risk filling up the filesystem, >>> too, but not with text files in this day and age. >> >> On the bright side Emacs can be made to do whatever makes you the >> happiest. > > Can it be made to cut itself, scream like a thing tortured, and then > die? ;) That seems like an odd thing to want from a text editor, but yes, you can teach emacs to do that. I even tested it. --8<---------------cut here---------------start------------->8--- (defun die! () (save-buffers-kill-emacs t)) (defun scream () (message "Arrgggh!")) (defun cut-yourself () (interactive) (message "I am bleeding") (sleep-for 5) (scream) (sleep-for 5) (die!)) --8<---------------cut here---------------end--------------->8--- >> Very few other programs have anywhere near that sort of flexibility. > > If I want that much flexibility I'll look at that Russian mail-order > catalog. There *is* something to be said for structure and stability > in fundamental, daily-use tools. And standards-adherence. Emacs has been adhering to the same standards almost as long as I have been alive. >> For most folks, however, the defaults are what they want. > > Wait a minute. I thought you just said that the Emacs defaults are > what most people want. But that's clearly impossible, so I can only > presume that your post got garbled in transit. Care to repost whatever > you'd said at this point? Emacs' defaults for auto-save are what most people want.