Bastien Guerry

Notes on GNU Emacs and Org mode documentation

Emacs ancester: TECO (1962)

  • TECO : Tape/text Editor and COrrector
  • An editor and a language to write text editing macros
  • The language was interpreted and imperative
  • Bad reputation as a "write-only" language (APL, …)
  • "TECO is not a text editor, it is a programming language"
  • TINT: TINT Is Not TECO (very first recursive acronym)
  • MUNG: MUNG Until No Good (cli for TECO)

Emacs (1976): Editing MACroS running on TECO

  • RMS extends TECO: real-time full-screen mode, active keys
  • First Emacs (1976) was written as a set of TECO macros
  • Both an editor and an environment to run editing macros
  • Modeless editing by default (vs Vi modal editing)
  • Emacs code-base is using C and Emacs Lisp

Emacs initial screen

/img/emacs-bare.png

Emacs initial screen elements

  • Link to a tutorial
  • Link to a guided tour
  • Link to the Emacs manual
  • Link to ordering a manual
  • Quick start: open a file/directory
  • Quick help: recover a file

Anything missing?

(How to quit Emacs?)

/img/exit-emacs-stats.png

(Not such a bad question after all)

/img/exit-vim.png

Fundamental Emacs design elements

  • menu-bar and tool-bar: make commands more accessible
  • A buffer: the place to edit text
  • A cursor: which state can give some information
  • A modeline: a read-only place for quick info
  • An echo area: a read/write place for quick interactions
  • A fringe: where to display indicators
  • A margin: for indicators (e.g. \ in the right margin)
  • A header-line: for more modeline-like informations
  • Transient regions: highlight selected text
  • Scroll bars: visual clues on where you are
  • Help text and tooltips: information on active text
  • Text properties: for hints on syntax or actions
  • Overlay properties: for more hints on actions

Beyond Emacs design elements

Emacs design extensible and configurable and place context at the heart of every interaction.

  • linum-mode: display line numbers
  • hl-line-mode: highlight current line
  • guide-key-mode: display available keybindings
  • helm-mode & ido-mode: contextual minibuffers
  • M-x doctor RET: when you're really really lost

Example: Emacs scratch buffer

/img/scratch-buffer.png

Example: guide-key-mode

/img/guide-key-mode.png

Emacs documentation-related commands

  • C-h a : search for symbol or command
  • C-h g : open the HTML manual in a browser
  • C-h t : open the Emacs tutorial
  • C-h k : type a key and get the command
  • C-h f : search for function or commands
  • C-h v : search for variables or options
  • C-h C-d : help for debugging Emacs
  • C-h C-h : display more help commands

There is a dedicated help-mode to display help information and documentation-oriented commands like info and man.

Emacs documentation materials and tools

Documentation materials:

Documentation tools:

  • GNU coding standards
  • Recommandations on writing documentation
  • M-x checkdoc RET: Emacs Lisp docstrings linter

Emacs: really "self-documenting"?

"Is Emacs better at documenting itself than Google?"

Terminology is still a blocker for beginners:

  • yank => copy
  • kill => cut
  • window => pane
  • frame => window
  • kill buffer => close buffer

/img/self.png

What about Org-mode?

/img/org-mode.jpg

Eating our own dogfood

  • Org-mode is both a text editing/publishing tool and a todo list manager
  • Org-mode is used to write documentation (and README.org on Github)
  • Org-mode is used to track and display bugs (M-x debbugs-org RET)

worg/worg-todo.org

/img/worg-todo.png

Org-mode and the Joel test

Do you use source control? Yes, Git
Can you make a build in one step? Yes
Do you fix bugs before writing new code? Generally
Do you have a spec? For elements
Do you use the best tools money can buy? Yes, Emacs
Do you have testers? Yes, users
Do you do hallway usability testing? Not enough
Do you have a bug database? NO (Well, yes.)

See The Joel Test: 12 Steps to Better Code

Basic facts about org-mode development

  • There are 22087 commits as of 2019-03-28
  • We don't have a roadmap (but good willing users)
  • We don't use Github (but code.orgmode.org)
  • We don't have a bug tracker (but a mailing list)
  • We have a single mailing list for developers and users

Github made it easy to report issues and to start projects: it does not mean this "default" widely used interface is not questionable.

Facts about org-mode and its documentation

  • We have both a manual and a "compact" guide
  • We have a book version of the manual for Org 7.0
  • We started Worg, a git-based collaborative documentation
  • The Org manual, guide and worg docs are .org files
  • We taught users how to give useful feedback in the manual
  • We promote the notion of "ECM" (complete minimal example)
  • The mailing list is welcoming, a place to learn

For the Org 7.0 book, we received the help of a professional editor, which taught us a lot.

Worg: collaborative documentation

/img/worg.png

A mailing list as a bug tracker, are you insane?

  • Bugs get a very large exposure
  • It promotes a collective sense of responsability
  • Each bug is discussed in a unique place (a thread)
  • It is easy to refer to bugs with a simple URL
  • Patches are all discussed on the list

Yes, we can do better

  • Enhance documents about Org syntax and elements
  • Fix obsolete resources on Worg
  • Test Org-mode with beginners
  • Test Org documentation with beginners
  • Publish documentation for the Org stable and unstable

📣 Let's discuss this on floss.social

📧 Subscribe to read me from time to time