As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [window]

In Emacs, a window is one part of a frame, displaying one buffer. For questions about operating system windows, see the tag 'frame.

Filter by
Sorted by
Tagged with
44 votes
2 answers
9k views

What's the difference between a buffer, a file, a window, and a frame?

When posing questions on this site, people sometimes talk about "windows" when they mean "frames," and "buffers" or "files" when they mean "windows." So: Q: What is the difference between a buffer, ...
Dan's user avatar
  • 32.3k
16 votes
1 answer
1k views

How can I block a frame from being split?

Currently I work with ruby and rspec. I really like the idea of having a separate frame in another monitor showing me the compilation buffer. My current setup uses a 'code' frame (in which I do actual ...
Renan Ranelli's user avatar
30 votes
6 answers
10k views

Switching between window layouts

When I configure a custom layout and then just need to temporary look into one file fullscreen and once I want that layout back - I need manually to reflow it. I would like a plugin/elisp code to ...
lukas.pukenis's user avatar
13 votes
2 answers
3k views

How do I force a specific buffer to open in a new window?

When committing changes in Magit, it is useful to have the diff view open while adding details about the commit. In Magit, we see the diff in the *magit ..* buffer. When you hit cc while the cursor ...
Kaushal Modi's user avatar
8 votes
2 answers
2k views

How to display a help buffer/window full frame size (not full screen)

I sometimes want to display information in Help buffer style, so I have been using code like this: (with-help-window (help-buffer) (princ "Type q to exit this help buffer.\n\n") (princ result)) ...
Kevin's user avatar
  • 1,298
122 votes
13 answers
76k views

How to switch between windows quickly?

How do I switch between windows quickly? I often have multiple windows open and need to switch between them. Right now, I use C-x o to get to the one I want. Is there a more efficient workflow ...
Sibi's user avatar
  • 3,583
26 votes
5 answers
4k views

Hide *compilation* window

It is annoying to see the compilation window appear when it is successful. How to remove that automatically? I want to see it though if it is not successful.
Husain's user avatar
  • 485
13 votes
1 answer
1k views

How to control in which window a buffer is displayed?

Q: how can I control which window org-deadline uses to display the calendar? org-deadline temporarily pops up the calendar buffer in a window when setting a deadline, and then closes it again after ...
Dan's user avatar
  • 32.3k
8 votes
1 answer
2k views

desktop-save-mode fails to save window layout

I use Emacs 24.5.1 on OS X in terminal mode. I intend to use desktop-save-mode to save and restore window layout (i.e. positions of buffer windows) upon exiting and starting Emacs. From this answer ...
skyork's user avatar
  • 211
6 votes
2 answers
583 views

Is there a generic toggle-previous-window function?

Some major modes have code and key-bindings to toggle focus back and forth between their inferior processes and the major-mode buffer. Is there an Emacs function which lets me do this between the ...
wdkrnls's user avatar
  • 3,617
1 vote
0 answers
113 views

Activate a mode when only one window is displayed

I'm trying to enable/disable visual-fill-column when there is one window/multiple windows. Since I don't like trying it on my own before asking, here is the solution I came up with: (defun my-visual-...
Lhooq's user avatar
  • 230
17 votes
2 answers
2k views

How can I prevent a command from using specific windows?

Typically, I have a frame split into four windows, where two at the bottom are dedicated to my *compilation* and *grep* buffers. When browsing compilation errors, next-error will eventually replace my ...
piwi's user avatar
  • 273
13 votes
2 answers
921 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 ...
shankar2k's user avatar
  • 163
8 votes
2 answers
2k views

save-excursion doesn't restore the currently visible buffer?

From the save-excursion docstring: Save point, mark, and current buffer; execute BODY; restore those things. My understanding was that the restored buffer would again be visible following the ...
ebpa's user avatar
  • 7,239
5 votes
1 answer
2k views

Open a file from the desktop in a single window (without home screen splitscreen)

When I open a file from the context menu by choosing "Open with Emacs", Emacs starts with a horizontal splitscreen. The first window shows the desired file and the other one the home screen. Is it ...
Miguellissimo's user avatar
4 votes
1 answer
264 views

How to update window-start without calling redisplay?

While debugging swiper I've encountered a situation when the point is changed inside with-selected-window, but window-start isn't updated. This can be annoying, because I need the up-to-date window ...
abo-abo's user avatar
  • 13.9k
4 votes
3 answers
136 views

Inconsistent point when inserting into a buffer that is visible in another frame

While working on a sort of "background processing" function, I noticed that my logs would print backwards if the buffer was in another frame. I cannot seem to figure out why it is happening. I am not ...
Jordon Biondo's user avatar
45 votes
3 answers
14k views

How to change Emacs windows from vertical split to horizontal split?

Window A ++++++++ Window B Is there a way to switch to Window A : Window B Is there a way to switch view without closing windows?
Nick's user avatar
  • 4,383
29 votes
1 answer
7k views

Synchronized scrolling in two windows

Is there a way to reflect the navigation commands in the current window in another visible window. I have two related LaTeX files displayed in two windows and would like to scroll through them ...
Vamsi's user avatar
  • 3,906
25 votes
5 answers
18k views

How to Change size of split screen emacs windows?

If I have Emacs split horizontally and on top I'm editing elisp code and on the bottom I am in the shell. By default, Emacs makes the two windows equal in size, but I'd like the shell buffer smaller. ...
programking's user avatar
  • 6,984
16 votes
3 answers
3k views

Prefer vertical splits over horizontal ones

There are several questions similar to this one. I have read them all and they don't provide an answer for my scenario. I want emacs to prefer vertical splits (splitting windows into left and right ...
Björn Lindqvist's user avatar
14 votes
2 answers
1k views

"Pop" a window into a frame

Often, I my windows get automatically split until I arbitrarily decide that the current frame does not have enough real-estate for them all. When this occurs, I manually delete a window, create a ...
PythonNut's user avatar
  • 10.2k
12 votes
3 answers
666 views

Defining the window pointed by "other-window"

In emacs, more often than i like, I end up with 4 windows or more. I'll use that example: +--------|-----------+ | | | | 1 | 2 | | | | +--------+-----...
Lompik's user avatar
  • 1,214
9 votes
4 answers
1k views

Async shell process buffer always clobbers window arrangement

I frequently launch external programs from emacs using M-!, such as Firefox or Evince, etc. Whenever I do, a buffer pops up full of results for the process, which clobbers whatever else I've got going ...
Steven Arntson's user avatar
7 votes
1 answer
745 views

Forcing Emacs Layout

(This is a followup and different from Emacs Fixed Layout ) High Level My typical Emacs Working environment is: +------------+--------------------------+--------------------------+ | NeoTree | ...
eav db's user avatar
  • 201
6 votes
1 answer
1k views

Open file in a specific window

Very similar to this question. I'm using helm-projectile to find files. My Emacs frame is divided in three vertical column windows. In one of the windows I have an open file from the project I'm ...
Cesar's user avatar
  • 163
6 votes
3 answers
385 views

Is there a way to make the "o" keypress of other-window <C-x><C-o> repeatable?

Question is as stated in the title. Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated ...
yongjieyongjie's user avatar
5 votes
2 answers
2k views

Running elisp within an orgmode code block

Consider the following elisp source code within a .org file: #+BEGIN_SRC elisp :results silent (delete-other-windows) (split-window-right) (switch-to-buffer-other-window '"*Python*") #+END_SRC This ...
Guilherme Salomé's user avatar
4 votes
5 answers
1k views

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 ...
Parker's user avatar
  • 43
3 votes
2 answers
1k views

Is there a better way to override opening window in compilation-goto-locus?

I don't like the behavior of compilation-goto-locus (bound to Enter in a *compilation* or *grep* buffer), where it splits the window and jumps to the line in a new window. I prefer the *compilation*/*...
ajp's user avatar
  • 393
2 votes
1 answer
399 views

How can I force emacs to never split frames, in particular for compile-goto-error?

I want emacs to always display new buffers in the current frame, but always taking the whole frame, rather than splitting it. I currently have customized display-buffer-alist to the following '(...
ajp's user avatar
  • 393
21 votes
2 answers
406 views

Display list of words along bottom of frame?

I'd like to display 3 lists of words on separate lines horizontally along the bottom (although top would work too) of every emacs frame I have open. I've thought of 6 ways to do this, and they all ...
Joseph Garvin's user avatar
20 votes
4 answers
9k views

How to setup default windows at startup?

Every time I open up Emacs I tend to set up 3 windows by doing C-x 3 (split-window-right) and then C-x2 (split-window-below). After that I have to switch to each window to open the files I want to ...
El Diego Efe's user avatar
  • 1,581
16 votes
1 answer
2k views

Switch window split orientation, fastest way

Say you have two buffers open like so: ------------------------------------ | | buffer 1 | buffer 2 | | | ------...
c-o-d's user avatar
  • 910
13 votes
1 answer
5k views

Open file in new window after searching it with helm

As written in A Package in a league of its own: Helm there's a way to search for a file using Helm decide after searching whether open it in same or other window My question is: How?
Empty_Mind's user avatar
  • 1,341
11 votes
2 answers
3k views

Single mode line for all windows

Is it possible to have only one mode line (sometimes referred as "statusbar") for all windows? I'd like to make this single mode line show information about the currently selected buffer.
rgtk's user avatar
  • 414
9 votes
2 answers
2k views

How can I prevent gdb *input/output* buffer from aggressively popping up in frame?

When using gdb with M-x gdb, the *input/output* buffer always pops up aggressively in any frame which has focus and isn't already displaying it. I would like the *input/output* buffer to stay quietly ...
ajp's user avatar
  • 393
9 votes
2 answers
507 views

Split Window at outermost border

I'm looking for a way to add a new full-height window split to an existing (splitted) window configuration. Because I don't know how to explain it properly I'll just post some ASCII graphics showing ...
elemakil's user avatar
  • 2,507
8 votes
1 answer
2k views

How can I tell Emacs to always open help buffers in the current window?

When looking up documentation with describe-function, Emacs display the docstring in a temporary help buffer. I want this buffer to replace current window. So far, I've customized help-window-select ...
Mathieu Marques's user avatar
8 votes
2 answers
1k views

Hook that indicates when the cursor has been moved by scrolling

Inspired by this question: Let Emacs move the cursor off-screen, I am considering writing a minor mode that will keep the cursor in a fixed position that is not affected by scrolling operations. I ...
nispio's user avatar
  • 8,143
7 votes
1 answer
476 views

Pick a window for ido-find-file-other-window and ido-switch-buffer-other-window

Thanks to @itsjeyd, I've come to love ace-window, but now I want more. I use C-x 4 f and C-x 4 b to invoke the commands ido-find-file-other-window and ido-switch-buffer-other-window, but I want to ...
Colin Fraizer's user avatar
7 votes
2 answers
1k views

Open org link in the same window

When I follow from one Org file to another via a link, the new file appears in alternative window if there is one. Is there a way to follow links staying in the same window? For example, I use a frame ...
German Lashevich's user avatar
6 votes
0 answers
535 views

Controlling window locations for files visited by Dired [duplicate]

Very often I need to open a file in dired in other window and for that dired-find-file-other-window comes handy, but sometimes I want to open file in specific split - vertical or horizontal. So if I ...
iLemming's user avatar
  • 1,193
6 votes
1 answer
123 views

How to preserve the visual height of the cursor after an operation?

Q: How do I find the visual line number of point (so that I can restore it after an operation)? By “visual line number”, I'm referring to the number N of lines between the top of the window (or the ...
Malabarba's user avatar
  • 22.8k
6 votes
1 answer
2k views

Attempt to delete minibuffer or sole ordinary window

I have a daemonized emacs, and I'm able to close any emacs frame, even the last one, using the window manager or old good C-x C-c, just to be able to retrieve all my buffers when i ask the daemon for ...
gboffi's user avatar
  • 584
6 votes
2 answers
388 views

Display all/current CSV heading names

In CSV files (especially ones with a lot of columns and/or a lot of rows) I find that it's hard to tell which column I'm on. Normally I'd like to know either the column heading, or sometimes the ...
Croad Langshan's user avatar
6 votes
2 answers
993 views

Preventing mouse clicks in inactive windows from repositioning the cursor

When I have Emacs (24.4, Mac OS, NS build) in the foreground, I often have many windows open in one frame. I sometimes want to switch windows by clicking in an inactive window. By default, this calls ...
gcv's user avatar
  • 221
5 votes
1 answer
2k views

Customizing the layout of gdb-many-windows

I really like all of the information that is available to me when I run GUD/GDB with gdb-many-windows, but I would like to be able to move the windows around some. Specifically I would like to use ...
nispio's user avatar
  • 8,143
5 votes
1 answer
2k views

Remapping C-x C-b to Open List of Buffers in Same Window

I use Emacs across different machines and operating systems. I noticed that when I press C-x C-b to get a list of all buffers, on some machines the list opens in the same window where the cursor is ...
MadPhysicist's user avatar
4 votes
2 answers
4k views

Customizing the line separating windows

After % emacs -q (split-window-right) (scroll-bar-mode 0) (fringe-mode 0) there is still a pixel-wide line separating the two windows. What is this line called, and how can I change its width and ...
Toothrot's user avatar
  • 3,114