]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/hideshow.el
Duplicate-word and spelling fixes.
[gnu-emacs] / lisp / progmodes / hideshow.el
index 49202ab6692e02e2bf4ce801588ccb7bfdc5f647..0884d28ad5ab7ab98d66378c127e5c6b5c5d2d3e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks
 
-;; Copyright (C) 1994-2011  Free Software Foundation, Inc.
+;; Copyright (C) 1994-2012  Free Software Foundation, Inc.
 
 ;; Author: Thien-Thi Nguyen <ttn@gnu.org>
 ;;      Dan Nicolaescu <dann@ics.uci.edu>
 ;;     Unfortunately, these workarounds do not restore hideshow state.
 ;;     If someone figures out a better way, please let me know.
 
-;; * Correspondance
+;; * Correspondence
 ;;
-;; Correspondance welcome; please indicate version number.  Send bug
+;; Correspondence welcome; please indicate version number.  Send bug
 ;; reports and inquiries to <ttn@gnu.org>.
 
 ;; * Thanks
@@ -539,7 +539,7 @@ property of an overlay."
 (defun hs-looking-at-block-start-p ()
   "Return non-nil if the point is at the block start."
   (and (looking-at hs-block-start-regexp)
-       (save-match-data (not (nth 4 (syntax-ppss))))))
+       (save-match-data (not (nth 8 (syntax-ppss))))))
 
 (defun hs-forward-sexp (match-data arg)
   "Adjust point based on MATCH-DATA and call `hs-forward-sexp-func' w/ ARG.
@@ -604,7 +604,7 @@ we return a list having a nil as its car and the end of comment position
 as cdr."
   (save-excursion
     ;; the idea is to look backwards for a comment start regexp, do a
-    ;; forward comment, and see if we are inside, then extend extend
+    ;; forward comment, and see if we are inside, then extend
     ;; forward and backward as long as we have comments
     (let ((q (point)))
       (when (or (looking-at hs-c-start-regexp)
@@ -693,8 +693,8 @@ Return point, or nil if original point was not in a block."
         (point)
       ;; look backward for the start of a block that contains the cursor
       (while (and (re-search-backward hs-block-start-regexp nil t)
-                 ;; go again if in a comment
-                 (or (save-match-data (nth 4 (syntax-ppss)))
+                 ;; go again if in a comment or a string
+                 (or (save-match-data (nth 8 (syntax-ppss)))
                      (not (setq done
                                 (< here (save-excursion
                                           (hs-forward-sexp (match-data t) 1)
@@ -718,7 +718,7 @@ Return point, or nil if original point was not in a block."
            (and (< (point) maxp)
                 (re-search-forward hs-block-start-regexp maxp t)))
     (when (save-match-data
-           (not (nth 4 (syntax-ppss)))) ; not inside comments
+           (not (nth 8 (syntax-ppss)))) ; not inside comments or strings
       (if (> arg 1)
          (hs-hide-level-recursive (1- arg) minp maxp)
        (goto-char (match-beginning hs-block-start-mdata-select))