GNU bug report logs - #6069
23.1.96; sxhash, big uints and overflow-error in custom-file

Previous Next

Package: emacs;

Reported by: David Reitter <reitter <at> cmu.edu>

Date: Fri, 30 Apr 2010 23:09:01 UTC

Severity: normal

Tags: notabug

Found in version 23.1.96

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: David Reitter <reitter <at> cmu.edu>
Cc: 6069 <at> debbugs.gnu.org
Subject: Re: bug#6069: 23.1.96;
	sxhash, big uints and overflow-error in custom-file
Date: Sun, 27 Mar 2011 20:39:46 -0400
>>> - I stored it in a customization variable, which was subsequently
>>> saved to my custom-file.
>> What was the use of this sxhash value in your customization?
> I allow users to customize the toolbar through a standard graphical
> interface.  This customization is specific to the toolbar set by the major
> mode (and other contextual factors).  Thus, I associate a toolbar setting
> with a hash over the keys used in the tool-bar-map.  This is not ideal (as
> other keymaps may also define icons that appear in the toolbar), but works
> reasonably well. 

So you could work around the problem by doing a logand with #xfffffff.
I'm not saying that the problem you describe is an Emacs feature, but
simply that the only way to "make it work right" (i.e. make that sxhash
returns the same value on all systems) involves clipping it to #xfffffff
and while that's OK in many cases, I'd rather do it when it can
be avoided (e.g. when the sxhash value is used to index a hash table).

Also sxhash's values are not guaranteed to be the same between different
Emacs versions, so maybe instead of storing the sxhash you should simply
use the list of keys as-is.  It's not like it's expected to be very long.


        Stefan




This bug report was last modified 13 years and 241 days ago.

Previous Next


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