Mercurial > emacs
changeset 40780:9639c00722d3
(font-lock-match-c-style-declaration-item-and-skip-to-next):
Also work when LIMIT is further than the end of line.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 06 Nov 2001 17:01:25 +0000 |
parents | a09c65c0b5e2 |
children | 477c86c28270 |
files | lisp/font-lock.el |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/font-lock.el Tue Nov 06 15:46:49 2001 +0000 +++ b/lisp/font-lock.el Tue Nov 06 17:01:25 2001 +0000 @@ -2049,27 +2049,27 @@ If (match-beginning 2) is non-nil, the item is followed by a `('. This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." - (when (looking-at "[ \t*]*\\(\\sw+\\)[ \t]*\\(((?\\)?") + (when (looking-at "[ \n\t*]*\\(\\sw+\\)[ \t\n]*\\(((?\\)?") (when (and (match-end 2) (> (- (match-end 2) (match-beginning 2)) 1)) ;; If `word' is followed by a double open-paren, it's probably ;; a macro used for "int myfun P_ ((int arg1))". Let's go back one ;; word to try and match `myfun' rather than `P_'. (let ((pos (point))) - (skip-chars-backward " \t") + (skip-chars-backward " \t\n") (skip-syntax-backward "w") - (unless (looking-at "\\(\\sw+\\)[ \t]*\\sw*_\\sw*[ \t]*\\((\\)?") + (unless (looking-at "\\(\\sw+\\)[ \t\n]*\\sw*_\\sw*[ \t\n]*\\((\\)?") ;; Looks like it was something else, so go back to where we ;; were and reset the match data by rematching. (goto-char pos) - (looking-at "[ \t*]*\\(\\sw+\\)[ \t]*\\(((?\\)?")))) + (looking-at "[ \n\t*]*\\(\\sw+\\)[ \t\n]*\\(((?\\)?")))) (save-match-data (condition-case nil (save-restriction - ;; Restrict to the end of line, currently guaranteed to be LIMIT. + ;; Restrict to the LIMIT. (narrow-to-region (point-min) limit) (goto-char (match-end 1)) ;; Move over any item value, etc., to the next item. - (while (not (looking-at "[ \t]*\\(\\(,\\)\\|;\\|$\\)")) + (while (not (looking-at "[ \t\n]*\\(\\(,\\)\\|;\\|\\'\\)")) (goto-char (or (scan-sexps (point) 1) (point-max)))) (goto-char (match-end 2))) (error t)))))