Auto-generate CUSTOM_IDs for Org headlines
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
contrapunctus 0d8d9464ff Do not insert an empty generated ID 1 month ago Mention words-to-remove custom variable 2 months ago
auto-id.el Do not insert an empty generated ID 1 month ago
tests.el Remove common words from CUSTOM_ID 2 months ago


Donate using Liberapay


auto-id is a package to generate CUSTOM_ID properties for Org buffers.


auto-id provides a great degree of control over CUSTOM_ID generation -

  1. auto-id-ignore-existing is used to prevent existing CUSTOM_IDs from being modified.
  2. auto-id-transformers is used to control the generation of custom IDs. The default value aims to work for most situations. For everything else, the seven included transformer functions can be reused as desired.
  3. auto-id-words-to-remove can be used to remove specific words from a custom ID.
  4. In case of duplication, auto-id-uniquify-functions are used to determine how to make each custom ID unique.

If necessary, any of these may be made file- or directory-local.


  1. CUSTOM_IDs based on headline lineage
  2. control over number of words
  3. omit or de-parenthesize text in parenthesis

Contributions and contact

Feedback and MRs are very welcome. 🙂

Get in touch with the author and other Emacs users in the Emacs Jabber/XMPP channel - (web chat)

(For help in getting started with Jabber, click here)


I'd like for all software to be liberated - transparent, trustable, and accessible for anyone to use, study, or improve.

I'd like anyone using my software to credit me for the work.

I'd like to receive financial support for my efforts, so I can spend all my time doing what I find meaningful.

But I don't want to make demands or threats (e.g. via legal conditions) to accomplish all that, nor restrict my services to only those who can pay.

Thus, auto-id is released under your choice of Unlicense or the WTFPL.

(See files UNLICENSE and WTFPL).

How-to guides

How to generate CUSTOM_IDs

Just once

To generate CUSTOM_IDs for a single Org mode buffer -

  1. Switch to the buffer
  2. Type M-x auto-id-this-buffer RET

For all Org files

If you want automatic CUSTOM_ID generation in all Org files, add auto-id-mode to org-mode-hook -

(add-hook 'org-mode-hook #'auto-id-mode)

The CUSTOM_IDs will be generated when you next save the buffers.

In specific Org files

However, you are more likely to want automatic CUSTOM_ID generation in specific files. In that case -

  1. Visit the file, then add a file local variable to enable auto-id-mode in it -

    M-x add-file-local-variable RET eval RET (auto-id-mode) RET
  2. Save and revert the buffer

In Org files in a specific directory

Or, if you want automatic CUSTOM_ID generation for all Org files in a directory -

  1. Add a directory-local variable -

    M-x add-dir-local-variable RET org-mode RET eval RET (auto-id-mode) RET
  2. Save the .dir-locals.el buffer
  3. Revert the desired Org buffers