From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: skeleton-pair-insert-maybe parenthesis in cc-mode Date: Tue, 06 Mar 2007 21:58:02 -0700 Message-ID: References: <1173120429.957158.273000@s48g2000cws.googlegroups.com> <1173121740.838492.322450@64g2000cwx.googlegroups.com> <1173142576.763318.150250@c51g2000cwc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1173243528 25486 80.91.229.12 (7 Mar 2007 04:58:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Mar 2007 04:58:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 07 05:58:41 2007 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 1HOoEa-00019N-4b for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Mar 2007 05:58:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOoEd-0002kc-6k for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Mar 2007 23:58:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HOoEQ-0002jt-1K for help-gnu-emacs@gnu.org; Tue, 06 Mar 2007 23:58:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HOoEN-0002jg-IM for help-gnu-emacs@gnu.org; Tue, 06 Mar 2007 23:58:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOoEN-0002jW-G2 for help-gnu-emacs@gnu.org; Tue, 06 Mar 2007 23:58:27 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HOoEI-0001lc-Ll for help-gnu-emacs@gnu.org; Tue, 06 Mar 2007 23:58:23 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HOoE1-00080x-DE for help-gnu-emacs@gnu.org; Wed, 07 Mar 2007 05:58:05 +0100 Original-Received: from c-24-9-156-178.hsd1.co.comcast.net ([24.9.156.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Mar 2007 05:58:05 +0100 Original-Received: from kevin.d.rodgers by c-24-9-156-178.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Mar 2007 05:58:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-24-9-156-178.hsd1.co.comcast.net User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) In-Reply-To: <1173142576.763318.150250@c51g2000cwc.googlegroups.com> X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:41740 Archived-At: [Please don't top-post.] stuart.tett@gmail.com wrote: > ( runs the command c-electric-paren > which is an interactive compiled Lisp function in `cc-cmds.el'. > It is bound to ), (. > When I am in a cc-mode file it returns: > > (c-electric-paren arg) > > Insert a parenthesis. > > If `c-syntactic-indentation' and `c-electric-flag' are both non-nil, > the > line is reindented unless a numeric arg is supplied, or the > parenthesis > is inserted inside a literal. > > Whitespace between a function name and the parenthesis may get added > or > removed; see the variable `c-cleanup-list'. > > Also, if `c-electric-flag' and `c-auto-newline' are both non-nil, some > newline cleanups are done if appropriate; see the variable `c-cleanup- > list'. > > In the *scratch* buffer it returns: > > ( runs the command skeleton-pair-insert-maybe > which is an interactive compiled Lisp function in `skeleton.el'. > It is bound to {, [, <, (, ', ". > (skeleton-pair-insert-maybe arg) > > Insert the character you type arg times. > > With no arg, if `skeleton-pair' is non-nil, pairing can occur. If the > region > is visible the pair is wrapped around it depending on `skeleton- > autowrap'. > Else, if `skeleton-pair-on-word' is non-nil or we are not before or > inside a > word, and if `skeleton-pair-filter-function' returns nil, pairing is > performed. > Pairing is also prohibited if we are right after a quoting character > such as backslash. > > If a match is found in `skeleton-pair-alist', that is inserted, else > the defaults are used. These are (), [], {}, <> and `' for the > symmetrical ones, and the same character twice for the others. Isn't it obvious: (add-hook 'c-mode-common-hook (lambda () (local-set-key "(" 'skeleton-pair-insert-maybe))) -- Kevin Rodgers Denver, Colorado, USA