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

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

Re: Save on losing focus in Emacs


From: Tassilo Horn
Subject: Re: Save on losing focus in Emacs
Date: Sun, 01 Jul 2007 22:53:53 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

David Kastrup <dak@gnu.org> writes:

Hi David,

> Try advising the following function, 

[...]

> handle-switch-frame is an interactive built-in function in `C source code'.
> It is bound to <switch-frame>.
> (handle-switch-frame EVENT)

I tried it, but it only works if I switch from one emacs frame to
another emacs frame.

,----[ ~/.emacs ]
| (defadvice handle-switch-frame (before save-some-buffers-advice activate)
|   "Save all file buffers if emacs looses focus."
|   (save-some-buffers t))
`----

The OP wants emacs to save all files when switching to other
applications like a browser (that's not an emacs browser in another
frame).

Any ideas?

Bye,
Tassilo
-- 
No person,  no idea, and no  religion deserves to be  illegal to insult,
not even the Church of Emacs. (Richard M. Stallman)


reply via email to

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