From 315cbb78844b775d82b9ef9aea2c4d865bdd423b Mon Sep 17 00:00:00 2001 From: bth Date: Tue, 19 May 2026 13:35:58 -0700 Subject: [PATCH] auto-mode-alist should be set up with :mode --- README.md | 44 +++++++++++++++++++------------------------- um-mode.el | 4 +--- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index cfa136a..24e020f 100644 --- a/README.md +++ b/README.md @@ -43,32 +43,13 @@ This "database" depends on a few simple ideas: # installation -Clone it: - -```sh -git clone https://git.bth.moi/bth/um.git ~/.emacs.d/um -``` - -Build the `um` binary: - -```sh -cd ~/.emacs.d/um/go -go build -o um . -``` - -Symlink somewhere in your `PATH`: - -```sh -ln -s ~/.emacs.d/um/go/um /usr/local/bin/um -``` - -## config - -My config looks like this: +Install with use-package: ```elisp (use-package um - :after (project embark) + :vc (:url "https://git.bth.moi/bth/um" :rev :newest) + :after (markdown-mode embark) + :mode ("\\.um\\'" . um-mode) :custom (um-root-glob ".*/writing/journal") @@ -78,13 +59,26 @@ My config looks like this: :config (advice-add 'embark-target-file-at-point :around 'um-target-file-at-point-advice) - - :load-path "um/elisp" ) ``` Note the optional setup of `embark`, which allows us to find files intelligently, explained below. +## CLI binary + +Build the `um` binary: + +```sh +cd ~/.emacs.d/elpa/um/go +go build -o um +``` + +Symlink somewhere in your `PATH`: + +```sh +ln -s ~/.emacs.d/elpa/um/go/um /usr/local/bin/um +``` + # ultralight "database" What I consider the killer feature of `um` is the ability to jump to files from filenames listed in any "child" project back to the "source" project, defined via `um-root-glob`. This means that child projects can be initially defined as simple lists of filenames, which I do to compose larger pieces. A simple filename anywhere can also serve as a "link". diff --git a/um-mode.el b/um-mode.el index 21e5837..bdd0b0d 100644 --- a/um-mode.el +++ b/um-mode.el @@ -22,6 +22,7 @@ "t" 'um-tag-dwim-inhibit-read-only ) +;;;###autoload (define-derived-mode um-mode special-mode "um-mode" "major mode for *.um file lists. Mostly `special-mode' with a few more commands. @@ -30,7 +31,4 @@ (read-only-mode) ) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.um\\'" . um-mode)) - (provide 'um-mode)