aboutsummaryrefslogtreecommitdiffstats
path: root/oni-core.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-09-11 21:05:41 -0700
committerGravatar Tom Willemse2023-09-11 21:05:41 -0700
commite2a8115ba8e871b69bba1d3b7b81d1008441e768 (patch)
tree4db1110f5068bacb0b39b702280e47943a993c49 /oni-core.el
parent120bf9048f689a15e52fe6470a2695048434f67a (diff)
downloademacs-config-e2a8115ba8e871b69bba1d3b7b81d1008441e768.tar.gz
emacs-config-e2a8115ba8e871b69bba1d3b7b81d1008441e768.zip
[oni-core] Add command to copy the guix build hash
This is convenient when I'm writing Guix packages.
Diffstat (limited to 'oni-core.el')
-rw-r--r--oni-core.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/oni-core.el b/oni-core.el
index 029d51d..9f76fbb 100644
--- a/oni-core.el
+++ b/oni-core.el
@@ -527,5 +527,17 @@ which normally have their errors suppressed."
(when (treesit-available-p)
(add-to-list 'interpreter-mode-alist '("bash" . bash-ts-mode)))
+(defun oni-core-copy-guix-build-hash ()
+ "Try and find the last actual hash in the compilation buffer and insert it."
+ (interactive)
+ (insert
+ (with-current-buffer compilation-last-buffer
+ (save-excursion
+ (save-match-data
+ (goto-char (point-max))
+ (re-search-backward (rx bol (zero-or-more whitespace) "actual hash:" (one-or-more whitespace)))
+ (goto-char (match-end 0))
+ (buffer-substring-no-properties (point) (line-end-position)))))))
+
(provide 'oni-core)
;;; oni-core.el ends here