Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

-1
votes
0answers
19 views

Automatically switch focus to new window for all modes and buffers

How to make emacs auto-focus to new window for all buffers and modes. Please help
1
vote
0answers
20 views

Don't focus on evince, when compiling pdf from org-mode

I'm using Evince as my Pdf-Viewer (In a split-screen-setup) whenever i write something in org-mode and compile it as a pdf. To achieve this, i've added (add-to-list 'org-file-apps '("pdf" . "evince %...
0
votes
0answers
30 views

mutt in emacsclient: how to get the focus back to mutt?

I want to have the focus back to mutt after writing an email in emacsclient. I saw few options on the web, incuding this one (see below) But I am not sure how to implement it. Where should I paste ...
1
vote
1answer
85 views

How do I focus Emacs from elisp in macOS?

I want to focus emacs by running some elisp. I have tried using do-applescript and the following snippet to focus Emacs: if application "Emacs" is running then tell application "System Events" to ...
4
votes
1answer
66 views

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 ...
0
votes
1answer
85 views

focus-in-hook and buffer-file-name

I have the following in my init file (defun message-buffer-file-name-or-nothing () "Mode line proxy." (if buffer-file-name (message "[%s] %s" (format-time-string "%H:%M:%S") ...
3
votes
1answer
98 views

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 ...
0
votes
0answers
109 views

Emacs Auctex View in Okular but jump back to Emacs

I would like to jump back to Emacs after opening Okular for viewing my generated tex-file. So the workflow would be: edit some stuff execute C-c C-a to generate PDF from tex-File, Okular ...
0
votes
0answers
34 views

Interact with minibuffer contents while it is active

I have the follow in my init.el: (global-set-key (kbd "C-x p") #'(lambda (count &optional all-frames) (interactive "sTarget window: ") (funcall 'other-window (string-to-number count) all-...
0
votes
0answers
47 views

Retaining focus while displaying graphics windows

NB: The Emacs world uses the word frame to refer to what in most other contexts is called window, and uses the word window to describe something else. In this post, however, the word window always ...
1
vote
0answers
32 views

mode-line-inactive after system window loses focus

When a system/X11 window (frame) with Emacs loses focus, how can I make its mode line become mode-line-inactive? It stays active, keeping the standard mode-line look/face… Shouldn’t it be the default?...
2
votes
2answers
135 views

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 ...
1
vote
1answer
101 views

How to show process in another already opened frame?

I have two frames opened in emacs (one in each monitor, but this is irrelevant). I would like to have a lisp function to switch the buffer in the other frame (in the other monitor), whose focus is in ...
1
vote
0answers
42 views

Prevent call-process from stealing focus

When Emacs executes call-process after the focus has moved to another window (this is after a compilation step which takes some time to finish) it grabs the focus and causes the pointer to move to the ...
1
vote
0answers
89 views

Determine if any frame has input focus?

I have a function that gets called when idle, but I would like it to run only when a frame has input focus. My current work around is to use focus-in-hook and focus-out-hook to change the behavior ...
4
votes
1answer
566 views

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 ...
3
votes
1answer
1k views

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 (...
13
votes
1answer
436 views

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 ...
5
votes
1answer
230 views

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 ...
4
votes
2answers
237 views

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 ...
3
votes
2answers
441 views

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-...
15
votes
1answer
1k views

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 ...
6
votes
3answers
390 views

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)) ...
11
votes
2answers
756 views

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 ...