all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@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: Sat, 09 Aug 2008 19:38:06 +0200	[thread overview]
Message-ID: <489DD5FE.104@gmail.com> (raw)
In-Reply-To: <87r68yumwr.fsf@tux.homenetwork>

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.




  reply	other threads:[~2008-08-09 17:38 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) [this message]
2008-08-09 18:29                 ` Thierry Volpiatto
2008-08-14  8:07                   ` Alex Gusarov

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=489DD5FE.104@gmail.com \
    --to=lennart.borgman@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.