Skip to content

Scale text globally and adjust UI for presentations / live demos

License

Notifications You must be signed in to change notification settings

zonuexe/emacs-presentation-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emacs Presentation Mode

Present your Emacs sessions with readable text across all buffers, featuring a quick toggle and hooks for tailoring your UI during live demos.

Tip

Note on the February 2026 Update

The scaling engine was significantly updated on 2026-02-01. See PR #4 for details and rollback instructions. Your feedback is very welcome!

Key Features

  • Global Scaling: A global minor mode (presentation-mode) that scales text across all windows for crystal-clear screen sharing.
  • UI Automation: Use hooks (presentation-on-hook / off-hook) to automatically adjust your environment (e.g., hide line numbers, switch themes).
  • Emacs 29+ Ready: Optionally delegates to native global-text-scale-adjust while maintaining toggle and hook support.
  • Persistence: Automatically remembers and restores your last used scale.

./emacs-presentation.jpg

How to use

  1. Execute M-x presentation-mode to start your session.
  2. Adjust the scale using C-x C-+ or C-x C--. (Reference: Emacs Manual: Text Scale)
  3. Toggle M-x presentation-mode again to stop and restore your original UI.
  4. When re-enabled, the mode automatically reproduces your last used scale.
  5. To set a permanent starting scale, customize presentation-default-text-scale.

Technical Notes

Not for permanent font configuration

This mode is NOT intended for permanent font size changes. For global font configuration, refer to:

Emacs 29+ Global Scaling

Emacs 29 introduced global-text-scale-adjust. This package can delegate to it while providing the extra benefit of hooks and persistence.

  • Control delegation via presentation-use-global-text-scale-adjust:
    • auto (default): uses global adjust when available and no buffers are ignored.
    • always: forces global adjust.
    • never: always uses the legacy buffer-local text-scale-mode.

Customization

Use hooks to define a “Presentation Theme” that triggers automatically.

(defun my-presentation-on ()
  "Setup UI for presentations."
  (vertico-flat-mode -1)
  ;; (global-display-line-numbers-mode -1)
  (modus-themes-select 'modus-vivendi))

(defun my-presentation-off ()
  "Restore UI after presentations."
  (vertico-flat-mode 1)
  ;; (global-display-line-numbers-mode 1)
  (modus-themes-select 'modus-operandi))

(add-hook 'presentation-on-hook #'my-presentation-on)
(add-hook 'presentation-off-hook #'my-presentation-off)

Typically it is on/off of display-line-numbers-mode (or linum-mode) (although I do not use it). I normally use Vertico; with vertico-flat-mode candidates stay on one horizontal line, minimizing vertical space during live demos. IDO / fido-mode is another compact built-in UI option.

Global scaling (Emacs 29+)

  • Emacs 29 added global-text-scale-adjust in face-remap.el. When available, presentation-mode delegates scaling to it so all frames/windows stay in sync.
  • Control delegation with presentation-use-global-text-scale-adjust:
    • auto (default): use global adjust when available and no ignored buffers need protection.
    • always: force global adjust when available (no fallback for ignored buffers).
    • never: always use the legacy buffer-local text-scale-mode behavior.
  • If any buffer should be excluded (e.g., matches presentation-mode-ignore-minor-modes or has presentation-disable set), delegation is disabled in auto mode and buffer-local scaling is used to keep those buffers unchanged.

Difference from other methods

vs GlobalTextScaleMode (Emacs Wiki)

Although the content of this article is simple, it does not provide a way to recover buffers.

vs moom

moom package has flexible frame control and font size change function. Its font size change function is controlled by a mechanism different from presentation.el.

default-text-scale package is an implementation that replaces text-scale-mode. This package is probably not compatible with presentation.el, but please use this whenever you want to synchronize font size at all times, not only for presentation use.

These packages are simple presentations using org-mode. By using these with org-babel, it may be possible to perform live coding of arbitrary languages.

vs global-text-scale-adjust (Emacs 29+)

  • If you only want to synchronize text scale across all windows, a simple remap can suffice:
    (define-key global-map [remap text-scale-adjust] #'global-text-scale-adjust)
        
  • presentation-mode adds value when you need explicit on/off toggling via a minor mode and custom hooks (presentation-on-hook, presentation-off-hook) to adjust UI (e.g., hide line numbers, switch completion UI) during presentations.

Comparison with Alternatives

Featurepresentation.elglobal-text-scaledefault-text-scale
Global ScalingYesYesYes
UI Hooks (On/Off)YesNoNo
Scale PersistenceYesNoYes
Buffer ExclusionYesNoNo
  • vs Org-specific tools (org-tree-slide, org-present): These are for slide decks. presentation.el is for general live-coding and demoing any buffer.
  • vs default-text-scale: Use default-text-scale for permanent global scaling. Use presentation.el for temporary presentation mode with environment tweaks.

Video

./emacs-presentation.gif

About

Scale text globally and adjust UI for presentations / live demos

Resources

License

Stars

Watchers

Forks