all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Aaron Maxwell <amax@redsymbol.net>
Subject: Re: undo-kill-buffer
Date: Tue, 24 Oct 2006 09:46:58 -0700	[thread overview]
Message-ID: <200610240946.58939.amax@redsymbol.net> (raw)
In-Reply-To: <58920.128.165.123.18.1161706274.squirrel@webmail.lanl.gov>

Hi Davis,

There are two levels to what I'm envisioning.

First is the simple case when the killed buffer corresponds to a file with no 
unsaved changes.  In that case, undo-kill-buffer would have the same effect 
as doing a find-file on that file again.  Mainly the advantage is 
convenience; M-x undo-kill-buffer will be approximately as fast as navigating 
the filesystem to locate the file.  Much more importantly, I do not have to 
think; I can re-get that file (buffer) without interrupting concentration.  
This becomes more important when working with many files in several 
directories at once.

Second is when killing a buffer that has not been associated with a file, or a 
buffer that has unsaved changes.  This would have to be handled differently 
from the above.  The buffer contents would have to be cached somehow.  I'd 
probably have this be (de)activateable via a variable setting; if 
deactivated, undo-kill-buffer would get the last saved version, xor fail.

Thanks,
Aaron

On Tuesday 24 October 2006 09:11, Stuart D. Herring wrote:
> > Hi, Does anyone know of an existing emacs function that will undo a
> > kill-buffer command?  So like, if the user issues C-x k and then suddenly
> > decides it was a mistake, they could just M-x undo-kill-buffer to get it
> > back.
> >
> > I have started coding this for myself.  If it's genuinely new and I'm not
> > duplicating effort, then I will polish it and contribute to the main
> > codebase.
> >
> > Thanks,
> > Aaron
>
> The only case where killing a buffer cannot be undone with such commands
> as `find-file' or `dired' is when the buffer contained unsaved changes or
> was not associated with an external repository (file, directory, IRC
> channel, etc.), like `*scratch*'.  How do you propose to bring such
> buffers (and their changes, if any) back without causing `kill-buffer' to
> not, in fact, kill buffers?
>
> If you are doing that (interfering with `kill-buffer'), what you really
> want is probably a "Trash Can" for buffers.  Then you want to have a
> "mark-buffer-for-kill" command (which toggles the buffer's state, and
> buries it if it's being marked), and then a "kill-marked-buffers" command
> to actually destroy them.  Of course, this is already available via the
> buffer list (`list-buffers')...
>
> Davis

  reply	other threads:[~2006-10-24 16:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-24 15:56 undo-kill-buffer Aaron Maxwell
2006-10-24 16:11 ` undo-kill-buffer Stuart D. Herring
2006-10-24 16:46   ` Aaron Maxwell [this message]
2006-10-24 16:36 ` undo-kill-buffer Andreas Schwab
2006-10-24 23:43 ` undo-kill-buffer Miles Bader
2006-10-24 23:51   ` undo-kill-buffer Aaron Maxwell
2006-10-25  0:14     ` undo-kill-buffer Stefan Monnier
2006-10-25  0:22       ` undo-kill-buffer Aaron Maxwell
2006-10-25  0:32         ` undo-kill-buffer Stefan Monnier
2006-10-25 14:37         ` undo-kill-buffer Stuart D. Herring
2006-10-25 16:05           ` undo-kill-buffer Drew Adams
2006-10-25 22:43           ` undo-kill-buffer Miles Bader
2006-10-25 23:02             ` undo-kill-buffer Edward O'Connor
2006-10-25 23:50               ` undo-kill-buffer Miles Bader
2006-10-26  8:53                 ` undo-kill-buffer Richard Stallman
2006-10-25 23:17             ` undo-kill-buffer David Kastrup
2006-10-25 23:46               ` undo-kill-buffer Miles Bader
2006-10-25  0:36       ` undo-kill-buffer Miles Bader
2006-10-25  0:24     ` undo-kill-buffer Miles Bader
2006-10-25  1:11       ` undo-kill-buffer Aaron Maxwell
2006-10-25  0:41 ` undo-kill-buffer Drew Adams

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=200610240946.58939.amax@redsymbol.net \
    --to=amax@redsymbol.net \
    /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.