aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-19 05:34:45 +0000
committerRichard M. Stallman1997-07-19 05:34:45 +0000
commit5e336d3ea6cad858fbcc22e1f8dcf24287247889 (patch)
tree10e92407fc19e5abd4ad52e7e8d0cd613a59111d
parent79c7a4fa5f974a9d3b4339a5c561ce07d7b02013 (diff)
downloademacs-5e336d3ea6cad858fbcc22e1f8dcf24287247889.tar.gz
emacs-5e336d3ea6cad858fbcc22e1f8dcf24287247889.zip
(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.
-rw-r--r--lisp/progmodes/hideshow.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 094c4499b75..585930e21a7 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -159,7 +159,7 @@ Values other than these four will be interpreted as `signal'.")
159(defvar hs-special-modes-alist 159(defvar hs-special-modes-alist
160 '((c-mode "{" "}" nil nil hs-c-like-adjust-block-beginning) 160 '((c-mode "{" "}" nil nil hs-c-like-adjust-block-beginning)
161 (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) 161 (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning)
162 (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)) 162 (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))
163; I tested the java regexp using the following: 163; I tested the java regexp using the following:
164;(defvar hsj-public) 164;(defvar hsj-public)
165;(defvar hsj-syncronised) 165;(defvar hsj-syncronised)
@@ -169,7 +169,12 @@ Values other than these four will be interpreted as `signal'.")
169;(defvar hsj-throws) 169;(defvar hsj-throws)
170;(defvar hsj-static) 170;(defvar hsj-static)
171 171
172;(setq hsj-public "[ \t]*\\(\\(public\\|private\\|protected\\|abstract\\|static\\|\\final\\)[ \t\n]+\\)+") 172;(setq hsj-public
173; (concat "[ \t]*\\("
174; (regexp-opt '("public" "private" "protected" "abstract"
175; "static" "final") 1)
176; "[ \t\n]+\\)+"))
177
173;(setq hsj-syncronised "\\(synchronized[ \t\n]*\\)?") 178;(setq hsj-syncronised "\\(synchronized[ \t\n]*\\)?")
174;(setq hsj-type "[a-zA-Z0-9_:]+[ \t\n]*\\(\\[[ \t\n]*\\][ \t\n]*\\)?") 179;(setq hsj-type "[a-zA-Z0-9_:]+[ \t\n]*\\(\\[[ \t\n]*\\][ \t\n]*\\)?")
175;(setq hsj-fname "\\([a-zA-Z0-9_:]+[ \t\n]*\\)") 180;(setq hsj-fname "\\([a-zA-Z0-9_:]+[ \t\n]*\\)")
@@ -553,7 +558,11 @@ Return point, or nil if top-level."
553 558
554(defmacro hs-life-goes-on (&rest body) 559(defmacro hs-life-goes-on (&rest body)
555 "Executes optional BODY iff variable `hs-minor-mode' is non-nil." 560 "Executes optional BODY iff variable `hs-minor-mode' is non-nil."
556 (list 'if 'hs-minor-mode (cons 'progn body))) 561 (` (let ((inhibit-point-motion-hooks t))
562 (when hs-minor-mode
563 (,@ body)))))
564
565(put 'hs-life-goes-on 'edebug-form-spec '(&rest form))
557 566
558(defun hs-already-hidden-p () 567(defun hs-already-hidden-p ()
559 "Return non-nil if point is in an already-hidden block, otherwise nil." 568 "Return non-nil if point is in an already-hidden block, otherwise nil."