From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#8169: 23.2; wrong fontification in gdb-script Date: Thu, 03 Mar 2011 23:49:10 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299215242 12854 80.91.229.12 (4 Mar 2011 05:07:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2011 05:07:22 +0000 (UTC) Cc: 8169@debbugs.gnu.org To: Tom Tromey Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 04 06:07:11 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PvNEL-000608-12 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Mar 2011 06:07:09 +0100 Original-Received: from localhost ([127.0.0.1]:38742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvNEK-0003Yk-7m for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Mar 2011 00:07:08 -0500 Original-Received: from [140.186.70.92] (port=36442 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvNE5-0003Sv-Q6 for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 00:06:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvNE4-0007x1-SJ for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 00:06:53 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvNE4-0007wx-KR for bug-gnu-emacs@gnu.org; Fri, 04 Mar 2011 00:06:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PvMxm-0006nz-PP; Thu, 03 Mar 2011 23:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Mar 2011 04:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8169 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8169-submit@debbugs.gnu.org id=B8169.129921416026110 (code B ref 8169); Fri, 04 Mar 2011 04:50:02 +0000 Original-Received: (at 8169) by debbugs.gnu.org; 4 Mar 2011 04:49:20 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvMx6-0006n5-9K for submit@debbugs.gnu.org; Thu, 03 Mar 2011 23:49:20 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvMx3-0006ms-LU for 8169@debbugs.gnu.org; Thu, 03 Mar 2011 23:49:18 -0500 Original-Received: from [207.96.179.97] (port=52876 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PvMwy-0002Cl-6D; Thu, 03 Mar 2011 23:49:12 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id E98FC660D6; Thu, 3 Mar 2011 23:49:10 -0500 (EST) In-Reply-To: (Tom Tromey's message of "Thu, 03 Mar 2011 14:03:26 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 03 Mar 2011 23:50:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44612 Archived-At: >>>>> "Tom" == Tom Tromey writes: > Visit a file named .gdbinit and enter: > define something > echo hi > # a comment > end > Notice that "end" is incorrect given the comment face. > This happens due to some logic in gdb-script-syntax-propertize-function. > It overrides the comment-end syntax on the newline. But, this is > only really ok if the newline is actually part of a "document" command. Good point. The patch below fixes this case, I think. Stefan "can't commit right now" === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2011-01-25 20:26:05 +0000 +++ lisp/progmodes/gud.el 2011-03-04 04:47:29 +0000 @@ -3128,7 +3128,9 @@ ("^document\\s-.*\\(\n\\)" (1 "< b")) ("^end\\(\\>\\)" (1 (ignore - (unless (eq (match-beginning 0) (point-min)) + (when (and (> (match-beginning 0) (point-min)) + (eq 1 (nth 7 (save-excursion + (syntax-ppss (1- (match-beginning 0))))))) ;; We change the \n in front, which is more difficult, but results ;; in better highlighting. If the doc is empty, the single \n is ;; both the beginning and the end of the docstring, which can't be