GNU bug report logs - #75451
scratch/igc: Enable CHECK_STRUCTS

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Thu, 9 Jan 2025 03:58:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #118 received at 75451 <at> debbugs.gnu.org (full text, mbox):

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: Gerd Moellmann <gerd <at> gnu.org>, Andrea Corallo <acorallo <at> gnu.org>,
 Stefan Kangas <stefankangas <at> gmail.com>, 75451 <at> debbugs.gnu.org
Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS
Date: Sat, 01 Feb 2025 19:55:09 +0100
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 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.