all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: caml-mode and show-paren-mode
Date: Tue, 19 Apr 2005 14:04:18 -0400	[thread overview]
Message-ID: <jwvis2ive3e.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <quack.20050418T2219.87mzrvfimp@quack.cs.berkeley.edu> (Karl Chen's message of "Mon, 18 Apr 2005 22:19:42 -0700")

> 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: 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.

  parent reply	other threads:[~2005-04-19 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19  5:19 caml-mode and show-paren-mode Karl Chen
2005-04-19 16:13 ` Richard Stallman
2005-04-19 18:04 ` Stefan Monnier [this message]
2005-04-20  1:03   ` Karl Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvis2ive3e.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.