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.
423
questions
1
vote
1
answer
42
views
How can Elisp code determine the previously selected window?
I would like to implement an interactive function that, in the "canonical" case, selects the window that was selected before the currently selected one1.
But my plan founders immediately on ...
2
votes
1
answer
34
views
Flatten parallel nested window trees
Sometimes when moving windows around in emacs, it will get to a state where there is a horizontal or vertical stack of windows which appears to be a single list, but is actually made up of multiple ...
0
votes
1
answer
102
views
In Magit, the command `magit-status` opens the buffer with the status buffer. Is there some similar command to do the same but with the Slime's REPL?
I am using Emacs powered with Slime to write code on Common Lisp (SBCL). In addition, I am also using magit.
Magit has a handy command called magit-status (C-x g). I use it a lot and I tend to have 2 ...
3
votes
1
answer
713
views
How to automatically downscale an image to window width in org-mode?
I use org-toggle-inline-images to directly view linked images in org-mode files. Unfortunately, depending on resolution, format and size, images often are too wide for the window (especially in ...
1
vote
1
answer
103
views
How to dynamically replace certain text, by evaluating a function on change in current buffer
I am trying to figure out how to use window-change-functions refer here for official documentation to be able to run a function to replace certain text within the current buffer at every change of the ...
1
vote
2
answers
175
views
windmove doesn't recognize S-<up> and S-<down> on Macbook Terminal
GNU Emacs 27.2 in Mac OS terminal (11.4 Big Sur).
Started with
(windmove-default-keybindings)
and found that S-<up> and S-<down> behaved just as <up> and <down>, as if the ...
1
vote
5
answers
248
views
Dired: How to open file with ace-window while keeping focus on dired buffer?
I have this Elisp code that allows me to use ace-window to open a file in a selected window from Dired:
(defun find-file-dired-ace-window ()
"Use ace window to select a window for opening a ...
1
vote
1
answer
172
views
Is it possible to open Deft in a sidebar?
I'm trying to open Deft in the left sidebar using this code:
(setq display-buffer-alist
'(("*Deft*"
(display-buffer-in-side-window)
(window-width . 0.25)
...
1
vote
2
answers
444
views
Don't replace my buffers with *warnings* or *message* buffers?
Current behavior:
Emacs replaces one of my buffers with *warnings* or *messages* if I have multiple buffers open.
However Emacs creates a new buffer and displays *warnings* or *messages* if I have ...
0
votes
2
answers
184
views
Switch to the most recently selected buffer in the current window
I am looking for a command that would switch to the buffer I most recently selected in the current window. The command mode-line-other-buffer will switch to the most recently selected buffer not ...
1
vote
1
answer
301
views
How to switch to `flycheck-list-errors` buffer/window/minibuffer?
For starters I use Doom Emacs.
Here's the scenario:
I have a python/perl/js buffer and flycheck-mode activated. Flycheck does its job and tells me that there are some errors that need attention. I go ...
0
votes
1
answer
134
views
How to use C-j C-k to move window in term mode using evil?
The bindings of C-j C-k to evil-window-down[up] work well every where apart form term mode. term mode rebinds these to C-w j C-w k - this is super annoying!
How can i make term use the C-j/C-k ...
0
votes
0
answers
24
views
How can i set the same file in org-mode to update only headings in one window and open headings on the other window? [duplicate]
I'd like to set a list of headings on one window and write on the other, is is possible?
5
votes
1
answer
2k
views
Why do many buffer switching commands in Doom Emacs skip over buffers that aren't visiting files? How can it be prevented?
In Doom Emacs many commands that replace the buffer in the current window with a different buffer will automatically select the most recent buffer that you have had open in a window. But buffers that ...
0
votes
1
answer
153
views
How to run shrink-window-horizontally multiple times, or how to repeat a function multiple times in general?
I wanted to define a function to execute a command multiple times and ended up using fset:
(fset 'my-shrink (kbd "C-u 43 C-x {"))
Now, I want to include this in a function, like this:
(...
1
vote
1
answer
77
views
How to distinguish a scroll from a change of buffer in a function called from ‘window-scroll-functions’?
I've written a function that recenters the point each time it makes a long jump and I added it to the hook window-scroll-functions. The length of the jump is determined by comparing the return value ...
0
votes
1
answer
41
views
Delete single window frame after app quits
Some of the apps (w3m, elfeed, mu4e, to name a few) when quit leave unused frame so the other buffer shows up in their place. Over time these redundant frames pile up, so we have to delete them.
I ...
2
votes
2
answers
113
views
How to make the current window display the buffer it was displaying before the current one?
For example, imagine I have two windows and three buffers. Both windows are displaying buffer 1 and I do the following,
in window 1, switch to buffer 2;
in window 2, switch to buffer 3, then to ...
1
vote
0
answers
72
views
Workaround bug#45038: 27.1; blank display
My setup: Emacs 27.1 under Ubuntu 20.04 from Kevin Kelley's PPA, and configured to use ligatures with the JetBrains Mono fonts, as described here.
I experiencing Bug#45038 27.1; blank display, or ...
0
votes
1
answer
26
views
Let-bind diplayed windows and their size/posizion
Can I let-bind diplayed windows and their size/posizion? Is there a variable that stores these infos?
I need to run a script that will change the diplayed windows, opening some help temp buffers. At ...
1
vote
2
answers
80
views
How can I display a buffer in a whole frame, removing the rest in the act?
Basically that. I need a function that would do this when I open a buffer in a frame with many other windows. Maybe Emacs has one by default.
1
vote
2
answers
111
views
Open clickable filenames in the same help buffer
I looking for simple solution to open clickable filenames in the same help buffers. For example, when we display help for add-to-list variable and click TAB the cursor is placed on the subr.el file ...
5
votes
1
answer
183
views
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 ...
3
votes
1
answer
101
views
Like pressing "q", but from the other window
I run a command that takes over another window, and maybe resizes it a little, but doesn't focus it. Let's say C-h e or C-x C-b.
I can go to that window and press q there, and everything goes back to ...
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-...
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 ...
1
vote
0
answers
31
views
How to show all split window titles in the X11 window title?
If I split an Emacs frame (one X11 window) into multiple Emacs windows (with C-x 2 and C-x 3) and open different Emacs buffers in different Emacs windows, Emacs frame title (X11 window title) displays ...
0
votes
1
answer
101
views
How do I specify the window height of the Python interpreter?
Suppose I am editing a file in python-mode. If I start the Python interpreter using M-x run-python (or C-c C-p), the Python interpreter opens in a window (*Python*) in the bottom half of the frame. ...
5
votes
2
answers
355
views
How do I open a window that will behave like a *Help* window?
*Help* windows appear to have a special behavior. For example, if I open a help window using C-h f butterfly, the window will open in a separate half-page buffer. If I use the help feature again C-h f ...
2
votes
0
answers
40
views
Restore wndows after OrgSrc mode
I am new to org mode, so it might be a very simple matter, but I couldn't find/figure out it myself.
Say, I have created a few horizontal and vertical windows. Opened an org file which has some source ...
2
votes
1
answer
340
views
Force one window when opening multiple files
Any time I open multiple files I'd like emacs to only show me one buffer. I do not want any split windows. This would save me a keystroke every time.
I learned I could do away with the buffer list ...
0
votes
0
answers
263
views
How can I get a listing of all buffers and the frames displaying them?
I want to get a list of all the windows and their frames, so I can jump directly to the frame and window.
If a buffer is not open in a window then the command should still jump to the last frame in ...
2
votes
1
answer
113
views
In EXWM `split-window-right` followed by immediate `windmove-right` swaps order of buffers
I have a function
(defun bad-fn ()
(interactive)
(split-window-right)
(windmove-right)
)
If I go to a frame with just one window visiting EXWM buffer A (and buffer B
is next), and call
split-...
0
votes
0
answers
32
views
Receive windows manager notifications of display changes
Is there a way for emacs to receive display changes notification from the windows manager? I understand this might be an OS dependent question, so I'm particularly interested in the interaction ...
0
votes
0
answers
444
views
Disable evil-mode in eshell
I have disabled evil-mode in eshell by (evil-set-initial-state 'eshell-mode 'emacs) but when I switch windows(accidentally) using C-w k from eshell, evil-mode gets enabled.
How do I prevent this ...
2
votes
0
answers
66
views
Automatically Increase and Decrease Window Size
How do I automatically increase the size of the window when I switch into it and reduce it back to its normal size when I switch out of it?
I have a small window at the bottom of my screen. While ...
0
votes
1
answer
89
views
Controlling Behaviour of (Compilation) Window Creation
How do I control whether the output buffer *Compile* of M-x compile will be shown
in an existing window or
in a new window by splitting an existing window
?
My problem is that the compilation buffer ...
1
vote
0
answers
100
views
helm-ag (or equivalent) open selection in existing window?
If you run helm-ag (I typically do this with helm-projectile-ag, but I think it should be similar) and select a match, the file / buffer opens in the last used window.
My question is this: If a you ...
3
votes
1
answer
1k
views
Can't get rid of scratch buffer at startup for Emacs 26.3
I am using GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29.
In my .emacs I specifically asked not to show the startup screen or buffer *scratch*:
(custom-set-variables
'(inhibit-startup-...
0
votes
0
answers
53
views
How to move point to the vertical center of the window when I use `C-u C-SPC`?
I am using following answer to jump to the previous jumped point and I also use C-u C-SPC as well.
(defun alt-exchange-point-and-mark (&optional arg)
(interactive"P")
(...
1
vote
0
answers
154
views
Start Emacs with gdb with a different main source file
I often run Gdb in a dedicated Emacs session. I have code to run gdb when Emacs start and set up Many-Windows mode.
For one particular project, there are many programs, all written in C, that share a ...
1
vote
1
answer
80
views
How can I split a window so that the cursor ends up in the right / lower window?
The functions I have found for splitting windows are (split-window-right) and (split-window-below). When these are evaluated the cursor ends up in the right window in the case of (split-window-right)...
1
vote
3
answers
242
views
Show only one or two lines of a buffer
I need to check numbers in a buffer each on a line against an external paper sheet
To make this easier I would like to make the window very narrow to see only one (or max. two) lines. However shrink-...
0
votes
0
answers
21
views
After query-replace using my-find-files, how to automatically delete-other-windows?
I am following answer for Using Emacs to recursively find and replace in text files not already open
My setup:
(defun my-find-files ()
(interactive)
(find-dired "~/folder" "-name \\*...
0
votes
1
answer
488
views
Prevent other-window from choosing side window
I have recently started using buffer-display-alist to sensibly place windows within a frame. Typically, I'll have one or two windows of code buffers that I actively work in and a bottom "side ...
1
vote
1
answer
32
views
magit-diff jumps to insertion/deletion in already opened window (no overlay)
I have 2 windows open: One is the magit-diff of the current repo, the other is just source codes from that repo. In source codes (the right window), I have a file opened, say "sample.txt". In magit-...
0
votes
0
answers
162
views
Few settings doesn't work in -no-window mode
I newbee in Emacs, and trying to set up emacs. Well, I've written a init.el file and except few things always work properly. But in -nw mode cursor doesn't work (blink not working), tabs doesn't work (...
1
vote
1
answer
210
views
How to use a classical development setup (file explorer + code + terminal) in Emacs
I like using the following setup for development:
+--------+---------------------------------+
| . | |
| | Python or JS |
| Dired+ | ...
1
vote
0
answers
311
views
Has anyone combined org-sidebar with org-panes? (persistent location & automatically in buffers)
In my ideal world, every org file could automatically open with a small sidebar always showing where I am, similar to how Typora works, which allows you to select other locations to go to. I'm trying ...
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 ...