This is writeroom-mode.info, produced by makeinfo version 5.2 from writeroom-mode.texi. INFO-DIR-SECTION Emacs START-INFO-DIR-ENTRY * Writeroom mode: (writeroom-mode). Distraction-free writing. END-INFO-DIR-ENTRY  File: writeroom-mode.info, Node: Top, Next: Writeroom-mode, Up: (dir) Top *** * Menu: * Writeroom-mode::  File: writeroom-mode.info, Node: Writeroom-mode, Prev: Top, Up: Top 1 Writeroom-mode **************** ‘writeroom-mode’ is a minor mode for Emacs that implements a distraction-free writing mode similar to the famous Writeroom editor for OS X. ‘writeroom-mode’ is meant for GNU Emacs 24, lower versions are not actively supported. * Menu: * Upgrading from version 2:: * Installation:: * Usage:: * Multiple writeroom-mode buffers:: * Frame effects:: * Customisation:: * The mode line:: * Adding global effects::  File: writeroom-mode.info, Node: Upgrading from version 2, Next: Installation, Up: Writeroom-mode 1.1 Upgrading from version 2 ============================ The current version of ‘writeroom-mode’ is 3.1. If you’re upgrading from version 2.x and you have custom global effects, you will probably have to redo them, because the arguments passed to the global effect functions have been changed to make them compatible with those used to (de)activate minor modes. See the section *note Adding global effects: #adding-global-effects. for details.  File: writeroom-mode.info, Node: Installation, Next: Usage, Prev: Upgrading from version 2, Up: Writeroom-mode 1.2 Installation ================ ‘writeroom-mode’ can be installed through the package manager from Melpa (http://melpa.org/). If installing manually, make sure to also install ‘visual-fill-column’.  File: writeroom-mode.info, Node: Usage, Next: Multiple writeroom-mode buffers, Prev: Installation, Up: Writeroom-mode 1.3 Usage ========= ‘writeroom-mode’ can be activated in a buffer by calling ‘M-x writeroom-mode RET’. By default, ‘writeroom-mode’ does the following things: • activate fullscreen • disable transparency • disable the menu bar • disable the tool bar • disable the scroll bar • maximise the current window (i.e., delete all other windows in the frame) • place the fringes outside the margins • disable the mode line • add window margins to the current buffer so that the text is 80 characters wide The last three effects are buffer-local. The other effects apply to the current frame. Because ‘writeroom-mode’ is a minor mode, this isn’t entirely on the up and up, since minor modes aren’t supposed to have such global effects. But ‘writeroom-mode’ is meant for distraction-free writing, so these effects do make sense. All these effects can be disabled or customised. In addition, there are several more options that are disabled by default but can be enabled in the customisation buffer.  File: writeroom-mode.info, Node: Multiple writeroom-mode buffers, Next: Frame effects, Prev: Usage, Up: Writeroom-mode 1.4 Multiple writeroom-mode buffers =================================== It is possible to activate ‘writeroom-mode’ in more than one buffer. The global effects are of course activated only once and they remain active until ‘writeroom-mode’ is deactivated in _all_ buffers. Alternatively, if you use ‘writeroom-mode’ in multiple buffers with particular major modes (e.g., ‘text-mode’, ‘markdown-mode’), you can use the global minor mode ‘global-writeroom-mode’. This function enables the global effects and activates the buffer-local effects in all (current and future) buffers that have a major mode listed in the user option ‘writeroom-major-modes’ (by default only ‘text-mode’). When ‘global-writeroom-mode’ is active, the function ‘writeroom-mode’ can still be called to enable or disable ‘writeroom-mode’ in individual buffers (regardless of their major mode, of course). Calling ‘global-writeroom-mode’ again disables ‘writeroom-mode’ in all buffers in which it is active, also those in which it was activated manually.  File: writeroom-mode.info, Node: Frame effects, Next: Customisation, Prev: Multiple writeroom-mode buffers, Up: Writeroom-mode 1.5 Frame effects ================= Most of the global effects that ‘writeroom-mode’ enables are handled by setting specific frame parameters. This means that they apply to the current frame. If you switch to another frame and display a ‘writeroom-mode’ buffer, only the buffer-local effects will be visible. ‘writeroom-mode’ tries to make sure that it only affects one frame, and that it restores that particular frame when it is deactivated in the last buffer. This means it should be safe to activate ‘writeroom-mode’ in one frame and deactivate it in another. Killing the ‘writeroom-mode’ frame should also be safe. The affected frame is always restored to its original state, before ‘writeroom-mode’ was activated, even if you change any of the frame parameters manually while ‘writeroom-mode’ is active.  File: writeroom-mode.info, Node: Customisation, Next: The mode line, Prev: Frame effects, Up: Writeroom-mode 1.6 Customisation ================= * Menu: * Global Writeroom Mode:: * Border Width:: * Fringes Outside Margins:: * Extra Line Spacing:: * Fullscreen Effect:: * Global Effects:: * Major Modes:: * Maximize Window:: * Restore Window Config:: * Width::  File: writeroom-mode.info, Node: Global Writeroom Mode, Next: Border Width, Up: Customisation 1.6.1 Global Writeroom Mode --------------------------- Activate this option to automatically turn on ‘writeroom-mode’ in any buffer that has one of the major modes in ‘writeroom-major-modes’.  File: writeroom-mode.info, Node: Border Width, Next: Fringes Outside Margins, Prev: Global Writeroom Mode, Up: Customisation 1.6.2 Border Width ------------------ Width of the border around the text area. Disabled by default, see ‘writeroom-global-effects’ to enable the border.  File: writeroom-mode.info, Node: Fringes Outside Margins, Next: Extra Line Spacing, Prev: Border Width, Up: Customisation 1.6.3 Fringes Outside Margins ----------------------------- If set, place the fringes outside the margins. ‘writeroom-mode’ expands the window margins, causing the fringes to be pushed inside, which may be visually distracting. This option keeps the fringes at the window’s edges. Unset it if you prefer to have the fringes close to the text.  File: writeroom-mode.info, Node: Extra Line Spacing, Next: Fullscreen Effect, Prev: Fringes Outside Margins, Up: Customisation 1.6.4 Extra Line Spacing ------------------------ Increase the line spacing. Can be an absolute value (the number of pixels to add to the line) or a number relative to the default line height. Disabled by default.  File: writeroom-mode.info, Node: Fullscreen Effect, Next: Global Effects, Prev: Extra Line Spacing, Up: Customisation 1.6.5 Fullscreen Effect ----------------------- Effect to apply when ‘writeroom-mode’ activates fullscreen. Can be ‘fullboth’, which uses the entire screen (i.e., window decorations are disabled and the window manager’s panel or task bar is covered by the Emacs frame) or ‘maximized’, in which case the Emacs frame is maximised but keeps its window decorations and does not cover the panel.  File: writeroom-mode.info, Node: Global Effects, Next: Major Modes, Prev: Fullscreen Effect, Up: Customisation 1.6.6 Global Effects -------------------- List of global effects: • fullscreen • transparency • scroll bar • menu bar • tool bar • border (add a border around the text area; disabled by default) • sticky (display the window on all virtual workspaces; disabled by default) Each option can be enabled or disabled individually.  File: writeroom-mode.info, Node: Major Modes, Next: Maximize Window, Prev: Global Effects, Up: Customisation 1.6.7 Major Modes ----------------- List of major modes in which ‘writeroom-mode’ should be activated automatically. Use in conjunction with ‘global-writeroom-mode’.  File: writeroom-mode.info, Node: Maximize Window, Next: Restore Window Config, Prev: Major Modes, Up: Customisation 1.6.8 Maximize Window --------------------- Maximise the current window in its frame, i.e., delete all other windows.  File: writeroom-mode.info, Node: Restore Window Config, Next: Width, Prev: Maximize Window, Up: Customisation 1.6.9 Restore Window Config --------------------------- Restore the window configuration that existed before ‘writeroom-mode’ was activated. This is primarily useful if you use ‘writeroom-mode’ in only a single buffer, since the window configuration that is restored is the one that existed at the moment when ‘writeroom-mode’ is called for the first time. Disabled by default.  File: writeroom-mode.info, Node: Width, Prev: Restore Window Config, Up: Customisation 1.6.10 Width ------------ Width of the text area. Can be specified as an absolute value (number of characters) or as a fraction of the total window width (in which case it should be a number between 0 and 1).  File: writeroom-mode.info, Node: The mode line, Next: Adding global effects, Prev: Customisation, Up: Writeroom-mode 1.7 The mode line ================= By default, ‘writeroom-mode’ disables the mode line. Because the mode line can actually contain useful information, this may be impractical. For this reason, it is possible to use a customised mode line, which allows you to display information that is indispensable to you (e.g., the modified status, the file name). If, for some reason, you need to look at the full mode line, you can use the command ‘writeroom-toggle-mode-line’. This command makes the mode line visible in the header line (at the top of the window). Calling it again hides the mode line. This command is bound to ‘s-?’ (‘s’ is the super key, i.e., the Windows key on PCs, the ⌘ key on Macs), but it can be rebound by putting something like the following in your ‘init.el’: (with-eval-after-load 'writeroom-mode (define-key writeroom-mode-map (kbd "s-?") nil) (define-key writeroom-mode-map (kbd "") #’writeroom-toggle-mode-line)) The first ‘define-key’ disables the binding for ‘s-?’. Substitute your preferred key binding in the second line to bind ‘writeroom-toggle-mode-line’ to it.  File: writeroom-mode.info, Node: Adding global effects, Prev: The mode line, Up: Writeroom-mode 1.8 Adding global effects ========================= It is possible to add your own global effects to ‘writeroom-mode’. If there is a global minor mode that you want turned on when ‘writeroom-mode’ is activated for the first time, you can simply add it to the user option ‘writeroom-global-effects’ by checking the box "Custom effects", clicking the [INS] button and adding the function to the list. Alternatively, you can also write your own function. This function should take one argument and enable the effect if the argument is ‘1’ and disable it if the argument is ‘-1’. To give an example, if you want to activate a minimalist colour theme in ‘writeroom-mode’, you can write the following function: (defun my-writeroom-theme (arg) (cond ((= arg 1) (enable-theme 'minimalist-dark)) ((= arg -1) (disable-theme 'minimalist-dark)))) If your function affects the frame, you should make sure that it only affects the ‘writeroom-mode’ frame by passing the variable ‘writeroom--frame’ to all frame-changing functions. If your frame-effect involves changing the value of a frame parameter, you ma be able to use the macro ‘define-writeroom-global-effect’, see its doc string for details. In principle, it is not a good idea to define a custom global effect function as a toggle, but if you are sure you’ll only ever use a single frame, it should be safe enough. For example, sometimes setting the ‘fullscreen’ frame parameter does not work. In this case, if you’re on Linux, you could send an X client message directly: (defun my-toggle-fullscreen (_) (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 '(2 "_NET_WM_STATE_FULLSCREEN" 0)))  Tag Table: Node: Top217 Node: Writeroom-mode331 Ref: #writeroom-mode440 Node: Upgrading from version 2857 Ref: #upgrading-from-version-21020 Node: Installation1416 Ref: #installation1569 Node: Usage1745 Ref: #usage1891 Node: Multiple writeroom-mode buffers2948 Ref: #multiple-writeroom-mode-buffers3147 Node: Frame effects4156 Ref: #frame-effects4327 Node: Customisation5136 Ref: #customisation5289 Node: Global Writeroom Mode5506 Ref: #global-writeroom-mode5663 Node: Border Width5809 Ref: #border-width5980 Node: Fringes Outside Margins6102 Ref: #fringes-outside-margins6292 Node: Extra Line Spacing6585 Ref: #extra-line-spacing6770 Node: Fullscreen Effect6937 Ref: #fullscreen-effect7111 Node: Global Effects7470 Ref: #global-effects7631 Node: Major Modes7957 Ref: #major-modes8110 Node: Maximize Window8250 Ref: #maximize-window8418 Node: Restore Window Config8493 Ref: #restore-window-config8667 Node: Width9004 Ref: #width9124 Node: The mode line9309 Ref: #the-mode-line9470 Node: Adding global effects10585 Ref: #adding-global-effects10740  End Tag Table  Local Variables: coding: utf-8 End: