typewriter 
- Description
- Turn Emacs into a text adder
- Latest
- typewriter-1.2.1.tar (.sig), 2026-Oct-02, 80.0 KiB
- Maintainer
- Enrico Flor <enrico@eflor.net>
- Other versions:
- development version
- Website
- https://github.com/enricoflor/typewriter.el
- ELPA's Repository
- CGit or Gitweb
To install this package from Emacs, use package-install or list-packages.
Full description
This package provides typewriter-mode, a small minor mode that
deliberately handicaps Emacs to an extreme degree in order to provide
something as close as possible to the strict forward-only typewriter
experience. Some find that the lack of editing facilities fosters a
state of concentration and focus that makes certain types of creative
writing more satisfying.
The package has several configuration options:
typewriter-preserve-undo-history: If non-nil, you'll be able to undo edits if you turntypewriter-mode. Default ist.typewriter-recenter: If non-nil, the line where cursor is at is recentered (the commandrecenteris called) after every licit keystroke. Default ist.typewriter-fill-column: Ifnil, your lines will be as long as you want. Set to any integerN, emacs-turned-to-typewriter refuses to type anything once you reach columnNuntil you pressRETto open a new line. Default isnil.typewriter-warning-bell-offset: If your fill column is set, a physical ding will sound this many characters before the margin to warn you that the carriage is about to jam. Default is8.typewriter-show-chars-remaining: If this andtypewriter-fill-columnare non-nil, the modeline will display how many characters are left in the current line until the fill column (the margin) is reached. Default ist.typewriter-mode-line-format: Format string for the modeline indicator of remaining characters. Default is" [%d]".typewriter-tab-width: Self explanatory. Default is8.typewriter-strikethrough-char: The character used to cross out text (see below). Default is?X;nildisables strikethrough.
There are four hooks available for the user to customize the typing experience, no function is added to them by default. They run after successful completion of the corresponding action:
typewriter-insert-hooktypewriter-carriage-return-hooktypewriter-backward-char-hooktypewriter-tab-hook
Characters can also be struck with an input method (C-\), with
C-x 8 key sequences, or with insert-char (C-x 8 RET): the same
rules about margins and overstriking apply.
You can't erase on a typewriter, but you can type something like X
or - over what you've written to cross it out. C-c -
(typewriter-strikethrough) strikes typewriter-strikethrough-char
(X by default) at the carriage, even over existing text. Each strike advances the carriage by one, so a numeric
prefix crosses out several characters: move back with DEL to the
start of a word and press C-u 5 C-c - to cross out five characters.
This only works on the last line, the one the carriage is on: once you've returned the carriage, the lines above can't be touched. The margin applies as usual.
Although no systematic test has been carried out, this package's minimalism should ensure its compatibility with packages that change the layout of text in the window, such as the fairly popular olivetti, or any configuration that (for instance) hides or alters elements of the Emacs interface.
The package is on GNU ELPA, and you can install it in the usual ways, for instance:
(use-package typewriter :ensure t)
Old versions
| typewriter-1.2.0.tar.lz | 2026-Oct-02 | 9.00 KiB |
| typewriter-1.1.0.tar.lz | 2026-Sep-15 | 5.40 KiB |
News
Version 1.2.0 - New command `typewriter-strikethrough' (C-c -) strikes `typewriter-strikethrough-char' (X by default) over existing text on the last line, to cross it out. Set the option to nil to disable it. (thanks to Christopher Howard for suggesting). - Characters can be struck with an input method (C-\), with C-x 8 sequences and with `insert-char' (C-x 8 RET). The usual rules about margins and overstriking apply. (thanks Christopher Howard for pointing out the bug). - New hooks: `typewriter-backward-char-hook' and `typewriter-tab-hook'. - `typewriter-keystroke-hook' is renamed `typewriter-insert-hook'. The old name still works, but is obsolete. - TAB stops at the margin instead of going past it. - Auto-fill is turned off while the mode is on. - A numeric prefix (C-u 3 a) no longer pushes text to the right or past the margin. - Overstriking a tab no longer moves the text after it. - Fixed: `electric-pair-mode' blocking the carriage, turning the mode on twice, undo being re-enabled when it was already off, and an error from `typewriter-recenter' when the buffer is not in the selected window. - Typewriter-mode is now autoloaded (thanks bcc32 for suggesting).