From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Torsten Anders Newsgroups: gmane.emacs.bugs Subject: Multi-line comment font-lock problem for lisp-mode Date: 12 Feb 2003 16:51:36 +0000 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1045068696.1262.329.camel@chewa> References: <1045050067.1269.225.camel@chewa> <871y2dsmm6.fsf@lynx.ionific.com> <1045061050.29866.273.camel@chewa> <87y94lqyyd.fsf@lynx.ionific.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1045072045 30563 80.91.224.249 (12 Feb 2003 17:47:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 12 Feb 2003 17:47:25 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18j0kF-0006kA-00 for ; Wed, 12 Feb 2003 18:32:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18j0lN-0007Gm-04 for gnu-bug-gnu-emacs@m.gmane.org; Wed, 12 Feb 2003 12:33:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18j0lA-0007Er-00 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2003 12:33:24 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18j0l8-0007Dn-00 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2003 12:33:22 -0500 Original-Received: from jeremiah.qub.ac.uk ([143.117.14.29] helo=mailhub2.qub.ac.uk) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18j0l7-0006F0-00 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2003 12:33:21 -0500 Original-Received: from fujin.qub.ac.uk by mailhub2.qub.ac.uk with SMTP-CENTRAL (XT-PP) with ESMTP; Wed, 12 Feb 2003 16:51:51 +0000 Original-Received: from [143.117.78.35] (helo=[143.117.78.35]) by fujin.qub.ac.uk with esmtp (Exim 3.35 #1) id 18j06t-0003lY-00 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2003 16:51:47 +0000 Original-To: bug-gnu-emacs@gnu.org In-Reply-To: <87y94lqyyd.fsf@lynx.ionific.com> X-Mailer: Ximian Evolution 1.2.1 (1.2.1-1) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4436 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4436 Hi, I came across some strange of the fontification of multi-line comments in lisp mode. I am used to put some tests calls in my code (commented out). So I surround them by #| and |#. Emacs colours multi-line comments properly as long as they only contain text. But as soon as I put code in the comment (i.e. a line starting with an open parenthesis), the colouring becomes, well, strange (i.e. rather complicated behaviour). E.g., all code after the multi-line comment (i.e. starting with the the | in |#) is coloured in string face (up the the next |). To give an example, the following behaves as expected. (defun foo () t) #| (defun foo () t) (defparameter *hop* 1) |# (defun foo () t) But just add a newline between the two expressions commented out, and you probably see what I am speaking about. (defun foo () t) #| (defun foo () t) (defparameter *hop* 1) |# (defun foo () t) Remove this newline again: colouring does not change back. You might argue: OK, just use only a single expression per comment. But change anything in the comment (e.g. add a space) and wait a few seconds... (defun foo () t) #| (defun foo (x) (+ x x) |# (defun foo () t) Or try a more complex comment (just some arbitrary code...): (defun foo () t) #| (defun convert-to-package (form from-package to-package) (if (eq (find-package from-package) (find-package to-package)) form (cond ((null form) nil) ((listp form) (loop for item in form collect (convert-to-package item from-package to-package))) ((constantp form) form) ((symbolp form) (if (eq (symbol-package form) (find-package from-package)) (intern (symbol-name form) to-package) ; converts it to to-package form)) ; pass it unchanged otherwise (T (error "Do not know how to handle ~A" form))))) |# (defun foo () t) I read in the Emacs doc that an open parenthesis always starts a new code block (e.g. a defun). But this behaviour looks somewhat more complex ;-) Anyway, is this a bug? Or is there some way to switch of this behaviour? Thanks! Kind regards, Torsten Anders PS: I am running GNU-Emacs 21.2 on a RH 8.0 Linux box (I believe I also saw this problem on Emacs running on Win). PPS: I am not subscribed to bug-gnu-emacs@gnu.org -- Torsten Anders Sonic Arts Research Centre Queens University Belfast Tel: +44 28 9027 4831 (office) +44 28 9066 7439 (private)