From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 04:23:35 2011 Received: (at submit) by debbugs.gnu.org; 14 Sep 2011 08:23:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3kko-0007XH-1C for submit@debbugs.gnu.org; Wed, 14 Sep 2011 04:23:35 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3k75-0004EB-5H for submit@debbugs.gnu.org; Wed, 14 Sep 2011 03:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3k2c-0000B0-98 for submit@debbugs.gnu.org; Wed, 14 Sep 2011 03:37:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_TVD_MIME_NO_HEADERS autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:49501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3k2c-0000Aw-5p for submit@debbugs.gnu.org; Wed, 14 Sep 2011 03:37:54 -0400 Received: from eggs.gnu.org ([140.186.70.92]:43113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3k2Y-00032F-3R for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2011 03:37:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3k2S-00009m-Di for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2011 03:37:50 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.124]:63408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3k2S-00009G-7R for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2011 03:37:44 -0400 X-Authority-Analysis: v=1.1 cv=8/tC3RumM5rsUT5KRAstW8ZpQtAyVpHweSUJct9LT6E= c=1 sm=0 a=d-0ZG_wKo_UA:10 a=v7wRtcRC0aAA:10 a=syinx_Tw3_MA:10 a=8YMtuzaJ5FE3wtSInqJrPg==:17 a=cz3Tp05_fwVXJbveM74A:9 a=ncDVm-j7AAAA:8 a=SymZfQVOR78kzRsFMcMA:9 a=iFMZv00P5aE_SaS3JS4A:7 a=1TAlIYiSTWAA:10 a=8YMtuzaJ5FE3wtSInqJrPg==:117 X-Cloudmark-Score: 0 X-Originating-IP: 76.175.234.46 Received: from [76.175.234.46] ([76.175.234.46:52716] helo=smart) by hrndva-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 82/AD-05516-5C9507E4; Wed, 14 Sep 2011 07:37:41 +0000 Received: from dkogan by smart with local (Exim 4.76) (envelope-from ) id 1R3k3D-0007zh-C5 for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2011 00:38:31 -0700 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 23.3; [PATCH] hideshow no longer gets confused by characters in strings Date: Wed, 14 Sep 2011 00:38:31 -0700 Message-ID: <87zki760aw.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 14 Sep 2011 04:23:31 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --=-=-= 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-hideshow-now-doesn-t-get-confused-by-characters-in-c.patch Content-Description: patch >From d85459ad47b23dfc8fe2689cd3cc059e9c956544 Mon Sep 17 00:00:00 2001 From: Dima Kogan 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 --- 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 03:24:54 2011 Received: (at 9502-done) by debbugs.gnu.org; 22 Sep 2011 07:24:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6deO-0008Aa-Jz for submit@debbugs.gnu.org; Thu, 22 Sep 2011 03:24:53 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6deM-0008AS-4v for 9502-done@debbugs.gnu.org; Thu, 22 Sep 2011 03:24:51 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1R6de2-0004fO-I8; Thu, 22 Sep 2011 03:24:30 -0400 From: Glenn Morris To: 9502-done@debbugs.gnu.org Subject: Re: bug#9502: 23.3; [PATCH] hideshow no longer gets confused by characters in strings References: <87zki760aw.fsf@secretsauce.net> X-Spook: national information infrastructure JPL beanpole csim X-Ran: 6VtYc?5%$D7mo1$OG:K*xy{ (Dima Kogan's message of "Wed, 14 Sep 2011 00:38:31 -0700") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 9502-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) Version: 24.1 Thanks; applied. From unknown Fri Aug 15 04:08:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 20 Oct 2011 11:24:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator