From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Alex Gusarov" Newsgroups: gmane.emacs.help Subject: Re: LISP routines for commenting Date: Thu, 14 Aug 2008 15:07:40 +0700 Message-ID: References: <87proi6tdp.fsf@tux.homenetwork> <489DC909.2080603@gmail.com> <87ljz66ry2.fsf@tux.homenetwork> <489DCFBE.3000807@gmail.com> <87r68yumwr.fsf@tux.homenetwork> <489DD5FE.104@gmail.com> <87myjmujnf.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218758188 3017 80.91.229.12 (14 Aug 2008 23:56:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2008 23:56:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, weber To: "Thierry Volpiatto" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 15 01:57:19 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 1KTmgv-0002FH-W1 for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Aug 2008 01:57:18 +0200 Original-Received: from localhost ([127.0.0.1]:48418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTmfz-0008Kh-Em for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2008 19:56:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTXs1-0006fo-5a for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 04:07:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTXrz-0006fH-BB for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 04:07:44 -0400 Original-Received: from [199.232.76.173] (port=57235 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTXrz-0006fB-5z for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 04:07:43 -0400 Original-Received: from rv-out-0708.google.com ([209.85.198.241]:49650) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTXry-0000Nk-Dk for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 04:07:42 -0400 Original-Received: by rv-out-0708.google.com with SMTP id k29so297802rvb.6 for ; Thu, 14 Aug 2008 01:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=mTr/F2/3UYh0ym3ubFvA/CKwbFqJVGH8tgyPZmZJPJ8=; b=v7oNgJ6MycIUbljDeWk0bdB4PCHdinxeb5fk4e0joZXhamNTzh9Ida2TjOp09mbu1U O+T465wgkCiYz8l9Bo9yDY6ZbeQ0R/odxdcdbzll6UTfVa0rgNfVpm5ZAIeNTH4KLir7 VS/rQ7ynuqt+1FbG2pXo2o9e3nbr0PmYZn2Y0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=LyQbzz0Cj3dqxCgwcQ35kauXM1X1QsLg5PxT4eVMl+pHhnj2Ebv8prox6rrp5DHtps fr04XLUv0FUElxM06CFPNDD7y8A5TyJrJqiDDsisgdsnbZxvG36J8W1xD2lhZWvPoiWK LmbluXQa3pRMRDTH8Lk/37aYOWPVTficNyx50= Original-Received: by 10.141.48.10 with SMTP id a10mr436928rvk.4.1218701260526; Thu, 14 Aug 2008 01:07:40 -0700 (PDT) Original-Received: by 10.140.143.16 with HTTP; Thu, 14 Aug 2008 01:07:40 -0700 (PDT) In-Reply-To: <87myjmujnf.fsf@tux.homenetwork> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-Mailman-Approved-At: Thu, 14 Aug 2008 19:55:59 -0400 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:56640 Archived-At: Thanks to everebody, I just returned from buisness trip and read your answers. weber - almost what I wanted, thank you for example, I will modify your example for my needs. On Sun, Aug 10, 2008 at 1:29 AM, Thierry Volpiatto wrote: > "Lennart Borgman (gmail)" writes: > >> Thierry Volpiatto wrote: >>> "Lennart Borgman (gmail)" writes: >>> >>>> Thierry Volpiatto wrote: >>>>> "Lennart Borgman (gmail)" writes: >>>>> >>>>>> Thierry Volpiatto wrote: >>>>>>> Python-mode provide a command for indenting that is bind to: >>>>>>> >>>>>>> C-c # ==> comment >>>>>>> C-u C-c # ==> uncomment >>>>>>> The command is: `py-comment-region' >>>>>>> >>>>>>> It is better to comment with that instead of the usual M-; >>>>>>> because it don't affect indentation after a block of commented code. >>>>>> Do you mean that this is a bug in the support for M-; in phyton-mode? >>>>>> Or is it a bug in M-; >>>>>> >>>>> I don't think it's a bug, it's just better to comment with the proper >>>>> function in python, especially if there is complex level of indentation >>>>> (loop followed with other loop and if if if...etc). >>>> But isn't there a bug somewhere if M-; does not do the right thing? >>> >>> Well, if emacs is meant to use python with python.el and it is working >>> fine with it, it is not a bug, but if M-; don't work properly with >>> python.el, yes, it is a bug! >> >> >> Don't you think that all major modes should support M-;? There are >> easy ways to do that. The doc strings says >> >> (comment-dwim arg) >> >> Call the comment command you want (Do What I Mean). >> If the region is active and `transient-mark-mode' is on, call >> `comment-region' (unless it only consists of comments, in which >> case it calls `uncomment-region'). >> Else, if the current line is empty, call `comment-insert-comment-function' >> if it is defined, otherwise insert a comment and indent it. >> Else if a prefix arg is specified, call `comment-kill'. >> Else, call `comment-indent'. >> You can configure `comment-style' to change the way regions are commented. >> > Yes, i think that is enabled and working (indenting a comment block). > That is not working always correctly is indenting code after a block of > comment if this comment is commented with M-;. May be it's only because > M-; comment with only one # with no space in front. > Sure it can be corrected, i never ask myself about that as i use C-c # > in python. > -- > A + Thierry Volpiatto > Location: Saint-Cyr-Sur-Mer - France > > > -- -- Best regards, Alex Gusarov