From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: caml-mode and show-paren-mode Date: Tue, 19 Apr 2005 14:04:18 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1113933909 32292 80.91.229.2 (19 Apr 2005 18:05:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Apr 2005 18:05:09 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 19 20:05:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DNx5C-00025Z-OS for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2005 20:04:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DNx9Y-00047m-JY for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2005 14:08:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DNx71-0003QO-AQ for emacs-devel@gnu.org; Tue, 19 Apr 2005 14:06:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DNx70-0003Q3-9D for emacs-devel@gnu.org; Tue, 19 Apr 2005 14:06:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DNx70-0002Nz-3T for emacs-devel@gnu.org; Tue, 19 Apr 2005 14:06:14 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DNx7E-0001EJ-Ox for emacs-devel@gnu.org; Tue, 19 Apr 2005 14:06:28 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id BDD16340022; Tue, 19 Apr 2005 14:04:22 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 5ACE72CC045; Tue, 19 Apr 2005 14:04:19 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 36406E6BD4; Tue, 19 Apr 2005 14:04:19 -0400 (EDT) Original-To: quarl+dated+1114319893.e7da33@nospam.quarl.org In-Reply-To: (Karl Chen's message of "Mon, 18 Apr 2005 22:19:42 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.835, requis 5, autolearn=not spam, AWL 0.07, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36120 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36120 > Does anyone use both caml-mode and show-paren-mode? > Show-paren-mode in caml-mode in Emacs CVS HEAD doesn't highlight > parens, but in Emacs 21.4 does. The patch below should fix the problem. Can you confirm? Stefan --- paren.el 08 d=E9c 2004 16:41:48 -0500 1.60 +++ paren.el 19 avr 2005 14:03:06 -0400=09 @@ -1,6 +1,6 @@ ;;; paren.el --- highlight matching paren =20 -;; Copyright (C) 1993, 1996, 2001, 2004 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1996, 2001, 2004, 2005 Free Software Foundation, I= nc. =20 ;; Author: rms@gnu.org ;; Maintainer: FSF @@ -139,8 +139,9 @@ (defun show-paren-function () (if show-paren-mode (let ((oldpos (point)) - (dir (cond ((eq (car (syntax-after (1- (point)))) 5) -1) - ((eq (car (syntax-after (point))) 4) 1))) + (dir (cond + ((eq (logand (car (syntax-after (1- (point)))) 255) 5) -= 1) + ((eq (logand (car (syntax-after (point))) 255) 4) 1))) pos mismatch face) ;; ;; Find the other end of the sexp. @@ -169,7 +170,7 @@ ;; kind of paren to match the one we started at. (when (integerp pos) (let ((beg (min pos oldpos)) (end (max pos oldpos))) - (unless (eq (car (syntax-after beg)) 8) ;Not syntax `$'. + (unless (eq (logand (car (syntax-after beg)) 255) 8) (setq mismatch (not (or (eq (char-before end) ;; This can give nil.