From d9d228d1b1965ecc978c303f0019df0268e2e98d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 30 Jan 2025 15:57:52 -0800 Subject: [PATCH] oni-core: Replace package definition with updated hash --- oni-core.el | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/oni-core.el b/oni-core.el index 9562af9..e1ef818 100644 --- a/oni-core.el +++ b/oni-core.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2025.0102.153327 +;; Version: 2025.0130.155651 ;; Package-Requires: (oni-data-dir oni-embrace oni-hydra expand-region multiple-cursors gcmh diminish ws-butler which-key insert-char-preview mixed-pitch ace-window vertico marginalia orderless consult embark docstr mini-frame) ;; This program is free software; you can redistribute it and/or modify @@ -517,14 +517,27 @@ which normally have their errors suppressed." (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 next-error-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))))))) + (let* ((hash (with-current-buffer next-error-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)))))) + (struct (let ((obj (save-excursion + (beginning-of-defun) + (read (current-buffer))))) + (setf (cadar (map-elt (cdar (map-elt (cdadr (cdaddr obj)) 'source)) 'sha256)) + hash) + obj))) + (beginning-of-defun) + (let ((start (point))) + (forward-sexp) + (delete-region start (point)) + (insert (pp struct)) + (indent-region start (point)) + (skip-syntax-forward "> ") + (ensure-empty-lines)))) (if (boundp 'safe-local-variable-directories) (setq safe-local-variable-directories