From: Tassilo Horn <tassilo@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Save on losing focus in Emacs
Date: Mon, 02 Jul 2007 11:41:50 +0200 [thread overview]
Message-ID: <87tzsn16sh.fsf@baldur.tsdh.de> (raw)
In-Reply-To: 873b07qith.fsf@lion.rapttech.com.au
Tim X <timx@nospam.dev.null> writes:
Hi Tim,
> However, two functions which may be useful are visible-frame-list and
> filtered-frame-list. To make use of these, I think you would dneed to
> use run-with -idle-timer. Yo could possibly define a function that
> looks to see if visible-frame-list returns anything. If it doesn't,
> then save any buffers with unsaved changes.
One problem might be that the timer has to run very often to save
immediately after losing focus.
> The problem with this is that if you have a big enough display, you
> may have both your emacs frame and some other application both
> 'visible', but focus is in the other application. In which case, this
> wouldn't work.
Hm, I use a tiling window manager, so most of the time all frames are
visible unless they're on another workspace.
> Alternatively, you might be able to use mouse-position to determine
> when the mouse is not in an emacs frame - the docs don't seem very
> clear on this and you may need to experiment to see what this function
> actually returns if it is called when the mouse focus is on another
> app. Its likely emacs will report the last frame the mouse was focused
> on.
I don't use a mouse frequently. Most of the time the pointer is in a
corner of the screen.
> P.S. I do find the OPs example a bit odd. I've used Emacs to develop with for
> years and often need to switch to a browser or some other app and I've never
> ever lost any work.
You got him wrong. Let's assume you edit a html-page in emacs and switch
to the browser to view you changes. But, damn, you forgot to save the
buffer, so you have to switch back to emacs, `C-x C-s' and switch back
to the browser and refresh again. If it had saved your changes
automatically when losing focus, that would not be needed.
Bye,
Tassilo
--
Chuck Norris sleeps with a pillow under his gun.
next prev parent reply other threads:[~2007-07-02 9:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-01 13:25 Save on losing focus in Emacs Sergey Pariev
2007-07-01 14:40 ` Emilio Lopes
2007-07-01 17:56 ` Sergey Pariev
2007-07-01 20:12 ` David Kastrup
2007-07-01 20:53 ` Tassilo Horn
2007-07-02 9:02 ` Tim X
2007-07-02 9:41 ` Tassilo Horn [this message]
2007-07-02 15:01 ` Why doesn't Emacs have a horizontal scroll bar? brianjiang
2007-07-02 15:58 ` Peter Dyballa
2007-07-02 16:25 ` Lennart Borgman (gmail)
2007-07-02 17:53 ` Peter Dyballa
[not found] ` <mailman.2967.1183393563.32220.help-gnu-emacs@gnu.org>
2007-07-02 16:49 ` Pascal Bourguignon
2007-07-03 20:51 ` Dieter Wilhelm
[not found] ` <mailman.3029.1183495887.32220.help-gnu-emacs@gnu.org>
2007-07-03 22:16 ` David Kastrup
2007-07-03 22:45 ` David Kastrup
2007-07-04 5:58 ` Dieter Wilhelm
[not found] ` <mailman.3044.1183528715.32220.help-gnu-emacs@gnu.org>
2007-07-04 17:16 ` David Kastrup
2007-07-05 6:37 ` Andreas Röhler
2007-07-05 7:11 ` Gordon Beaton
2007-07-05 7:56 ` Peter Dyballa
2007-07-02 19:04 ` Save on losing focus in Emacs Sergey Pariev
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=87tzsn16sh.fsf@baldur.tsdh.de \
--to=tassilo@member.fsf.org \
--cc=help-gnu-emacs@gnu.org \
/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.