From 7ee906030a54e28d2f65e17fdfc7ac5654640ee4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 2 Feb 1998 00:17:19 +0000 Subject: [PATCH] (hs-special-modes-alist): Improved the regexp for java. --- lisp/progmodes/hideshow.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index fd1cb8429e0..0189801ab33 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -159,10 +159,9 @@ Values other than these four will be interpreted as `signal'.") (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\\|p\\(r\\(ivate\\|otected\\)\\|ublic\\)\\|static\\)[ \t\n]+\\)+\\(synchronized[ \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-syncronised) ;(defvar hsj-type) ;(defvar hsj-fname) ;(defvar hsj-par) @@ -172,11 +171,10 @@ Values other than these four will be interpreted as `signal'.") ;(setq hsj-public ; (concat "[ \t]*\\(" ; (regexp-opt '("public" "private" "protected" "abstract" -; "static" "final") 1) +; "synchronized" "static" "final" "native") 1) ; "[ \t\n]+\\)+")) -;(setq hsj-syncronised "\\(synchronized[ \t\n]*\\)?") -;(setq hsj-type "[a-zA-Z0-9_:]+[ \t\n]*\\(\\[[ \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]*\\)") ;(setq hsj-par "([^)]*)") ;(setq hsj-throws "\\([ \n\t]+throws[ \t\n][^{]+\\)?") @@ -189,7 +187,6 @@ Values other than these four will be interpreted as `signal'.") ; "\\(" ; "\\(" ; hsj-public -; hsj-syncronised ; hsj-type ; hsj-fname ; hsj-par -- 2.39.5