I'm creating a hash map and I'd like to use markers as keys. I set the hash map equality test to "equal", but the last line from the below code is returning ("bye" "fly") instead of ("bazooka" "joe"). Any idea what I'm doing wrong?
(let* ((tmp (make-hash-table :test 'equal))
(marker-1 (make-marker))
(marker-2 (make-marker)))
(set-marker marker-1 1)
(set-marker marker-2 1)
(message "markers equal 1?: %s" (equal marker-1 marker-2))
(message "markerp 1: %s, 2: %s" (markerp marker-1) (markerp marker-2))
(puthash marker-1 (list "hi") tmp)
(puthash marker-2 (list "bye" "fly") tmp)
(message "markers equal 2?: %s" (equal marker-1 marker-2))
(puthash marker-1 (list "bazooka" "joe") tmp)
(gethash marker-2 tmp))
equal
then theirsxhash-equal
values are the same. But in this case the markers areequal
and they have differentsxhash-equal
values. If someone doesn't provide a good answer here, consider filing a bug report:M-x report-emacs-bug
.sxhash
has a comment aboutLisp_Vectorlike
objects “Others areequal' if they are
eq'”, but that doesn't match withinternal_equal
which several extra cases with comparisons by value: markers, overlays and window configurations.set-marker
or a modification of the buffers or other things that can change the markers' positions.equal
test when they do have the same position.)