Hot answers tagged

20 votes
Accepted

Quick way to close all but one window, and then revert to previous window setup?

The different sections of text you see in your Emacs are windows. You can, for example, create a new window with C-x 2. Yes, this terminology is confusing. It predates most GUI systems, so it's ...
zck's user avatar
  • 9,072
16 votes

How to remove the icon in the titlebar?

In emacs 26 you can set ns-use-proxy-icon (setq ns-use-proxy-icon nil) I was able to get a completely "clean" transparent title bar: Download emacs 26 for mac, add the following config to your ....
Muir's user avatar
  • 321
11 votes
Accepted

Get a reference for the current frame

You can use selected-frame and selected-window to get the current frame and window. Also see the focus-in-hook an focus-out-hook hooks (new in Emacs 24.4) if you want to take some action when a frame ...
glucas's user avatar
  • 20.5k
11 votes
Accepted

How can I kill all unmodified buffers / files and delete their related frames?

One way would be to use ibuffer: Open ibuffer (I have it bound to a key, but M-x ibuffer will work.) Mark all modified buffers: * m Toggle the marks, so that unmodified buffers are marked instead: t ...
glucas's user avatar
  • 20.5k
10 votes

Switch to a neighboring frame?

There is an inherent order of the visible frames, but it does not coincide with any particular user-wished order. To cycle through frames in that inherent order you can use command other-frame (C-x 5 ...
Drew's user avatar
  • 77k
9 votes

Quick way to close all but one window, and then revert to previous window setup?

Using winner-mode is handy, but if you really just want to flip back and forth between one window and a multi-window configuration, here's something I've used before: (defvar window-split-saved-...
glucas's user avatar
  • 20.5k
9 votes
Accepted

Disable scrollbar on new frame

I also ran into this issue, until I added the following code. (I believe I came across the snippet here on Stack Exchange, but sorry I don't recall the author.) (defun my/disable-scroll-bars (frame) ...
InHarmsWay's user avatar
  • 1,319
9 votes
Accepted

Why emacsclient say to quit with C-x 5 0?

This is explained in the manual here: C-hig (emacs)emacsclient Options RET The new graphical or text terminal frames created by the ‘-c’ or ‘-t’ options are considered “client frames”. Any new ...
phils's user avatar
  • 50.4k
9 votes
Accepted

Simultaneously viewing two different Info areas

It's not enough to just duplicate the frame (e.g. C-x 5 2). You need to clone the Info buffer. Open Info to the first place, then use M-n to clone the buffer. Then navigate in the new Info window (...
Drew's user avatar
  • 77k
8 votes

desktop-save-mode fails to save window layout

In order for desktop-read (the function used to restore your desktop from a file) to restore the frameset that was saved in the desktop, it must call desktop-restoring-frameset-p (i.e., "should I ...
cyberbisson's user avatar
8 votes
Accepted

how to make emacs prompt me before closing the last emacs gui frame when running emacs as a daemon?

You may want to define a function that will ask you to confirm before closing a frame. Then you'll check if Emacs was started as a daemon, if it is the case, update the C-x C-c shortcut. Something in ...
Nsukami _'s user avatar
  • 6,461
8 votes
Accepted

How to set Projectile project name as frame title

The following code works for me. (setq frame-title-format '("" "%b" (:eval (let ((project-name (projectile-project-name))) (unless (string= "-" project-name) ...
takaxp's user avatar
  • 106
8 votes

Show file names with the full path in the frame title

Because you're setting frame-title-format to "%b - GNU Emacs 26.1 ". You can try the following instead (setq frame-title-format `((buffer-file-name "%f" "%b") ,(format " - GNU Emacs %...
xuchunyang's user avatar
  • 14.5k
7 votes

Disable scrollbar on new frame

You can adjust the frame parameters in the default-frame-alist to tell Emacs you never want scroll bars. Add the following to your init file: (add-to-list 'default-frame-alist '(...
Dan's user avatar
  • 32.9k
7 votes
Accepted

macOS tab feature breaks Emacs new frame behavior; a simple fix?

Matthew Bauer (from the Emacs team provided this answer) … Prior to macOS Sierra, in full screen mode, C-x 5 2 would create the new Emacs frame in a new OS X window. This is actually ...
pajato0's user avatar
  • 399
7 votes
Accepted

automatically open new buffer in new frame

C-h v pop-up-frames tells you this. It should get you much of the way there. pop-up-frames is a variable defined in window.el. Its value is t Original value was nil Documentation: ...
Drew's user avatar
  • 77k
6 votes

Single mode line for all windows

I've finally achieved this by hacking emacs. You can get the source code from https://github.com/amosbird/emacs/tree/onemodeline . Basically it uses mini-window's header line to render current ...
Amos's user avatar
  • 466
6 votes
Accepted

Obtain absolute pixel position of point

You can use window-absolute-pixel-position: window-absolute-pixel-position is a compiled Lisp function in `window.el'. (window-absolute-pixel-position &optional POSITION WINDOW) ...
Lindydancer's user avatar
  • 6,115
6 votes

How can I pin the *compilation* buffer to never leave a single frame/window

Normally, Emacs considers the selected frame the only reusable frame. In other words, normally Emacs only searches the current ("selected") frame for windows that already contain the buffer-to-display ...
bmag's user avatar
  • 1,713
6 votes
Accepted

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

As soon as emacs 25 lands, there will be a variable gdb-display-io-nopopup to fix this problem
ajp's user avatar
  • 393
6 votes

Resize/move frame/window

There are the built in functions set-frame-size, set-frame-height, set-frame-width and set-frame-position which let's you programmatically set the frame size and position. For example (set-frame-size ...
Tephra's user avatar
  • 831
6 votes
Accepted

How i can open shell in current buffer?

I am assuming that the original poster means targeting the currently selected window in the same frame. In the event the original poster is desirous of targeting a specific window in a different ...
lawlist's user avatar
  • 19.1k
6 votes
Accepted

resize Emacs (GUI) window to exactly half the screen?

Reading C-h f set-frame-width as mentioned by user @lawlist, I saw a mention of frame-resize-pixelwise. Putting this in .emacs.d/init.el (setq frame-resize-pixelwise t) makes the window "snap" to ...
unhammer's user avatar
  • 1,147
6 votes
Accepted

Closing emacsclient after quitting calc?

You could use hook calc-end-hook to hook delete-frame. emacsclient -t --eval '(progn (add-hook (quote calc-end-hook) (lambda () (delete-frame))) (calc nil t))'
Marco Wahl's user avatar
  • 2,856
6 votes

Open the same file in two frames

Three different things come to mind, depending on just what you want. Perhaps one or more of them will help. C-x 5 2 (new frame for the current buffer). C-x 3 (or C-x 2), followed by M-x follow-mode ...
Drew's user avatar
  • 77k
5 votes

How can I pin the *compilation* buffer to never leave a single frame/window

Make buffer compilation always have a dedicated window. One way to do this is to customize option special-display-buffer-names, to include "*compilation*". Another is to customize option special-...
Drew's user avatar
  • 77k
5 votes

Can Emacs provide a wide scrollbar (birds-eye view) of code?

Most of the emacs packages I've seen related to this have thought of it as coming from the sublime Minimap, which seems identical. I've seen people refer to these, but I don't have much experience ...
quodlibetor's user avatar
5 votes

How i can open shell in current buffer?

Not a direct answer to your question, but maybe this is a solution for you. M-x install-package shell-pop To install the package shell-pop from melpa or melpa-stable. Then evaluate (for tryout in *...
Vera Johanna's user avatar
5 votes
Accepted

How to check if there exists a frame in which a given buffer is visible

It's not clear why you want the call to find-buffer-visiting. The following works as expected: (get-buffer-window "*scratch*" 'visible)
Dan's user avatar
  • 32.9k
5 votes
Accepted

unable to use C-x o to switch frame focus while in term frame

See: https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html C-c char -- "This is equivalent to C-x char in normal Emacs. For example, C-c o invokes the global binding of C-x o, ...
lawlist's user avatar
  • 19.1k

Only top scored, non community-wiki answers of a minimum length are eligible