# HG changeset patch # User Dan Nicolaescu # Date 886404599 0 # Node ID 0507d774e769d7f837addb7c4b2d918b091d1195 # Parent 735a0243ce6f2732ba2ca6a11f413c71ec3d4ce0 (hs-special-modes-alist): Improved the regexp for java. diff -r 735a0243ce6f -r 0507d774e769 lisp/progmodes/hideshow.el --- a/lisp/progmodes/hideshow.el Mon Feb 02 05:42:02 1998 +0000 +++ b/lisp/progmodes/hideshow.el Mon Feb 02 07:29:59 1998 +0000 @@ -159,7 +159,7 @@ (defvar hs-special-modes-alist '((c-mode "{" "}" nil nil hs-c-like-adjust-block-beginning) (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) - (java-mode "\\(\\(\\([ \t]*\\(\\(abstract\\|final\\|native\\|p\\(r\\(ivate\\|otected\\)\\|ublic\\)\\|s\\(tatic\\|ynchronized\\)\\)[ \t\n]+\\)+[.a-zA-Z0-9_:]+[ \t\n]*\\(\\[[ \t\n]*\\][ \t\n]*\\)?\\([a-zA-Z0-9_:]+[ \t\n]*\\)([^)]*)\\([ \n\t]+throws[ \t\n][^{]+\\)?\\)\\|\\([ \t]*static[^{]*\\)\\)[ \t\n]*{\\)" "}" "/[*/]" java-hs-forward-sexp hs-c-like-adjust-block-beginning)) + (java-mode "\\(\\(\\([ \t]*\\(\\(abstract\\|final\\|native\\|p\\(r\\(ivate\\|otected\\)\\|ublic\\)\\|s\\(tatic\\|ynchronized\\)\\)[ \t\n]+\\)*[.a-zA-Z0-9_:]+[ \t\n]*\\(\\[[ \t\n]*\\][ \t\n]*\\)?\\([a-zA-Z0-9_:]+[ \t\n]*\\)([^)]*)\\([ \n\t]+throws[ \t\n][^{]+\\)?\\)\\|\\([ \t]*static[^{]*\\)\\)[ \t\n]*{\\)" "}" "/[*/]" java-hs-forward-sexp hs-c-like-adjust-block-beginning)) ; I tested the java regexp using the following: ;(defvar hsj-public) ;(defvar hsj-type) @@ -172,7 +172,7 @@ ; (concat "[ \t]*\\(" ; (regexp-opt '("public" "private" "protected" "abstract" ; "synchronized" "static" "final" "native") 1) -; "[ \t\n]+\\)+")) +; "[ \t\n]+\\)*")) ;(setq hsj-type "[.a-zA-Z0-9_:]+[ \t\n]*\\(\\[[ \t\n]*\\][ \t\n]*\\)?") ;(setq hsj-fname "\\([a-zA-Z0-9_:]+[ \t\n]*\\)")