emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#9502: closed (23.3; [PATCH] hideshow no longer get


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#9502: closed (23.3; [PATCH] hideshow no longer gets confused by characters in strings)
Date: Thu, 22 Sep 2011 07:25:01 +0000

Your message dated Thu, 22 Sep 2011 03:24:30 -0400
with message-id <address@hidden>
and subject line Re: bug#9502: 23.3; [PATCH] hideshow no longer gets confused 
by characters in strings
has caused the debbugs.gnu.org bug report #9502,
regarding 23.3; [PATCH] hideshow no longer gets confused by characters in 
strings
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
9502: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9502
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 23.3; [PATCH] hideshow no longer gets confused by characters in strings Date: Wed, 14 Sep 2011 00:38:31 -0700
An earlier patch (bug 8279) made hideshow robust to various characters
appearing in comments. Here's a small patch that extends this, so that
hideshow becomes robust to various characters in strings also.

>From d85459ad47b23dfc8fe2689cd3cc059e9c956544 Mon Sep 17 00:00:00 2001
From: Dima Kogan <address@hidden>
Date: Wed, 14 Sep 2011 00:29:01 -0700
Subject: [PATCH] hideshow now doesn't get confused by characters in comments
 OR strings

Signed-off-by: Dima Kogan <address@hidden>
---
 lisp/progmodes/hideshow.el |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 49202ab..ca8be01 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -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.
@@ -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))
-- 
1.7.5.4


--- End Message ---
--- Begin Message --- Subject: Re: bug#9502: 23.3; [PATCH] hideshow no longer gets confused by characters in strings Date: Thu, 22 Sep 2011 03:24:30 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.1

Thanks; applied.


--- End Message ---

reply via email to

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