From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Flaschen Newsgroups: gmane.emacs.help Subject: Re: Insert ; after closing parenthesis when on it Date: Wed, 14 Feb 2007 15:41:45 -0500 Message-ID: <45D37409.5070709@gatech.edu> References: <1171479816.170529.163000@a75g2000cwd.googlegroups.com> <87lkj0lcvc.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1823640040==" X-Trace: sea.gmane.org 1171485733 20113 80.91.229.12 (14 Feb 2007 20:42:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Feb 2007 20:42:13 +0000 (UTC) To: emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 14 21:42:06 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 1HHQx4-0001n5-2y for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Feb 2007 21:42:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HHQx3-0004dI-H4 for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Feb 2007 15:42:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HHQwp-0004dD-CS for help-gnu-emacs@gnu.org; Wed, 14 Feb 2007 15:41:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HHQwo-0004cw-2K for help-gnu-emacs@gnu.org; Wed, 14 Feb 2007 15:41:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HHQwn-0004ct-SC for help-gnu-emacs@gnu.org; Wed, 14 Feb 2007 15:41:49 -0500 Original-Received: from deliverator5.gatech.edu ([130.207.165.165]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1HHQwn-0008Me-HW for help-gnu-emacs@gnu.org; Wed, 14 Feb 2007 15:41:49 -0500 Original-Received: from deliverator5.gatech.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id DB9AE1D19AA for ; Wed, 14 Feb 2007 15:41:46 -0500 (EST) (envelope-from matthew.flaschen@gatech.edu) Original-Received: from mailprx4.gatech.edu (mailprx4.prism.gatech.edu [130.207.171.18]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "smtp.mail.gatech.edu", Issuer "RSA Data Security, Inc." (verified OK)) by deliverator5.gatech.edu (Postfix) with ESMTP id 9D29A1D19C9 for ; Wed, 14 Feb 2007 15:41:46 -0500 (EST) (envelope-from matthew.flaschen@gatech.edu) Original-Received: from [128.61.73.81] (r73h81.res.gatech.edu [128.61.73.81]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (sasl: method=PLAIN, username=mflaschen3@mailprx4.gatech.edu, sender=n/a) by mailprx4.gatech.edu (Postfix) with ESMTP id 4DE2821AA for ; Wed, 14 Feb 2007 15:41:46 -0500 (EST) (envelope-from matthew.flaschen@gatech.edu) User-Agent: Thunderbird 1.5.0.9 (X11/20070103) In-Reply-To: <87lkj0lcvc.fsf@gmail.com> X-Enigmail-Version: 0.94.1.2 X-detected-kernel: Solaris 9 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:41218 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============1823640040== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE03A6F73BBC800E85434A36B" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE03A6F73BBC800E85434A36B Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Jiri Pejchal wrote: > "weber" writes: >=20 >> There's probably a faster way, but the way I know is remapping the ';'= >> key like this: >> >> (global-set-key ";" 'insert-closepar) >> >> where the function insert-closepar would be something like this >> (tested) : >> >> (defun insert-closepar () >> "Close parenthesis Jiri's way" >> (interactive) >> (if (looking-at ")") >> (forward-char)) >> (insert ";")) >> >> Oh, and you probably don't want to make that binding global map, >> because you are only going to use it on specific modes. Try doing: >> (define-key somelanguage-mode-map ";" 'insert-closepar) >=20 > Thanks a lot! But I would like to keep the electric behaviour of ';' > too. It's bound to c-electric-semi&comma. Try changing it to: (defun insert-closepar () "Close parenthesis Jiri's way" (interactive) (if (looking-at ")") (forward-char)) (c-electric-semi&comma)) Matthew Flaschen --------------enigE03A6F73BBC800E85434A36B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF03QJQ5LSyju97VkRAkLHAKCa3p4w3zSqlOPI1vgBsx3UBJWjZgCgpi+5 Y+vMNatd2lE6mFiQ7DRD9mk= =+hr0 -----END PGP SIGNATURE----- --------------enigE03A6F73BBC800E85434A36B-- --===============1823640040== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============1823640040==--