# HG changeset patch # User Richard M. Stallman # Date 869290485 0 # Node ID b6e4c4c2a3ef692afe7e1f67f582d8325b7a3ab1 # Parent 04d56f77da0dbfa85d61814f4116a742c6a7de83 (hs-special-modes-alist): Use a regexp generated by regexp-opt. (hs-life-goes-on): Nullify inhibit-point-motion-hooks as we have to move inside intangible overlays. Enable edebug. diff -r 04d56f77da0d -r b6e4c4c2a3ef lisp/progmodes/hideshow.el --- a/lisp/progmodes/hideshow.el Sat Jul 19 05:34:23 1997 +0000 +++ b/lisp/progmodes/hideshow.el Sat Jul 19 05:34:45 1997 +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]*\\(\\(public\\|private\\|protected\\|abstract\\|static\\|\\final\\)[ \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\\|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)) ; I tested the java regexp using the following: ;(defvar hsj-public) ;(defvar hsj-syncronised) @@ -169,7 +169,12 @@ ;(defvar hsj-throws) ;(defvar hsj-static) -;(setq hsj-public "[ \t]*\\(\\(public\\|private\\|protected\\|abstract\\|static\\|\\final\\)[ \t\n]+\\)+") +;(setq hsj-public +; (concat "[ \t]*\\(" +; (regexp-opt '("public" "private" "protected" "abstract" +; "static" "final") 1) +; "[ \t\n]+\\)+")) + ;(setq hsj-syncronised "\\(synchronized[ \t\n]*\\)?") ;(setq hsj-type "[a-zA-Z0-9_:]+[ \t\n]*\\(\\[[ \t\n]*\\][ \t\n]*\\)?") ;(setq hsj-fname "\\([a-zA-Z0-9_:]+[ \t\n]*\\)") @@ -553,7 +558,11 @@ (defmacro hs-life-goes-on (&rest body) "Executes optional BODY iff variable `hs-minor-mode' is non-nil." - (list 'if 'hs-minor-mode (cons 'progn body))) + (` (let ((inhibit-point-motion-hooks t)) + (when hs-minor-mode + (,@ body))))) + +(put 'hs-life-goes-on 'edebug-form-spec '(&rest form)) (defun hs-already-hidden-p () "Return non-nil if point is in an already-hidden block, otherwise nil."