From: "Alex Gusarov" <alex.m.gusarov@gmail.com>
To: "Thierry Volpiatto" <thierry.volpiatto@gmail.com>
Cc: help-gnu-emacs@gnu.org, weber <hugows@gmail.com>
Subject: Re: LISP routines for commenting
Date: Thu, 14 Aug 2008 15:07:40 +0700 [thread overview]
Message-ID: <ac6dcb3d0808140107k7393acedt82fbb8e576869912@mail.gmail.com> (raw)
In-Reply-To: <87myjmujnf.fsf@tux.homenetwork>
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
<thierry.volpiatto@gmail.com> wrote:
> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
>
>> Thierry Volpiatto wrote:
>>> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
>>>
>>>> Thierry Volpiatto wrote:
>>>>> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> 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
prev parent reply other threads:[~2008-08-14 8:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 8:36 LISP routines for commenting Alex Gusarov
2008-08-09 1:43 ` Joel J. Adamson
[not found] ` <mailman.16147.1218246548.18990.help-gnu-emacs@gnu.org>
2008-08-09 14:43 ` weber
2008-08-09 16:33 ` Thierry Volpiatto
2008-08-09 16:42 ` Lennart Borgman (gmail)
2008-08-09 17:04 ` Thierry Volpiatto
2008-08-09 17:11 ` Lennart Borgman (gmail)
2008-08-09 17:19 ` Thierry Volpiatto
2008-08-09 17:38 ` Lennart Borgman (gmail)
2008-08-09 18:29 ` Thierry Volpiatto
2008-08-14 8:07 ` Alex Gusarov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac6dcb3d0808140107k7393acedt82fbb8e576869912@mail.gmail.com \
--to=alex.m.gusarov@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=hugows@gmail.com \
--cc=thierry.volpiatto@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.