1

Is there a way to easily switch to no-distractions writing environment in Emacs for MS-Windows?

I would prefer to have Emacs started without window titlebar and without menubar and have that without any complex patching or other intrusive system modifications.

  • If you want to do it absolutely perfectly (every pixel), then you will need to use set-frame-size with the pixelwise argument, and set-frame-poisition, along with turning off the menu-bar and tool-bar. stackoverflow.com/a/18711628/2112489 Older versions of Emacs work well with (w32-send-sys-command 61488), but newer versions of Emacs have problems when dealing with multiple frames. If you want it to just work without any configuration on your part, then you will have to settle for almost perfect and just about right using the other options below. – lawlist May 21 '15 at 15:47
1

I have used this tool in the past and it works great

emacs-fullscreen-win32

It is a executable and when run it looks for emacs and does some windows magic to make Emacs frames full screen. The readme has all the info you need to get it setup.

Just download the executable and add something like this to your config:

(defun toggle-full-screen ()
  "Toggles full-screen mode for Emacs window on Win32."
  (interactive)
  (shell-command "/path/to/emacs_fullscreen.exe"))

(defun toggle-bars ()
  "Toggles bars visibility."
  (interactive)
  (menu-bar-mode)
  (tool-bar-mode)
  (scroll-bar-mode))

(defun toggle-full-screen-and-bars ()
  "Toggles full-screen mode and bars."
  (interactive)
  (toggle-bars)
  (toggle-full-screen))

(global-set-key [f11] 'toggle-full-screen-and-bars)
  • I use pretty much the same functions but without the .exe utility. toggle-frame-maximized and toggle-frame-fullscreen work fine on windows 7. – montrivo May 21 '15 at 13:17
0

Emacs darkroom-mode appears to allow to do the trick, if the right function is called.

Here is how to use it.

  1. Install the darkroom-mode as described on its homepage
  2. Add the following code snippet into some of your startup files:

    (if (eq system-type 'windows-nt) (progn (require 'darkroom-mode) (w32-fullscreen-on) (w32-fullscreen-restore-frame) (w32-fullscreen-maximize-frame)))

Somehow it doesn't work properly when calling w32-fullscreen-maximize-frame right away, without calling w32-fullscreen-restore-frame first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.