unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How about text-property-functions using `equal' rather than `eq'?
@ 2008-02-04 20:53 Alan Mackenzie
  2008-02-05  8:04 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2008-02-04 20:53 UTC (permalink / raw)
  To: emacs-devel

Hi, Emacs!

All the built in text property functions which compare properties appear
to use `eq' for the comparison.  Some of these actually say this in
their doc-strings or the pertinent manual page, some of them might
actually say it in both.  ;-(

However, it seems to me that `equal' would be a better comparison.  I am
currently playing with syntax-table text-properties, and some characters
need to have the property set to '(1) (i.e. punctuation).

I would dearly love to use text-property-any to locate such a buffer
position, but unfortunately (eq '(1) '(1)) => nil.  :-(  So I've had to
code up a clumsy equivalent which will certainly be much slower.

Would it not be a good idea to change these functions to use `equal'
instead?  No, it wouldn't be a good idea.

How about providing each of these with an optional extra parameter, the
comparison predicate?  A much better idea!  So we'd have, for example:

  (defun text-property-any (start end prop value &optional object pred)

, with PRED defaulting to `eq'.

-- 
Alan Mackenzie (Nuremberg, Germany)




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

end of thread, other threads:[~2008-02-05  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 20:53 How about text-property-functions using `equal' rather than `eq'? Alan Mackenzie
2008-02-05  8:04 ` Richard Stallman
2008-02-05  8:48   ` David Kastrup

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).