help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wait for a specific command call


From: Matthias
Subject: Re: Wait for a specific command call
Date: 21 Nov 2004 08:35:37 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Kai Grossjohann <kai@emptydomain.de> wrote:

> (...) Why do you want to do this?

I have (thanks to people posting in this newsgroup) a command (called
`list-desktop-buffers') which displays names of buffers that will be
saved by `desktop-save'. The list is displayed using `list-buffers',
so that one can delete, save, etc any of those buffers.

Now I want this list to be displayed when exiting emacs; the editor
should also wait for a confirmation coming from the user.

So, I need to add a modified version of my command to the list
`kill-emacs-query-functions'. E.g. the following:

(defun desktop-save-query-function ()
  (list-desktop-buffers)
  (yes-or-no-p "Reopen displayed buffers in next session? "))

(add-to-list 'kill-emacs-query-functions 'desktop-save-query-function)

But there I lost the hability to edit the list of buffers.

In other words, my initial question was: how to make
desktop-save-query-function select the *Buffer List* buffer and exit
(returning true) when the user quit its window (by pressing the `q'
key or using the mouse)?
-- 
Matthias


reply via email to

[Prev in Thread] Current Thread [Next in Thread]