help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Commenting out block of code in emacs in python mode


From: Thierry Volpiatto
Subject: Re: Commenting out block of code in emacs in python mode
Date: Thu, 14 Jan 2010 08:23:33 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.91 (gnu/linux)

John Bokma <address@hidden> writes:

> alex47387 <address@hidden> writes:
>
>> Hi,
>>
>> I hope I am posting this question in the right forum; otherwise please let
>> me know. 
>>
>> Here is my problem:
>> I usually develop python code with emacs, emacs being in python code. On my
>> desktop a version is installed and/or configured that way, so I easily can
>> choose a region in the code and simply click on a menu option to comment out
>> this block of code (i.e. at the begin of each line in the selected code two
>> '##' are put). That is very convenient.
>> However, on my Laptop, running F12 and emacs 23.1.1, this menu option is
>> missing! I searched within google and found the hint that by pressing 'C-c
>> #' I also can comment out a selected region. But on my emacs it says: 'C-c #
>> is undefined'. Am I missing something? Anyone any idea how to
>> fix/install/update/solve this problem, so I can easily choose a couple of
>> python lines and comment them out?
>
> M-;   comment DWIM, works on selected region

C-c # is a command of python-mode.el, that is not part of Emacs.
To uncomment you have just to C-u C-c #.

However,you are probably using the python mode that come with emacs.
So with this less mode you will have to use M-; that can lead to
problems of indentation in the lines that come after commented lines
made with M-;.

So if you work a lot on python, you should use python-mode.el.
 
-- 
Thierry Volpiatto





reply via email to

[Prev in Thread] Current Thread [Next in Thread]