emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105873: Small hideshow fix - ignore


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105873: Small hideshow fix - ignore strings as well as comments (tiny change)
Date: Thu, 22 Sep 2011 00:24:08 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105873
fixes bug(s): http://debbugs.gnu.org/9502
author: Dima Kogan <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2011-09-22 00:24:08 -0700
message:
  Small hideshow fix - ignore strings as well as comments (tiny change)
  
  * lisp/progmodes/hideshow.el (hs-looking-at-block-start-p)
  (hs-find-block-beginning, hs-hide-level-recursive):
  Ignore strings as well as comments.
modified:
  lisp/ChangeLog
  lisp/progmodes/hideshow.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-22 07:05:40 +0000
+++ b/lisp/ChangeLog    2011-09-22 07:24:08 +0000
@@ -1,3 +1,9 @@
+2011-09-22  Dima Kogan  <address@hidden>  (tiny change)
+
+       * progmodes/hideshow.el (hs-looking-at-block-start-p)
+       (hs-find-block-beginning, hs-hide-level-recursive):
+       Ignore strings as well as comments.  (Bug#9502)
+
 2011-09-22  Andrew Schein  <address@hidden>  (tiny change)
 
        * progmodes/sql.el (sql-comint-postgres):

=== modified file 'lisp/progmodes/hideshow.el'
--- a/lisp/progmodes/hideshow.el        2011-05-28 18:35:29 +0000
+++ b/lisp/progmodes/hideshow.el        2011-09-22 07:24:08 +0000
@@ -539,7 +539,7 @@
 (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.
@@ -693,8 +693,8 @@
         (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 @@
            (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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]