From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Joel J. Adamson " Newsgroups: gmane.emacs.help Subject: Re: LISP routines for commenting Date: Fri, 08 Aug 2008 21:43:34 -0400 Message-ID: <4335.1218246214@email.unc.edu> References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1218246576 1095 80.91.229.12 (9 Aug 2008 01:49:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Aug 2008 01:49:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Alex Gusarov" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 09 03:50:26 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 1KRdb4-00024i-6K for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Aug 2008 03:50:22 +0200 Original-Received: from localhost ([127.0.0.1]:55730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRda8-0002fG-ID for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Aug 2008 21:49:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KRdZq-0002dY-1C for help-gnu-emacs@gnu.org; Fri, 08 Aug 2008 21:49:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KRdZn-0002dM-RH for help-gnu-emacs@gnu.org; Fri, 08 Aug 2008 21:49:04 -0400 Original-Received: from [199.232.76.173] (port=51846 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRdZn-0002dJ-Nd for help-gnu-emacs@gnu.org; Fri, 08 Aug 2008 21:49:03 -0400 Original-Received: from smtpsrv0.isis.unc.edu ([152.2.1.139]:44837 helo=smtp.unc.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KRdZn-0001u4-A5 for help-gnu-emacs@gnu.org; Fri, 08 Aug 2008 21:49:03 -0400 Original-Received: from edna.homeunix.org (cpe-066-057-101-159.nc.res.rr.com [66.57.101.159]) (authenticated bits=0) by smtp.unc.edu (8.13.4/8.13.4) with ESMTP id m791mFtG025115 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 8 Aug 2008 21:48:18 -0400 (EDT) Original-Received: from edna.homeunix.org (localhost [127.0.0.1]) by edna.homeunix.org (8.14.2/8.14.2) with ESMTP id m791hYVc004340; Fri, 8 Aug 2008 21:43:34 -0400 Original-Received: from email.unc.edu (joel@localhost) by edna.homeunix.org (8.14.2/8.14.2/Submit) with ESMTP id m791hYHY004336; Fri, 8 Aug 2008 21:43:34 -0400 X-Authentication-Warning: edna.homeunix.org: joel owned process doing -bs In-reply-to: Comments: In-reply-to "Alex Gusarov" message dated "Fri, 08 Aug 2008 15:36:22 +0700." X-Mailer: MH-E 8.0.3+cvs; nmh 1.3; GNU Emacs 23.0.60 X-detected-kernel: by monty-python.gnu.org: 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:56339 Archived-At: >>>>> "Alex" == Alex Gusarov writes: Alex> Hello, Alex> I want to implement some lisp functions for the following: Alex> 1. Insert comment - when mark some lines of code and using it, insert Alex> ins-comments, like this: Alex> before: Alex> l = [] Alex> l.append(1) Alex> then mark it and use ins-func, after: Alex> # ins > , Alex> l = [] Alex> l.append(1) Alex> # ins < , If I understand correctly, you want to implement some lisp to comment your Python code? Have you tried Python mode? There is a commonly used key (M-;) that comments lines and regions --- look up the function "comment-region." In each programming language mode, this function inserts the proper comments for the language you are using (e.g., ";" for lisp and "#" for Python, Perl, et al). Please be specific if you want something else. Joel -- Joel J. Adamson (303) 880-3109 Public key: http://pgp.mit.edu http://www.unc.edu/~adamsonj http://trashbird1240.blogspot.com