Mercurial > emacs
changeset 18867:b6e4c4c2a3ef
(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.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 19 Jul 1997 05:34:45 +0000 |
parents | 04d56f77da0d |
children | a37e77bbd4b3 |
files | lisp/progmodes/hideshow.el |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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."