Back to the talks Next by track: Open session Track: General

Column-aligning text in Emacs

Jeff Trull (he/him) - Pronunciation: rhymes with "hull" and "dull", Mastodon: @jaafar@hachyderm.io Blog: http://jefftrull.github.io/ Email: edaskel@att.net

Format: 20-min talk ; Q&A: BigBlueButton conference room Etherpad: https://pad.emacsconf.org/2026-align
Etherpad: https://pad.emacsconf.org/2026-align
Status: Waiting for video from speaker

Description

Emacs has a rich set of features for manipulating ordinary text. The "fill" features align text at the right or left edges of a paragraph, while "indent" adds space at the start of a line based on the level within an outline, or the depth of a block in code.

Emacs also has a framework for lining up text inside a line to match adjacent lines, creating the appearance of columns. For example, some coders like to have equal signs in a series of assignment statements line up, like this:

apple    = 12;
rambutan = 42;

The align.el family of functions provides functions like align, which is the entry point for mode-based code alignment, as well as align-regexp, which gives interactive, user-defined access to the same features. The presenter will give a basic introduction to the user-facing features before diving into a technical explanation of how to use the framework at the Lisp level to create your own alignment rules and features. The technical portion will touch on packages like rx and peg in addition to align.el.

Format: 20 minutes and outline:

  • Motivation: the uses of (column) alignment
  • Built-in align: features you can use out-of-the-box in programming modes

  • Customizing built-in align

    • align-regexp for interactive alignment
    • customizing align-rules-list for modes
  • align.el for the ELisp coder
    • Readable regexp with rx
    • Example: Creating org-mode tables from columns
    • Example: peg parsers as an alternative to regexp

About the speaker:

Jeff is a long-time Emacs user working on improving his ELisp skills. The dominance of VSCode makes him sad.

He discovered the align.el framework while trying to improve Emacs formatting support for a C++ library he uses, Boost.SML https://github.com/boost-ext/sml.

Questions or comments? Please e-mail emacsconf-org-private@gnu.org


Got an idea for an EmacsConf talk or session? We'd love to hear from you! Check out the Call for Participation for details.

Back to the talks Next by track: Open session Track: General