From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: LISP routines for commenting Date: Sat, 09 Aug 2008 20:29:24 +0200 Message-ID: <87myjmujnf.fsf@tux.homenetwork> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218306789 2317 80.91.229.12 (9 Aug 2008 18:33:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Aug 2008 18:33:09 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, weber To: "Lennart Borgman \(gmail\)" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 09 20:34:00 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 1KRtGE-0001yU-6S for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Aug 2008 20:33:54 +0200 Original-Received: from localhost ([127.0.0.1]:45434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRtFG-0003Cs-R1 for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Aug 2008 14:32:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KRtEl-0003BM-Lv for help-gnu-emacs@gnu.org; Sat, 09 Aug 2008 14:32:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KRtEk-0003Ab-4B for help-gnu-emacs@gnu.org; Sat, 09 Aug 2008 14:32:23 -0400 Original-Received: from [199.232.76.173] (port=43940 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRtEk-0003AY-0s for help-gnu-emacs@gnu.org; Sat, 09 Aug 2008 14:32:22 -0400 Original-Received: from ik-out-1112.google.com ([66.249.90.183]:53804) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KRtEj-0006Ko-Iz for help-gnu-emacs@gnu.org; Sat, 09 Aug 2008 14:32:21 -0400 Original-Received: by ik-out-1112.google.com with SMTP id c21so1559152ika.2 for ; Sat, 09 Aug 2008 11:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=23gaskZivcIuHEmxJKf4jRCMhn9fIPpqsx3ZTGHGCOk=; b=Uo/gnF79S7HmwvsPqG3xD+Z0G37l0bhVV00Nzj1GGHDmhS8dOzOBhs1VhbkpEXeoM8 ssBgjRwk3FJHVv7aUvUNfLoD+n656Sjb5UO0syRHYVeYUn5uKXto3Bt7k2Cqp4XvaCbP uD7pP3t/NESNHRMNAy54QO8fBWl+HuhPF+AFU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=decYyDE8YNjf9pji7L6HNIQ+oQ6ro1iFyp60SqOTR02PM9DNYuK8eAWekKbeVlWv19 wkqB1Khhx6/O2PpVMiccge+hLyhlM6lD7IyMK6wYfuqZE+7KpNYBUEAFfyJ/HJt76rEP U27ngprjvS4Ih9UWOOE65Kd4KB5LqE00UJDs4= Original-Received: by 10.210.71.11 with SMTP id t11mr7207602eba.105.1218306740442; Sat, 09 Aug 2008 11:32:20 -0700 (PDT) Original-Received: from tux.homenetwork ( [77.197.77.142]) by mx.google.com with ESMTPS id z33sm3345962ikz.0.2008.08.09.11.32.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 09 Aug 2008 11:32:19 -0700 (PDT) In-Reply-To: <489DD5FE.104@gmail.com> (Lennart Borgman's message of "Sat, 09 Aug 2008 19:38:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:56372 Archived-At: "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