GNU-devel ELPA - org-modern

org-modern Atom Feed

Description
Modern looks for Org
Latest
org-modern-1.7.0.20250416.52033.tar (.sig), 2025-Apr-16, 110 KiB
Maintainer
Daniel Mendler <mail@daniel-mendler.de>, J.D. Smith <jdtsmith+elpa@gmail.com>
Website
https://github.com/minad/org-modern
Browse ELPA's repository
CGit or Gitweb
Badge
Manual
org-modern

To install this package from Emacs, use package-install or list-packages.

Full description

GNU Emacs GNU ELPA GNU-devel ELPA MELPA MELPA Stable

1. Introduction

This package implements a modern style for your Org buffers using font locking and text properties. The package styles headlines, keywords, tables and source blocks. The styling is configurable, you can disable or modify the style of each syntax element individually via the org-modern customization group.

example.gif?raw=true

The screenshots shows example.org with org-modern-mode turned on and off. The elegant theme featured in the screenshot is modus-operandi.

Since this package adjusts text styling, it depends on your font settings. You should ensure that your variable-pitch and fixed-pitch fonts combine harmonically and have approximately the same height. As default font, I recommend variants of the Iosevka font, e.g., Iosevka Term Curly. org-modern-mode tries to adjust the tag label display based on the value of line-spacing. This looks best if line-spacing has a value between 0.1 and 0.4 in the Org buffer. Larger values of line-spacing are not recommended, since Emacs does not center the text vertically (see Emacs bug#76390).

2. Configuration

The package is available on GNU ELPA and MELPA. You can install the package with package-install. Then org-modern can be enabled manually in an Org buffer by invoking M-x org-modern-mode. In order to enable org-modern for all your Org buffers, add org-modern-mode to the Org mode hooks.

;; Option 1: Per buffer
(add-hook 'org-mode-hook #'org-modern-mode)
(add-hook 'org-agenda-finalize-hook #'org-modern-agenda)

;; Option 2: Globally
(with-eval-after-load 'org (global-org-modern-mode))

Try the following more extensive setup in emacs -Q to reproduce the looks of the screenshot above after the installation of org-modern.

;; Minimal UI
(package-initialize)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(modus-themes-load-operandi)

;; Choose some fonts
;; (set-face-attribute 'default nil :family "Iosevka")
;; (set-face-attribute 'variable-pitch nil :family "Iosevka Aile")
;; (set-face-attribute 'org-modern-symbol nil :family "Iosevka")

;; Add frame borders and window dividers
(modify-all-frames-parameters
 '((right-divider-width . 40)
   (internal-border-width . 40)))
(dolist (face '(window-divider
		window-divider-first-pixel
		window-divider-last-pixel))
  (face-spec-reset-face face)
  (set-face-foreground face (face-attribute 'default :background)))
(set-face-background 'fringe (face-attribute 'default :background))

(setq
 ;; Edit settings
 org-auto-align-tags nil
 org-tags-column 0
 org-catch-invisible-edits 'show-and-error
 org-special-ctrl-a/e t
 org-insert-heading-respect-content t

 ;; Org styling, hide markup etc.
 org-hide-emphasis-markers t
 org-pretty-entities t
 org-agenda-tags-column 0
 org-ellipsis "…")

(global-org-modern-mode)

An alternative setup, using use-package and modifying some of the display entities:

(use-package org-modern
  :custom
  (org-modern-block-indent t)  ; to enable org-modern-indent when org-indent is active
  (org-modern-hide-stars nil)
  (org-modern-todo-faces
   '(("STARTED" :foreground "yellow")
     ("CANCELED" org-special-keyword :inverse-video t :weight bold)))
  (org-modern-list
   '((?* . "•")
     (?+ . "‣")))
  (org-modern-fold-stars
   '(("▶" . "▼")
     ("▷" . "▽")
     ("▸" . "▾")
     ("▹" . "▿")))
  (org-modern-checkbox
   '((?X . "✔")
     (?- . "┅")
     (?\s . " ")))
  (org-modern-label-border 1)
  :hook
  (org-mode . org-modern-mode)
  (org-agenda-finalize . org-modern-agenda))

3. Block indentation

Since version 2.0, this package also incorporates org-modern-indent, which provides block bracket styling when org-indent-mode is enabled, including support for "bulk-indented" blocks nested within plain lists:

image

org-modern-indent is disabled by org-modern by default. Configure org-modern-block-indent=t to enable. To activate org-indent-mode in all org files, set org-startup-indented=t.

Note: Currently org-modern-indent still requires zero line-spacing, as it leads to gaps in the vertical bars drawn to indicate blocks, but hopefully this can be improved in the future.

3.1. Bulk-indented blocks (e.g. within plain lists):

Bulk-indented blocks have "real" (space/tab) indentation applied and managed by org. This extra indentation is applied by org on top of the (fake, prefix-based) indentation used by org-indent. To nest blocks properly within such indented content, e.g. in plain list items, you only have to begin the #+begin at the same level as the list element's text.

As an important principle, org-modern-indent does not alter the contents of the text in your org documents, not even indentation. It just styles what is there. To help achieve proper block bulk-indented alignment, here are a few ways to alter blocks indentation using org and other commands:

  • Start things right: Hit return after your last line of text (e.g in a list item), then immediately hit C-c C, to create the desired block. It will be indented at the right level:

    - This list item contains a:
      - sublist, which holds a block:
        [C-c C-,] here
    
  • Move flush left: Note: M-{ will get you to the start of a block quickly. M-\ at block start will move the block's first header line to column 0. Then M-S-left (or right) will indent the full block.
  • Indent rigidly: M-h selects the entire block. Then C-x TAB enters "rigid indent" mode, after which left/right moves the entire block.
  • Re-indent a block: If you have a block that is partially aligned, perhaps with a "hanging end", like so:

    - List 1
        - List 2
          #+begin_src lang
    	 foo_lang(x)
          #+end_src
    

    you can simply use M-S-left/right at block start (or in fact anywhere on the block header/footer) to org-indent-block. Note that org-src-preserve-indentation=nil is an important setting, to allow org to (re-)indent blocks to respect the local indentation inside list and other elements. Also note that (from org-indent-region):

    The function will not indent contents of example blocks, verse blocks and export blocks as leading white spaces are assumed to be significant there.

3.2. Font spacing and faces

The default fixed-pitch font (from which org-meta-line inherits) has line spacing >1.0 on some systems. This will introduce gaps even if your default font is changed, and line-space is nil. To correct it, add:

(set-face-attribute 'fixed-pitch nil :family "Hack" :height 1.0) ; or whatever font family
3.2.1. The bracket style

If you'd like a different face than org-meta-line for the "bracket", configure the org-modern-indent-bracket-line face.

4. Incompatibilities

  • org-num-mode interferes with the org-modern prettification of TODO keywords.
  • visual-wrap-prefix-mode relies on the wrap-prefix text property which is also used by org-modern.

5. Alternatives

The tag style of org-modern is inspired by Nicholas Rougier's svg-tag-mode. In contrast to svg-tag-mode, the package org-modern avoids images and uses more efficient Emacs box text properties. By only styling the text via text properties, the styled text, e.g., dates or tags stay editable and are easy to interact with.

The approach used here restricts the flexibility (e.g., no rounded corners) and creates dependence on the size and alignment of the font. Combining org-modern-mode with svg-tag-mode is possible. You can use SVG tags and use the table and block styling from org-modern. If you are interested in further tweaks, Emacs comes with the builtin prettify-symbols-mode which can be used for individual styling of custom keywords.

Alternatives are the older org-superstar and org-bullets packages, which are more limited and mainly adjust headlines and lists. org-superstar relies on character composition, while org-modern uses text properties, which are considered more future-proof. Note that org-modern is a full replacement for both org-superstar and org-bullets. You can disable styling of certain elements, e.g., org-modern-timestamp, if you only want to use the subset of org-modern equivalent to org-superstar.

6. Contributions

Since this package is part of GNU ELPA contributions require a copyright assignment to the FSF.

Old versions

org-modern-1.7.0.20250415.150645.tar.lz2025-Apr-1521.9 KiB
org-modern-1.7.0.20250402.171258.tar.lz2025-Apr-0214.8 KiB
org-modern-1.7.0.20250326.153939.tar.lz2025-Mar-2614.8 KiB
org-modern-1.7.0.20250311.170125.tar.lz2025-Mar-1114.6 KiB
org-modern-1.6.0.20250310.182355.tar.lz2025-Mar-1014.6 KiB
org-modern-1.5.0.20241022.103450.tar.lz2024-Oct-2214.6 KiB
org-modern-1.1.0.20240308.144842.tar.lz2024-Mar-0813.4 KiB
org-modern-0.10.0.20231019.184309.tar.lz2023-Oct-1913.2 KiB
org-modern-0.9.0.20230614.170049.tar.lz2023-Jun-1413.1 KiB
org-modern-0.2.0.20220307.175543.tar.lz2022-Mar-0718.1 KiB

News

1. Development

  • Merged org-modern-indent as a new extension: Provides code block bracket styling when org-indent-mode is enabled.
  • Add org-modern-habit face to improve habit progress fontification.

2. Version 1.7 (2025-03-11)

  • Fix fontification of ellipsis.
  • Check that org-modern-label-border is an integer.

3. Version 1.6 (2024-12-22)

  • Require Emacs 28.1.

4. Version 1.5 (2024-08-03)

  • Bugfixes.

5. Version 1.4 (2024-07-25)

  • Fix date formatting after #+date keyword.
  • Fix table divider line scaling.
  • Fix TODO state formatting in custom agendas.
  • Bump Compat dependency to Compat 30.

6. Version 1.3 (2024-06-02)

  • Add support for heading folding indicators. The option org-modern-star has been changed to accept the values fold, replace and nil. Set org-modern-star to replace to go back to the old default behavior.
  • Add new customization options org-modern-replace-stars and org-modern-fold-stars.
  • Add org-modern-tag-faces.
  • Add colored coded progress bars. The variable org-modern-progress specifies the width of the bars.

7. Version 1.2 (2024-03-16)

  • org-modern-star, org-modern-hide-stars, org-modern-progress: Support string values.

8. Version 1.1 (2023-12-01)

  • Bugfix: Do not use zero line width for box face attribute. Zero line widths are disallowed in Emacs 30.

9. Version 1.0 (2023-12-01)

  • Bugfix: Remove line/wrap-prefix if fringe is enabled

10. Version 0.10 (2023-07-02)

  • Bugfixes.
  • Fix star prettification if org-indent-mode is enabled.
  • Prettify filetags.

11. Version 0.9 (2023-03-12)

  • Improve prettification of stars, such that line movement commands are not affected negatively.
  • Use natnum custom types.
  • Depend on the Compat library.

12. Version 0.8 (2023-02-15)

  • Start of changelog.

13. org-modern-indent change history

org-modern-indent was incorporated as an extension to org-modern in v2.0. The prior change history for org-modern-indent is as follows, based on its release versions as a separate package:

  • v0.6: Merged as an org-modern extension.
  • v0.5.1: Small simplifications for block drawing.
  • v0.5: Another complete rewrite which substantially improves performance and accuracy. Now block detection uses org-element and the block styling is implemented in before/after-change-functions. Benefits include:

    1. Higher performance and more reliable fontification.
    2. Ability to detect and correctly treat damaged blocks (header/footer line altered or removed) as well as merged blocks.
    3. Caches all prefix strings for lower memory usage/GC churn.
    4. No more "runaway" formatting when partial blocks are created: only real blocks (according to org-element) are

    Note that v0.5 implements indented block styling using display properties on the indentation text, so navigation will "skip over" it.

  • v0.1: features a complete re-write to use font-lock directly. This has a few benefits:
    1. No longer relies on org-mode face names for recognizing blocks, so org-src-block-faces can have arbitrary faces applied, e.g. for different src languages, as in the screenshot.
    2. Eliminates the "race" between font-locking and applying the prefix text properties.
    3. Enables in-text bracket decorations for "bulk-indented" blocks, for example blocks situated in an arbitrarily-nested plain list item.