I have another method, which I have tested with Emacs 24.3 and 24.4, as well as on both Windows and GNU/Linux. I have placed the following in my init file:
(add-to-list 'default-frame-alist '(fullscreen . maximized))
I believe this was modified slightly from a StackOverflow answer I found a while ago, but I can't seem to find it again now.
Edit: Another ...
Emacs predates contemporary window-based operating systems, so its
terminology also predates the current terms. Unfortunately, it means that new users and experienced users sometimes have trouble making themselves understood to each other, since they're using the terms in different ways.
"Frames" are to Emacs what "windows" are to everything ...
Adjust the ...-frame-alist in your init file to tell Emacs how to maximize the frame. You also have multiple options for how, exactly, to maximize it.
You have two ...-frame-alist options:
default-frame-alist (as in @Scott Weldon's answer)
If you use default-frame-alist, it will maximize all frames: both the first one ...
The built in way to do this is with registers.
For instance use C-xrwa to save the current window configuration to register a.
Then you can use the built in binding C-x1 to run delete-other-windows
after you're done looking at the single file, use C-xrja to pop back to the saved window configuration in register a.
C-xrwa (save config into ...
GNU Emacs has built-in support for fullscreen since version 24.4. From the changelog:
New commands toggle-frame-fullscreen and toggle-frame-maximized,
bound to <f11> and M-<f10>, respectively.
Note that you don't need to use the latest Emacs version just for this feature. Your window manager (KDE/KWin) is able to put any application ...
I use winner-mode. Here's my setup:
(global-set-key [f7] 'winner-undo)
(global-set-key [C-f7] 'winner-redo)
(global-set-key [f9] 'delete-other-windows)
(global-set-key [C-f9] 'delete-window)
I don't know if there's a way to bookmark a layout or something, but being able to
continuously switch back to previous layout is enough for me.
If you mean the number of windows regardless of which buffers are showing, then: (length (window-list)) will do it. Better still, you can just use the existing (count-windows) function.
If you want to count the number of unique buffers visible in windows on the frame, then you can use:
(length (cl-delete-duplicates (mapcar #'window-buffer (window-list))))
The content of the mode-line are stored in the variable mode-line-format. Emacs also supports a header line whose content is steered by the variable header-line-format.
In principle you can use
(setq header-line-format mode-line-format)
(setq-default mode-line-format nil)
to make the format of the header-line be equal to that of your current mode line and ...
I found a solution, and no longer I need transparent theme.
The solution is :
;; set transparency
(set-frame-parameter (selected-frame) 'alpha '(85 85))
(add-to-list 'default-frame-alist '(alpha 85 85))
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 understandable if still confusing.
But once we know we're talking about windows, we can do the changes you want. To get rid of all windows except the one that point ...
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 .emacs, and restart emacs.
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark)) ;; ...
If I've understood the question, here's a function that does what you want:
(defun maybe-delete-frame-buffer (frame)
"When a dedicated FRAME is deleted, also kill its buffer.
A dedicated frame contains a single window whose buffer is not
displayed anywhere else."
(let ((windows (window-list frame)))
(when (eq 1 (length windows))
(let ((buffer (...
To startup Emacs maximised, add to your init file:
;; Start maximised (cross-platf)
(add-hook 'window-setup-hook 'toggle-frame-maximized t)
In case you want to go full screen or, as they say now, distraction free mode:
;; Start fullscreen (cross-platf)
(add-hook 'window-setup-hook 'toggle-frame-fullscreen t)
NOTE: This works in Windows too.
Emacs offers registers to save and apply data such as your current window configuration, this can be done with C-x r w and C-x r j. However this approach gets unwieldy since you need to remember the window registers.
There are a few packages to improve this. iregister makes this basic feature more inspectable and interactive. The other ones I'm aware of use ...
@Constantine's answer already covers how this can be achieved by modifying your init-file (if you use Emacs 24.4).
If you start Emacs from the command line, from the dash, or from a launcher like Synapse or krunner, you can specify the -mm option (short for --maximized) to achieve the same result:
The -mm option was first introduced in Emacs 23....
I'm guessing that you are not really looking for a way to "execute the hook only once". I'm guessing that you are looking for a way to execute that particular function only once, whenever the hook is run.
The conventional, and simple, answer to that question is for your function to remove itself from the hook, after carrying out the one-time action that ...
I have a screen with resolution of 1024X600, but i set the display to 1024X724, here is my solution.
(setq frame-resize-pixelwise t)
(set-frame-position (selected-frame) 0 0)
(set-frame-size (selected-frame) 1024 600 t)
You need to configure the 600-pound gorilla that is display-buffer-alist which determines how display-buffer chooses where to display a buffer. It makes display-buffer-reuse-frames obsolete in newer emacsen. Here is a config that should guide you (atleast in emacs 24.3).
;; all buffers, try to reuse windows across all frames
New recommendation (Jan 2017)
neotree comes with default bindings of | for vertical split and - for horizontal split.
The functions neotree-enter-horizontal-split and neotree-enter-vertical-split mentioned in my older recommendation below do not exist any more!
Old recommendation (May 2015)
Currently the i and I keys are not bound in neotree-mode-map.
I would point readers to (1) The glossaries of Emacs Wiki and (2) the Emacs manual for such information.
Also to the EmacsWiki Newbie page, which has lots of good introductory information about such things. And to the Emacs manual in general, which also introduces such things well: C-h r then i followed by typing whatever you want to learn about, e.g., ...
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 gains or loses focus.
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
Kill the marked buffers: D
For frames, you can use delete-other-frames (C-x 5 1).
If you do this often you may want to define your own command. Here's a ...
I stumbled on another answer to the problem on SuperUser today. It seems more hackish, but the result is more consistent with other programs on Windows.
Run runemacs.exe with no pre-existing icon in the taskbar.
Right click on the running Emacs icon in the taskbar, and click on "pin this program to taskbar."
Shift right-click on the ...
Your included option of -c is causing this. Per the man page,
-c, --create-frame create a new frame instead of trying to use the current Emacs frame.
Remove this option from your command and Emacs should refrain from creating a new frame (AKA Window).
You cannot do this using different themes. The solution is to create a theme that has different face definitions depending on the terminal. If you look at an example like font-lock-comment-face, you'll see how it works. Instead of specifying ((class color) (min-colors 88) (background dark)) you could also specifcy (type tty) or (type graphic) etc. The manual ...
Make emacs' window title show path of the current file:
(format "%s@%s: %s %s"
(or (file-remote-p default-directory 'user)
(or (file-remote-p default-directory 'host)