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

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

Re: How to determine (from Elisp) whether the Emacs frame has focus?


From: Marcin Borkowski
Subject: Re: How to determine (from Elisp) whether the Emacs frame has focus?
Date: Mon, 16 Nov 2015 17:58:54 +0100
User-agent: mu4e 0.9.15; emacs 25.0.50.1

On 2015-11-16, at 15:08, Nicolas Richard <youngfrog@members.fsf.org> wrote:

> Marcin Borkowski <mbork@mbork.pl> writes:
>> Of course. However, what I really mean is not exactly
>> (current-buffer), but "the buffer I'm working in now". This means that
>> if e.g. current-buffer is the minibuffer (as might be the case during
>> search or M-x or whatever), I would prefer /the buffer I'll get back
>> to when I finish doing whatever I'm doing in the minibuffer/,
>
> I think you want (window-buffer (minibuffer-selected-window))

Great, thanks!  And it even seems that I can use it whether I'm in
a minibuffer or not - since if I'm not, (minibuffer-selected-window)
will return nil, and (window-buffer nil) will return the buffer of the
selected window, which (assuming I'm editing and not manipulating
anything programmatically, which will be the case, since I want to
install this in a timer) should just return the current buffer.

Thans again,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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