]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/hideshow.el
* progmodes/ada-mode.el: Fix bug#1920, bug#5400.
[gnu-emacs] / lisp / progmodes / hideshow.el
index bf2792dada035ae0da3d828abb3185a5396a59ce..48831509aa4ad240e708cba160c95cd9bafe530e 100644 (file)
@@ -1,7 +1,7 @@
 ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-;;               2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+;;               2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Thien-Thi Nguyen <ttn@gnu.org>
 ;;      Dan Nicolaescu <dann@ics.uci.edu>
@@ -267,10 +267,12 @@ This has effect only if `search-invisible' is set to `open'."
 
 ;;;###autoload
 (defvar hs-special-modes-alist
+  (mapcar 'purecopy
   '((c-mode "{" "}" "/[*/]" nil nil)
     (c++-mode "{" "}" "/[*/]" nil nil)
     (bibtex-mode ("@\\S(*\\(\\s(\\)" 1))
-    (java-mode "{" "}" "/[*/]" nil nil))
+    (java-mode "{" "}" "/[*/]" nil nil)
+    (js-mode "{" "}" "/[*/]" nil)))
   "*Alist for initializing the hideshow variables for different modes.
 Each element has the form
   (MODE START END COMMENT-START FORWARD-SEXP-FUNC ADJUST-BEG-FUNC).
@@ -303,8 +305,8 @@ whitespace.  Case does not matter.")
 
 (defvar hs-allow-nesting nil
   "*If non-nil, hiding remembers internal blocks.
-This means that when the outer block is shown again, any
-previously hidden internal blocks remain hidden.")
+This means that when the outer block is shown again,
+any previously hidden internal blocks remain hidden.")
 
 (defvar hs-hide-hook nil
   "*Hook called (with `run-hooks') at the end of commands to hide text.
@@ -314,7 +316,7 @@ a block), `hs-hide-all', `hs-hide-block' and `hs-hide-level'.")
 (defvar hs-show-hook nil
   "*Hook called (with `run-hooks') at the end of commands to show text.
 These commands include the toggling commands (when the result is to show
-a block), `hs-show-all' and `hs-show-block'..")
+a block), `hs-show-all' and `hs-show-block'.")
 
 (defvar hs-set-up-overlay nil
   "*Function called with one arg, OV, a newly initialized overlay.
@@ -370,7 +372,7 @@ Use the command `hs-minor-mode' to toggle or set this variable.")
     ["Toggle Hiding" hs-toggle-hiding
      :help "Toggle the hiding state of the current block"]
     "----"
-    ["Hide comments when hiding all" 
+    ["Hide comments when hiding all"
      (setq hs-hide-comments-when-hiding-all
           (not hs-hide-comments-when-hiding-all))
      :help "If t also hide comment blocks when doing `hs-hide-all'"
@@ -868,8 +870,8 @@ See documentation for functions `hs-hide-block' and `run-hooks'."
                    q (progn (hs-forward-sexp (match-data t) 1) (point)))))
       (when (and p q)
         (hs-discard-overlays p q)
-        (goto-char (if end q (1+ p)))))
-    (run-hooks 'hs-show-hook))))
+        (goto-char (if end q (1+ p))))))
+   (run-hooks 'hs-show-hook)))
 
 (defun hs-hide-level (arg)
   "Hide all blocks ARG levels below this block.
@@ -918,7 +920,7 @@ This can be useful if you have huge RCS logs in those comments."
 
 ;;;###autoload
 (define-minor-mode hs-minor-mode
-  "Minor mode to selectively hide/show code and comment blocks. 
+  "Minor mode to selectively hide/show code and comment blocks.
 When hideshow minor mode is on, the menu bar is augmented with hideshow
 commands and the hideshow commands are enabled.
 The value '(hs . t) is added to `buffer-invisibility-spec'.
@@ -934,7 +936,7 @@ Lastly, the normal hook `hs-minor-mode-hook' is run using `run-hooks'.
 
 Key bindings:
 \\{hs-minor-mode-map}"
-  :group 'hideshow 
+  :group 'hideshow
   :lighter " hs"
   :keymap hs-minor-mode-map
   (setq hs-headline nil)