Mercurial > emacs
diff lisp/progmodes/cc-defs.el @ 107937:18526db8f26d
Reverse change 99448: "Change strategy for marking < and > as template
delimiters: mark them strictly in matching pairs."
author | Alan Mackenzie <acm@muc.de> |
---|---|
date | Mon, 12 Apr 2010 15:15:07 +0000 |
parents | 1786f2e6a856 |
children | 1a9d5fee61d1 |
line wrap: on
line diff
--- a/lisp/progmodes/cc-defs.el Mon Apr 12 14:59:56 2010 +0000 +++ b/lisp/progmodes/cc-defs.el Mon Apr 12 15:15:07 2010 +0000 @@ -1029,44 +1029,6 @@ ;; Emacs. `(remove-text-properties ,from ,to '(,property nil)))) -(defmacro c-search-forward-char-property (property value &optional limit) - "Search forward for a text-property PROPERTY having value VALUE. -LIMIT bounds the search. The comparison is done with `equal'. - -Leave point just after the character, and set the match data on -this character, and return point. If VALUE isn't found, Return -nil; point is then left undefined." - `(let ((place (point))) - (while - (and - (< place ,(or limit '(point-max))) - (not (equal (get-text-property place ,property) ,value))) - (setq place (next-single-property-change - place ,property nil ,(or limit '(point-max))))) - (when (< place ,(or limit '(point-max))) - (goto-char place) - (search-forward-regexp ".") ; to set the match-data. - (point)))) - -(defmacro c-search-backward-char-property (property value &optional limit) - "Search backward for a text-property PROPERTY having value VALUE. -LIMIT bounds the search. The comparison is done with `equal'. - -Leave point just before the character, set the match data on this -character, and return point. If VALUE isn't found, Return nil; -point is then left undefined." - `(let ((place (point))) - (while - (and - (> place ,(or limit '(point-min))) - (not (equal (get-text-property (1- place) ,property) ,value))) - (setq place (previous-single-property-change - place ,property nil ,(or limit '(point-min))))) - (when (> place ,(or limit '(point-max))) - (goto-char place) - (search-backward-regexp ".") ; to set the match-data. - (point)))) - (defun c-clear-char-property-with-value-function (from to property value) "Remove all text-properties PROPERTY from the region (FROM, TO) which have the value VALUE, as tested by `equal'. These