(setq load-prefer-newer t)
My GNU Emacs configuration works from two machines I regularly use.
Configuration is an Org file living within my Notes corpus. Then on
save it's tangled into el file and init.el loads it. I keep custom
packages in separate repository that configuration adds to load-path.
On <2026-08-22 Sat> I bumped into situation, when on one of machines, after fresh Emacs startup a symbol from lozenge.el package is not defined.
– prompt
defalias doesn't load via require and use-package why doesn't loading lozenge.el at emacs startup define an alias ◊git-status? I did (require 'lozenge), evaluated (use-package) block, added :demand t to it, still (◊git-status "~/.velppa/hotter.myaddr.dev") was failing with
eval: Symbol’s function definition is void: ◊git-statusI had to go to lozenge.el and do (eval-buffer) there.
Root cause was stale lozenge.elc file that didn't have alias defined. Solved by removing all elc files, and for the future setting this in Pavel's Emacs Configuration v3:
(setq load-prefer-newer t)
Integrating format-all with terraform-ts-mode
In order for format-all picks up terraform-fmt formatter of Terraform files,
when using Tree Sitter with terraform-ts-mode, the mode should be registered
in language-id package like this:
(when-let ((terraform-def (assoc "Terraform" language-id--definitions)))
(setcdr terraform-def '(terraform-mode terraform-ts-mode)))
Added to Pavel's Emacs Configuration v3 to (use-package format-all) block.
visit-source.el
visit-source.el is an utility Emacs package to quickly go to a file at
point (under cursor). I bind (keymap-global-set "H-RET"
#'visit-sourse) and can quickly go to files with line precision from
anywhere, including log outputs.
Installation
grab a file visit-source.el, put it somewhere on load-path, bind to a
key – I have it within ffap package:
(use-package ffap :ensure nil
:config
(require 'visit-source)
;;(setq ffap-file-finder #'visit-source)
(setq ffap-file-finder #'find-file)
:bind (("H-<return>" . visit-source)))
Usage
In any buffer put a point on a file-looking string and call {M-x visit-source RET} (or {H-<return>} for me).
File-looking string can be:
- a filename
- a filename with lines (as in exception or log output)
History
When I first find it on r/emacs comment, it was much simpler version
and was intended as drop-in replacement for find-file. Then I added
project awareness, so you can visit-source on a file
Pavels-Emacs-Configuration-v3.org by filename, from anywhere in the
project.
Initially I adopted visit-source instead of find-file {C-x C-f} but
then switched to find-file-at-point that has a bit different semantics
and kept visit-source at {H-RET} separately.
visit-source v0.3.0
visit-source worked in most cases, but still had some rough edges,
like didn't parse when path at point ends with dots, so text like
../Pavels-Emacs-Configuration-v3.org. didn't parse, so I had to
manually end sentences with "../Pavels-Emacs-Configuration-v3.org
file." or "../nv directory." Yesterday I bumped into the need to
visit arbitrary Org Mode link. {C-c C-o} runs OS open on it, so log
files were opening with TextEdit.app for me. Surely I can reconfigure
it in macOS level to associate Emacs with log files (via UI?); but
visit-source looks the way for it.
Given personal tooling reneissance, with Claude Code on <2026-05-06 Wed> I asked it to refactor the code - extract helper pure functions, implement fixes, support Org Mode links, get rid of trailing punctuation, add tests.
So meet visit-source v0.3.0 – visit-source.el!