From: Stefan Monnier Date: Tue, 6 Nov 2001 17:01:58 +0000 (+0000) Subject: (font-lock-match-c-style-declaration-item-and-skip-to-next): X-Git-Tag: ttn-vms-21-2-B4~18779 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c1966bb4443fa5c06a2bba6223e30877e154cc2b;p=emacs.git (font-lock-match-c-style-declaration-item-and-skip-to-next): Also work when LIMIT is further than the end of line. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b3ddae855a6..9d67fe2f9a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,12 @@ +2001-11-06 Stefan Monnier + + * font-lock.el (font-lock-match-c-style-declaration-item-and-skip-to-next): + Also work when LIMIT is further than the end of line. + 2001-11-06 Eli Zaretskii * international/quail.el (quail-update-leim-list-file): Print the - offending file name if some of its quail-define-package forms is - broken. + offending file name if some of its quail-define-package forms is broken. 2001-11-05 Richard M. Stallman @@ -18,8 +22,8 @@ 2001-11-05 Andrew Innes - * makefile.w32-in (bootstrap-clean-CMD, bootstrap-clean-SH): Don't - attempt to remake autoloads before nuking .elc files. + * makefile.w32-in (bootstrap-clean-CMD, bootstrap-clean-SH): + Don't attempt to remake autoloads before nuking .elc files. 2001-11-04 Richard M. Stallman @@ -27,7 +31,7 @@ previous-single-property-change or next-single-char-property-change returns nil. - * international/mule-cmds.el (set-locale-environment): + * international/mule-cmds.el (set-locale-environment): Make it interactive; make arg optional. * international/mule-diag.el (help-funs): Require help-funs. @@ -39,8 +43,7 @@ 2001-11-04 Miles Bader * startup.el (fancy-splash-head): Reapply Gerd's hack to make the - shadow of the splash image grey on a dark background instead of - black. + shadow of the splash image grey on a dark background instead of black. 2001-11-03 Stefan Monnier diff --git a/lisp/font-lock.el b/lisp/font-lock.el index e5fd64d2e45..d68098a82f1 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2049,27 +2049,27 @@ The item is delimited by (match-beginning 1) and (match-end 1). 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)))))