all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: How about text-property-functions using `equal' rather than `eq'?
Date: Mon, 4 Feb 2008 20:53:58 +0000	[thread overview]
Message-ID: <20080204205358.GA2747@muc.de> (raw)

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)




             reply	other threads:[~2008-02-04 20:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-04 20:53 Alan Mackenzie [this message]
2008-02-05  8:04 ` How about text-property-functions using `equal' rather than `eq'? Richard Stallman
2008-02-05  8:48   ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080204205358.GA2747@muc.de \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.