Questions tagged [focus]

40 questions
19
votes
1 answer

How to know my buffer's visible/focused status?

I'm writing an extension that talks to an outside process, so it is a given to lower the amount of 'hey whats up' requests when my buffer isn't focused. So, what is the best way to recognize: When my buffer is visible and focused When my buffer is…
Łukasz Gruner
  • 1,008
  • 8
  • 16
13
votes
2 answers

Change highlight color when window isn't in focus?

I'm using hl-mode as a minor mode for deft. How do I make the highlighted line change color (e.g. to gray) when the deft window isn't the current window, and then back to the default highlight color when the deft window becomes the current window…
shankar2k
  • 173
  • 1
  • 6
12
votes
2 answers

Make Buffer List take focus?

How can I make it so that when I press C-xC-b to access the Buffer List that that buffer automatically takes focus instead of having to switch to it manually with C-xo? I can't find a variable that customizes this.
Chris
  • 699
  • 3
  • 13
10
votes
2 answers

Automatically switch focus to new window

Is there a way to automatically switch focus to any new windows? For example, if I C-h f some-function, that creates a new window. But the focus remains where I was, so when I'm done reading and hit q, I just type a q in whatever buffer I was in…
Alex
  • 1,028
  • 5
  • 20
8
votes
2 answers

Change focus to *Help* buffer after running describe-mode

When I type C-h m for describe-mode the frame splits into two windows with the current buffer on top and the *Help* buffer below. But the focus stays in the current buffer, so I usually have to type C-x o to move focus to the *Help* buffer, and then…
Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51
7
votes
3 answers

Focus-hook: attenuate colours when losing focus

How can I use the focus hooks to attenuate all colours in visible buffers when the Emacs frame loses focus? I tried using the following code: (set-frame-parameter (selected-frame) 'alpha '(100 80)) To make the frame become translucent, but it would…
user2005
7
votes
1 answer

Get a reference for the current frame

frame-list returns a list of references for live Emacs frames. How does one get a reference for the current Emacs frame? I have been unable to find an appropriate function. Current could be either (1) the Emacs frame that has focus (one or zero…
ebpa
  • 7,319
  • 26
  • 53
6
votes
2 answers

Show the matching line in the center of the screen instead of the bottom when opening a grep result

When I grep something inside emacs and click to open one of the matching files. The matching line is always displayed at the bottom of the screen, and I have to scroll it up for a better view. Is it possible to focus the matching line at the center…
5
votes
1 answer

Emacs Orgmode: hiding other items in the tree

I have an org file, that looks like: * Item 1 ** Subitem 1.1 * Item 2 ** Subitem 2.1 This text from Subitem 2.1 ** Subitem 2.2 I am editing text under Subitem 2.1. Is there a way to hide everything from the screen, except Subitem 2.1, so ideally…
schatten
  • 261
  • 1
  • 8
5
votes
2 answers

Open new emacs frame that steals focus from other apps?

I have this notification system in emacs that opens a new buffer with a reminder and relevant info at specified times. However, if I am using my browser I can't see it. Therefore I am wondering whether it is possible to open a new emacs frame that…
The Unfun Cat
  • 2,393
  • 16
  • 32
5
votes
1 answer

How do I focus the Man mode window when it is displayed?

When I open a man page (e.g. M-x man cat) I would like to automatically move my cursor onto the man page. I already know how to achieve this behavior for *Help* and *Apropos*, and I want to get the same behavior for Man mode too. I have tried…
Flux
  • 583
  • 2
  • 16
5
votes
2 answers

How can I prevent Magit-status command from grabbing the frame focus?

when executing magit-status and quickly focus out emacs, after the magit buffer pops up, emacs grabs the focus back. This is quite inconvenient. Is there a way to prevent that focus changing? The way to reproduce this issue: emacs -Q and load…
Amos
  • 456
  • 3
  • 11
4
votes
5 answers

How to close help buffer without moving to it?

I often use Emacs' help buffers, via e.g. C-h k. Buffer *Help* is displayed in another window, and that window is not selected. In order to close the *Help* buffer, I need to switch windows via C-x o and then press q to close the *Help* buffer. The…
Parker
  • 43
  • 3
3
votes
1 answer

Set focus to minibuffer window

Some commands use Emacs' minibuffer to prompt for input. I occasionally do something which moves the focus to another window and away from the minibuffer. In these cases I cycle windows with C-x o until I regain focus on the echo area or point and…
user66
3
votes
1 answer

Raise the emacs application window when opening a file triggers a prompt?

In case it's relevant, I'm on a Mac, running OSX 10.12 and Carbon Emacs 24.3.1. If I open a file using /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n filepath the Emacs window comes to the top and gets focus unless opening the file…
1
2 3