rewrite um-find-file-at-point to fallback intelligently

This commit is contained in:
bth 2025-12-16 14:10:13 -08:00
commit 3815d3e403
2 changed files with 50 additions and 28 deletions

View file

@ -48,16 +48,16 @@ This "database" depends on a few simple ideas:
Clone it:
```sh
git clone https://git.bth.moi/bth/um.git ~/um
git clone https://git.bth.moi/bth/um.git ~/.emacs.d/um
```
Symlink the `um` CLI somewhere in your `PATH`:
```sh
ln -s ~/um/shell/um /usr/local/bin/um
ln -s ~/.emacs.d/um/shell/um /usr/local/bin/um
```
## emacs config
## config
My config looks like this:
@ -66,15 +66,22 @@ My config looks like this:
:after (project embark)
:config
(defalias 'journal 'um-journal-header)
(advice-add 'embark-target-file-at-point :around 'um-target-file-at-point-advice)
(advice-add 'embark-target-file-at-point :around 'um-file-at-point-advice)
:load-path "~/um/elisp"
:load-path "um/elisp"
)
```
Note the optional setup of `embark`, which allows us to visit files just by invoking `emark-dwim` on a file header. This will also work with `C-x C-f M-n` out of the box.
Note the optional setup of `embark`, which allows us to find files intelligently, explained below.
# 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-journal-path-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".
There are two primary ways this is accessed:
1. `find-file` and `next-history-element`, which will work as `C-x C-f M-n` out of the box.
2. By invoking `emark-dwim` on any filename. Requires `embark` and the `advice-add` shown above.
# CLI usage