aboutsummaryrefslogtreecommitdiff
path: root/modules/restclient-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-15 00:23:14 -0500
committerCraig Jennings <c@cjennings.net>2026-05-15 00:23:14 -0500
commit54e2dc95f4a30a9b911d8c6f41606c555274766b (patch)
tree8a705aed1011fa1d2e366962af6396acf8d245a9 /modules/restclient-config.el
parent629c81fd98a5581b414b0b8a778b5c2ab083c6cb (diff)
downloaddotemacs-54e2dc95f4a30a9b911d8c6f41606c555274766b.tar.gz
dotemacs-54e2dc95f4a30a9b911d8c6f41606c555274766b.zip
feat(custom-buffer-file): make C-; b p dispatch by major-mode, with tests
Old behavior: `C-; b p' called `cj/copy-path-to-buffer-file-as-kill', which only worked in file-visiting buffers and errored otherwise. That meant the most useful "give me a clickable handle on this buffer" key did nothing in eww, elfeed, dired (file-at-point ≠ buffer's default-directory), and other browsing-shaped modes. Replace with a `major-mode'-aware dispatch: - `cj/buffer-source-functions' alist maps major-mode → thunk returning a string (or nil to fall through). - `cj/copy-buffer-source-as-kill' looks up the current mode, calls the thunk, falls back to `buffer-file-name', errors only when both yield nil. - `cj/copy-path-to-buffer-file-as-kill' kept as a `defalias' for backwards compat (the old name is referenced in adjacent tests). First-batch dispatches: - eww-mode -> (eww-current-url) - elfeed-show-mode -> (elfeed-entry-link elfeed-show-entry) - dired-mode -> (dired-get-filename nil t) - dirvish-mode -> same - doc-view / pdf-view: covered by the buffer-file-name fallback (they already set buffer-file-name correctly). 10 new ERT tests cover the dispatch paths, the buffer-file-name fallback, the user-error on nil source, the alias target, and the `C-; b p' keymap entry. which-key label flipped from "copy file path" to "copy buffer source" to match. Deferred to a follow-up task: mu4e-view-mode, org-mode at a heading, help-mode, Info-mode, magit-log/commit/status, xref/grep/ compilation, image-mode, archive-mode -- each needs a format decision before implementation.
Diffstat (limited to 'modules/restclient-config.el')
0 files changed, 0 insertions, 0 deletions