From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Alexander Tsamutali" Newsgroups: gmane.emacs.help Subject: Re: Indentation in python.el after "Enter" Date: Wed, 11 Jul 2007 14:07:13 +0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184144866 891 80.91.229.12 (11 Jul 2007 09:07:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2007 09:07:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 11 11:07:44 2007 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 1I8YAg-00020g-Mp for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 11:07:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8YAf-0002Mg-Rk for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 05:07:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8YAI-0002MJ-D7 for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 05:07:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8YAG-0002M7-9e for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 05:07:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8YAF-0002M4-Ke for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 05:07:16 -0400 Original-Received: from py-out-1112.google.com ([64.233.166.179]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I8YAF-0007MN-0m for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 05:07:15 -0400 Original-Received: by py-out-1112.google.com with SMTP id f31so3581326pyh for ; Wed, 11 Jul 2007 02:07:14 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PPUZfy49L5ZVY0O9nhun/x496FlvdoQxG1Vbz7evarsDJuns8Ohh+lgW2TrqgKgRPd0yDPmUhk1BCBLRAOpBYhfcwuJRNNpcURErpO+WByDsasqZMrrQJkE/hju17MSjT76uQX6w1iC55Nx/SLF3AVGVolD+dpdlHRrfmPO/Jjk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=l+KRF+huj1PuaJAUFBln6rFtuUT2B0szWZGKqSUgiF2UGPuLQBe4JSMtlq2TkBITGwOIzTdql10JEwtrPkePn3a6cLzfPL0IbOyggeT/R8ftQLD3avc8FBzAZfPuoc+xK0+bgR7DRvYDvhFTlxgHXxWZ+AP/1Jh8imHkBVjDKgY= Original-Received: by 10.65.126.16 with SMTP id d16mr6185751qbn.1184144833830; Wed, 11 Jul 2007 02:07:13 -0700 (PDT) Original-Received: by 10.65.196.1 with HTTP; Wed, 11 Jul 2007 02:07:13 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: 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:45589 Archived-At: > If you press C-j instead of Enter, does python.el do what you want? > If so, all you need to do is bind the command that C-j runs to the > Enter (a.k.a. C-m) key in the python-mode-hook. Thanks a lot! It works! I added the following to my .emacs: (add-hook 'python-mode-hook (lambda () (define-key python-mode-map "\C-m" 'newline-and-indent))) Then i found solution to my problem on EmacsWiki (http://www.emacswiki.org/cgi-bin/wiki/PythonMode) They recommend to add the following to .emacs: (define-key python-mode-map "\C-m" 'newline-and-indent) I can guess that first variant modifies key bindings only in python mode and second modifies key bindings globally. Am i right? -- Alexander Tsamutali