Skip to content

feat(emacs): add badjuju-log-file command and lf status-buffer chord #70

Description

@jennings

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2High priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions