GNU bug report logs -
#75451
scratch/igc: Enable CHECK_STRUCTS
Previous Next
Full log
View this message in rfc822 format
Pip Cet <pipcet <at> protonmail.com> writes:
>> 5. Generate an sed script to adjust all hashes. I think Emacs
>> developers are adults (or very precocious children) and can be trusted
>> with this powerful tool.
>
> Let's please do this! I just bumped hashes by hand in two trees, and
>
> make -C src fix-hashes
>
> would have been more convenient.
I don't feel the pain as much :-).
(defun my-update-hash ()
(interactive)
(let ((hash (thing-at-point 'symbol))
new-hash)
(unless (and (stringp hash)
(string-prefix-p "HASH_" hash))
(error "Not on a hash: %s" hash))
(setq hash (string-trim-right hash "_[0-9a-fA-F]+"))
(unless (file-exists-p "dmpstruct.h")
(if (y-or-n-p "Run 'gmake dmpstruct.h? ")
(shell-command "gmake dmpstruct.h")
(error "File dmpstruct.h does not exist. Run 'gmake dmpstruct.h'.")))
(save-excursion
(with-current-buffer (find-file-noselect "dmpstruct.h")
(goto-char (point-min))
(unless (search-forward hash nil t)
(error "Hash for %s not found in dmpstruct.h"))
(setq new-hash (thing-at-point 'symbol)))
(backward-sexp)
(kill-sexp)
(insert new-hash))))
Put point on the hash and run it.
Not that I have something against that target.
This bug report was last modified 160 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.