From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Davison Newsgroups: gmane.emacs.help Subject: Re: show-paren-mode / blink-matching-paren Date: Mon, 11 Aug 2008 11:18:47 +0100 Message-ID: <20080811101847.GC6250@stats.ox.ac.uk> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218450041 5502 80.91.229.12 (11 Aug 2008 10:20:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 10:20:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 12:21:32 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KSUWq-0006Yq-3V for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 12:21:32 +0200 Original-Received: from localhost ([127.0.0.1]:34343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSUVt-0007dW-QI for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 06:20:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSUUF-0006Zo-88 for help-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:18:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSUUD-0006YA-Ul for help-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:18:50 -0400 Original-Received: from [199.232.76.173] (port=52362 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSUUD-0006Xs-LB for help-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:18:49 -0400 Original-Received: from markov.stats.ox.ac.uk ([163.1.210.1]:49804) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSUUD-0003AU-3t for help-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:18:49 -0400 Original-Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id m7BAImPh003467 for ; Mon, 11 Aug 2008 11:18:48 +0100 (BST) Original-Received: by blackcap.stats.ox.ac.uk (Postfix, from userid 5158) id 0E83F18082; Mon, 11 Aug 2008 11:18:48 +0100 (BST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56445 Archived-At: On Mon, Aug 11, 2008 at 10:46:22AM +0200, Richard G Riley wrote: > > Dan Davison writes: > > > q1. I'd like show-paren-mode to wait show-paren-delay seconds, then > > show the matching paren, but only do so for some specified amount of > > time, before going away. However, I don't see a variable specifying > > how long to show the paren for. What I'm after is the following: > > whenever I'm curious about what the matching paren is of some closing > > paren, I can move point to after the closing paren, and it will show > > me, for a second or so. Currently it's seeming to me that I can > > achieve this with neither show-paren-mode nor blink-matching-paren > > (which only blinks on insertion, rather than point being next to > > paren). Any solutions? > > > > q2. A basic question: In my .emacs I'd like to turn on > > e.g. show-paren-mode in e.g. emacs-lisp mode only. How do I do that? > > Adding (show-paren-mode t) to my personal emacs-lisp mode hook turns > > it on in all buffers, right? > > http://www.emacswiki.org/cgi-bin/wiki/ShowParenMode > > See the bit about mode local to buffer: > > ,---- > | To make this mode local to the buffer use (make-variable-buffer-local ???show-paren-mode), add something like this to your .emacs: > | > | (defun lispy-parens () > | "Setup parens display for lisp modes" > | (setq show-paren-delay 0) > | (setq show-paren-style 'parenthesis) > | (make-variable-buffer-local 'show-paren-mode) > | (show-paren-mode 1) > | (set-face-background 'show-paren-match-face (face-background 'default)) > | (if (boundp 'font-lock-comment-face) > | (set-face-foreground 'show-paren-match-face > | (face-foreground 'font-lock-comment-face)) > | (set-face-foreground 'show-paren-match-face > | (face-foreground 'default))) ;; > | (set-face-foreground 'show-paren-match-face "red") > | (set-face-attribute 'show-paren-match-face nil :weight 'extra-bold)) > | > | (add-hook 'scheme-mode-hook 'lispy-parens) > | (add-hook 'lisp-mode-hook 'lispy-parens) > | (add-hook 'emacs-lisp-mode-hook 'lispy-parens) > `---- Nice. That's a lot more helpful than was my last reply to one of your posts... One thing is that the line I've commented out above seems to overwrite the previous expression, no? I've removed it from the Wiki. Someone shout at me if I'm getting this wrong. I am interested in the answer to q1, but OTOH I'm not so stressed about it now my matching parentheses have ceased to be horrendously ugly. Dan -- www.stats.ox.ac.uk/~davison