unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14568: 24.3.50; ring.el: Subtle issue with duplicate "value" entries
@ 2013-06-06 17:24 Jambunathan K
  2013-11-15  4:57 ` Jambunathan K
  0 siblings, 1 reply; 2+ messages in thread
From: Jambunathan K @ 2013-06-06 17:24 UTC (permalink / raw)
  To: 14568


`search-mark-ring' is a variable that I have in my private library.
This is a ring that is created using ring.el and is used to store
markers.

M-: search-mark-ring

(0 5 .
   [
    #<marker at 4503 in textprop.c> 
	     #<marker at 109654 in editfns.c> 
	     #<marker at 16866 in lisp.h> 
	     #<marker at 109654 in editfns.c> 
	     #<marker at 16863 in lisp.h> nil nil nil nil nil nil nil
   nil nil nil nil])

M-: search-mark-ring-current

#<marker at 16863 in lisp.h>

M-: (setq search-mark-ring-current (ring-next search-mark-ring
search-mark-ring-current))

When the last form is repeatedly evaluated, you will see that there is
no way I can hit the oldest marker - the one at 4503 - in the ring.
This is because there are duplicate entries in 109654.

Possible solutions:

1. `ring-member' should use `eq' instead of `equal'.
2. `ring-insert' should check for duplicate entries before insertion.

I would prefer solution (1).  

ring.el is probably one of the oldest libraries and so (1) may break
existing behaviours.  Possible bugfix.

1. Augment the structure and allow for a predicate.

2. Check if the ring is a ring of markers and use `eq' instead of
`equal'.

ps: It is a requirement that ring be robust in presence of duplicate
entries.


In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-06-06 on debian-6.05
Bzr revision: 112866 acm@muc.de-20130605205709-0cwqswy801vgkyx8
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#14568: 24.3.50; ring.el: Subtle issue with duplicate "value" entries
  2013-06-06 17:24 bug#14568: 24.3.50; ring.el: Subtle issue with duplicate "value" entries Jambunathan K
@ 2013-11-15  4:57 ` Jambunathan K
  0 siblings, 0 replies; 2+ messages in thread
From: Jambunathan K @ 2013-11-15  4:57 UTC (permalink / raw)
  To: 14568-done


OP here.  Closed.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-15  4:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-06 17:24 bug#14568: 24.3.50; ring.el: Subtle issue with duplicate "value" entries Jambunathan K
2013-11-15  4:57 ` Jambunathan K

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).