Subject: Re: bug#6069: 23.1.96; sxhash, big uints and overflow-error in custom-file

From: Stefan Monnier <[email-masked]>
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