Dim the font color of text in surrounding paragraphs
Go to file
dieggsy 3fafdc7947
Allow explicitly setting derived modes in focus-mode-to-thing
Previously, a value for focus-mode-to-thing like:

'((prog-mode . defun)
  (text-mode . sentence)
  (org-mode . paragraph))

Wouldn't work, since org-mode is dervied from text-mode. Now
focus-get-thing checks if the current mode is explicitly in
focus-mode-to-thing before checking if it's a derived mode.
2017-12-03 23:59:12 -05:00
demo-dark.gif Added README 2015-05-12 22:53:05 +02:00
demo-light.gif Added README 2015-05-12 22:53:05 +02:00
focus.el Allow explicitly setting derived modes in focus-mode-to-thing 2017-12-03 23:59:12 -05:00
README.md Fixed matching parenthesis 2015-05-24 19:41:51 +02:00

MELPA

Focus

Focus provides focus-mode that dims the text of surrounding sections, similar to iA Writer's Focus Mode.

Installation

You can install Focus using elpa. It's available on melpa:

M-x package-install focus

The package has only been tried on Emacs 24.4 and 24.5, but should work on Emacs 24 or higher.

Usage

Enable the focus-mode with M-x focus-mode .

Also, focus-read-only-mode is provided, which is a mode optimized for continuous reading. It inhibits change in the buffer, hides the cursor and provides bindings for moving between things (defined in Thing At Point). One can toggle focus-read-only-mode with M-x focus-read-only-mode or C-c C-q if focus-mode is enabled.

Some bindings for simple navigation and exiting focus-read-only-mode are provided.

Keybinding Description
n Jump to next thing
SPC Jump to next thing
p Jump to previous thing
S-SPC Jump to previous thing
i Exit focus-read-only-mode
q Exit focus-read-only-mode

Configuring

The amount of dimness can be customized by setting the focus-dimness variable, where a positive integer indicates a more dim color (i.e. more blended with the background color of your theme), and a negative integer indicates a less dim color.

Focus uses the Thing At Point library to choose what section should be in focus. By default, modes derived from prog-mode uses defun, and modes derived from text-mode uses sentence. This a customizable by setting the focus-mode-to-thing variable, which is a list containing pairs on the form (mode . thing).

Example

This is what it looks like:

Light Theme (leuven) Dark Theme (monokai)