[oni-core] Add command to copy the guix build hash
This is convenient when I'm writing Guix packages.
This commit is contained in:
parent
120bf9048f
commit
e2a8115ba8
1 changed files with 12 additions and 0 deletions
12
oni-core.el
12
oni-core.el
|
@ -527,5 +527,17 @@ which normally have their errors suppressed."
|
||||||
(when (treesit-available-p)
|
(when (treesit-available-p)
|
||||||
(add-to-list 'interpreter-mode-alist '("bash" . bash-ts-mode)))
|
(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)
|
(provide 'oni-core)
|
||||||
;;; oni-core.el ends here
|
;;; oni-core.el ends here
|
||||||
|
|
Loading…
Reference in a new issue