[Top][All Lists]

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

Re: Automatic matching parenthesis

From: Kevin Rodgers
Subject: Re: Automatic matching parenthesis
Date: Tue, 17 Mar 2009 22:05:09 -0600
User-agent: Thunderbird (Macintosh/20081209)

address@hidden wrote:
On 16 Mrz., 11:24, Andy Stewart <address@hidden> wrote:

<address@hidden> writes:
added these lines to my .emacs-file, so that parenthesis are
automatically matched:
(setq skeleton-pair t)
(global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "{") 'skeleton-pair-insert-maybe)
But it does not work in cc-mode. Any idea?
Why not use paredit.el?

It can complete your parenthesis, it won't complete paranthesis when you
type in comment.

I think paredit.el is very nice for parenthesis completion.


  -- Andy

Thanks alot. But I cant figure out, how to enable paredit alway in c-
mode. I tried:
(add-hook c-mode-hook (lambda () (paredit-mode +1))). I get an error
message starting up emacs. Any idea?

emacs --debug-init will show you the error, and then you can show us so
we don't have to guess.

But one thing is apparent: add-hook is a function, so all its arguments
are evaluated, so you need to quote the c-mode-hook symbol:

(add-hook 'c-mode-hook (lambda () (paredit-mode +1)))

Kevin Rodgers
Denver, Colorado, USA

reply via email to

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