Part of #54. Depends on #67.
Add an Emacs wrapper for badjuju.log.file: an interactive
badjuju-log-file command and an lf chord in the status buffer that
resolves the file at point.
Scope
clients/emacs/badjuju.el
Add badjuju-log-file next to badjuju-log (badjuju.el:38-41):
;;;###autoload
(defun badjuju-log-file (&optional revset)
\"Open the Bad Juju log for the file in the current buffer.\"
(interactive)
(unless buffer-file-name
(user-error \"Buffer is not visiting a file\"))
(let ((rel (file-relative-name buffer-file-name (badjuju--workspace-root))))
(badjuju-commands-run
\"badjuju.log.file\"
(cons rel (when revset (list revset))))))
clients/emacs/badjuju-keymap.el
Bind the lf chord in the status buffer (precedent: L → badjuju.log at
badjuju-keymap.el:109). On lf, send the cursor-form arg so the server
resolves the file at point — mirrors how squash/unsquash already work in
Emacs.
auto-mode-alist
No changes needed — the existing *.jujutsu entry in badjuju-mode.el
already routes the buffer through badjuju-mode because the physical path
ends in .jujutsu.
Tests
Mirror the existing badjuju.log patterns:
clients/emacs/badjuju-test.el — pattern at lines 20-25
clients/emacs/badjuju-keymap-test.el — pattern at line 83
Docs
- Add the keybinding row to
docs/src/clients/emacs.md.
Verification
redo test — Emacs ERT/e2e tests green.
- Manual: open a file,
M-x badjuju-log-file → file-log buffer opens. In
status.jujutsu, position cursor on a file row, press lf → file-log
buffer opens for that path.
- After
badjuju.new or badjuju.squash, the file-log buffer refreshes.
Part of #54. Depends on #67.
Add an Emacs wrapper for
badjuju.log.file: an interactivebadjuju-log-filecommand and anlfchord in the status buffer thatresolves the file at point.
Scope
clients/emacs/badjuju.elAdd
badjuju-log-filenext tobadjuju-log(badjuju.el:38-41):clients/emacs/badjuju-keymap.elBind the
lfchord in the status buffer (precedent:L → badjuju.logatbadjuju-keymap.el:109). On
lf, send the cursor-form arg so the serverresolves the file at point — mirrors how squash/unsquash already work in
Emacs.
auto-mode-alist
No changes needed — the existing
*.jujutsuentry inbadjuju-mode.elalready routes the buffer through
badjuju-modebecause the physical pathends in
.jujutsu.Tests
Mirror the existing
badjuju.logpatterns:clients/emacs/badjuju-test.el— pattern at lines 20-25clients/emacs/badjuju-keymap-test.el— pattern at line 83Docs
docs/src/clients/emacs.md.Verification
redo test— Emacs ERT/e2e tests green.M-x badjuju-log-file→ file-log buffer opens. Instatus.jujutsu, position cursor on a file row, presslf→ file-logbuffer opens for that path.
badjuju.neworbadjuju.squash, the file-log buffer refreshes.