[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
equality predicate option for `next-single-property-change'?
From: |
Joe Corneli |
Subject: |
equality predicate option for `next-single-property-change'? |
Date: |
Mon, 08 Aug 2005 22:35:24 -0500 |
It seems like `next-single-property-change' and other
functions for text property search should take an optional
predicate to be used in the test. For example, instead of
testing
&& EQ (here_val, textget (next->plist, prop))
in line 1056 of textprop.c, the user-supplied predicate
would be used for comparison instead.
I can write Elisp functions that will achieve the same effect,
but I don't know if it is as fast as it would be in C.
(defun next-single-property-change--predicate
(pos prop &optional test)
(let ((starting (get-text-property pos prop))
(index pos)
(cmpfct (or test
'eq)))
(save-excursion
(while (and (setq index (1+ index))
(< index (point-max))
(funcall cmpfct
starting
(get-text-property index prop)))))
(when (< index (point-max))
index)))
In GNU Emacs 22.0.50.20 (powerpc-apple-darwin7.9.0, X toolkit, Xaw3d scroll
bars)
of 2005-08-05 on hope-of-a-stone.local
X server distributor `The XFree86 Project, Inc', version 11.0.40500000
configured using `configure '--with-x' '--without-carbon' '--with-xpm'
'--with-jpeg' '--with-tiff' '--with-gif' '--with-png' 'CFLAGS=-I/sw/include'
'CPPFLAGS=-I/sw/include' 'LDFLAGS=-L/sw/lib''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: nil
locale-coding-system: nil
default-enable-multibyte-characters: t
Major mode: C
Minor modes in effect:
auto-image-file-mode: t
show-paren-mode: t
display-time-mode: t
mouse-wheel-mode: t
auto-compression-mode: t
global-font-lock-mode: t
font-lock-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
next-error-follow-minor-mode: Fol
abbrev-mode: t
Recent input:
g e n - <backspace> <backspace> t - n e x t - C-r <up>
C-s n e x t - s i n g l e - p <right> <C-left> <C-left>
<C-left> C-SPC <C-right> <C-right> <C-right> <C-right>
M-w <next> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> M-x r o p <backspace> <backspace>
e p o r t <tab> e m <tab> <return>
Recent messages:
Error during redisplay: (void-variable font-lock-negation-char-face) [6 times]
Mark set
Error during redisplay: (void-variable font-lock-negation-char-face) [23 times]
call-interactively: Beginning of buffer
Mark set
nil
31092 (074564, 0x7974)
Mark saved where search started [2 times]
Mark set
Loading emacsbug...done
- equality predicate option for `next-single-property-change'?,
Joe Corneli <=