emacs-devel
[Top][All Lists]
Advanced

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

Re: caml-mode and show-paren-mode


From: Stefan Monnier
Subject: Re: caml-mode and show-paren-mode
Date: Tue, 19 Apr 2005 14:04:18 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> 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éc 2004 16:41:48 -0500      1.60
+++ paren.el    19 avr 2005 14:03:06 -0400      
@@ -1,6 +1,6 @@
 ;;; paren.el --- highlight matching paren
 
-;; Copyright (C) 1993, 1996, 2001, 2004  Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1996, 2001, 2004, 2005  Free Software Foundation, Inc.
 
 ;; Author: address@hidden
 ;; 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.




reply via email to

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