# HG changeset patch # User youngs # Date 1051162152 0 # Node ID 10738b72057d09016863440a9bcda1d07d6ba876 # Parent 5d62849e7275a198a5a184d6126808784373f02b [xemacs-hg @ 2003-04-24 05:29:11 by youngs] 2003-04-24 Steve Youngs * font-lock.el (font-lock-match-java-declarations): Move save-restriction, narrow-to-region to beginning of function to avoid going beyond the limit and causing an infloop. From Jin Choi . 2003-04-24 Vasily Korytov * lisp-mode.el (emacs-lisp-mode-hook, lisp-mode-hook, lisp-interaction-mode-hook): Add the docstrings. diff -r 5d62849e7275 -r 10738b72057d lisp/ChangeLog --- a/lisp/ChangeLog Thu Apr 24 05:26:42 2003 +0000 +++ b/lisp/ChangeLog Thu Apr 24 05:29:12 2003 +0000 @@ -1,3 +1,15 @@ +2003-04-24 Steve Youngs + + * font-lock.el (font-lock-match-java-declarations): Move + save-restriction, narrow-to-region to beginning of function to + avoid going beyond the limit and causing an infloop. + From Jin Choi . + +2003-04-24 Vasily Korytov + + * lisp-mode.el (emacs-lisp-mode-hook, lisp-mode-hook, + lisp-interaction-mode-hook): Add the docstrings. + 2003-04-23 Stephen J. Turnbull * subr.el (split-string): Revert to regular behavior, except when diff -r 5d62849e7275 -r 10738b72057d lisp/font-lock.el --- a/lisp/font-lock.el Thu Apr 24 05:26:42 2003 +0000 +++ b/lisp/font-lock.el Thu Apr 24 05:29:12 2003 +0000 @@ -2719,32 +2719,34 @@ ;; the cursor to fontify more identifiers. (defun font-lock-match-java-declarations (limit) "Match and skip over variable definitions." - (if (looking-at "\\s *\\(\\[\\s *\\]\\s *\\)*") - (goto-char (match-end 0))) - (and - (looking-at java-font-lock-identifier-regexp) - (save-match-data - (not (string-match java-font-lock-type-regexp - (buffer-substring (match-beginning 1) - (match-end 1))))) - (save-match-data - (save-excursion - (goto-char (match-beginning 1)) - (not (looking-at - (concat java-font-lock-class-name-regexp - "\\s *\\(\\[\\s *\\]\\s *\\)*\\<"))))) - (save-match-data - (condition-case nil - (save-restriction - (narrow-to-region (point-min) limit) - (goto-char (match-end 0)) - ;; Note: Both `scan-sexps' and the second goto-char can - ;; generate an error which is caught by the - ;; `condition-case' expression. - (while (not (looking-at "\\s *\\(\\(,\\)\\|;\\|$\\)")) - (goto-char (or (scan-sexps (point) 1) (point-max)))) - (goto-char (match-end 2))) ; non-nil - (error t))))) + (save-restriction + (narrow-to-region (point-min) limit) + + (if (looking-at "\\s *\\(\\[\\s *\\]\\s *\\)*") + (goto-char (match-end 0))) + (and + (looking-at java-font-lock-identifier-regexp) + (save-match-data + (not (string-match java-font-lock-type-regexp + (buffer-substring (match-beginning 1) + (match-end 1))))) + (save-match-data + (save-excursion + (goto-char (match-beginning 1)) + (not (looking-at + (concat java-font-lock-class-name-regexp + "\\s *\\(\\[\\s *\\]\\s *\\)*\\<"))))) + (save-match-data + (condition-case nil + (progn + (goto-char (match-end 0)) + ;; Note: Both `scan-sexps' and the second goto-char can + ;; generate an error which is caught by the + ;; `condition-case' expression. + (while (not (looking-at "\\s *\\(\\(,\\)\\|;\\|$\\)")) + (goto-char (or (scan-sexps (point) 1) (point-max)))) + (goto-char (match-end 2))) ; non-nil + (error t)))))) (defvar tex-font-lock-keywords diff -r 5d62849e7275 -r 10738b72057d lisp/lisp-mode.el --- a/lisp/lisp-mode.el Thu Apr 24 05:26:42 2003 +0000 +++ b/lisp/lisp-mode.el Thu Apr 24 05:29:12 2003 +0000 @@ -267,6 +267,16 @@ ;; doesn't need them. ) +;; XEmacs: add docstrings to the hooks +(defvar emacs-lisp-mode-hook nil + "Hook to run when entering emacs-lisp-mode.") + +(defvar lisp-mode-hook nil + "Hook to run when entering lisp-mode.") + +(defvar lisp-interaction-mode-hook nil + "Hook to run when entering lisp-interaction-mode.") + (defun emacs-lisp-byte-compile () "Byte compile the file containing the current buffer." (interactive)