From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.devel Subject: Re: dedent in Python-mode Date: Mon, 25 Jun 2007 01:44:32 +0200 Message-ID: <864pkw534v.fsf@gmx.at> References: <200706242344.06799.pogonyshev@gmx.net> <200706250056.16210.pogonyshev@gmx.net> <86odj5ovie.fsf@gmx.at> <200706250130.30535.pogonyshev@gmx.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182728702 11268 80.91.229.12 (24 Jun 2007 23:45:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2007 23:45:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Pogonyshev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 25 01:45:00 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I2blI-0005nZ-1q for ged-emacs-devel@m.gmane.org; Mon, 25 Jun 2007 01:44:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2blH-0005rJ-1A for ged-emacs-devel@m.gmane.org; Sun, 24 Jun 2007 19:44:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2blC-0005mU-Ct for emacs-devel@gnu.org; Sun, 24 Jun 2007 19:44:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2bl9-0005k2-Rg for emacs-devel@gnu.org; Sun, 24 Jun 2007 19:44:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2bl9-0005jp-Nj for emacs-devel@gnu.org; Sun, 24 Jun 2007 19:44:47 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1I2bl9-0006gC-3z for emacs-devel@gnu.org; Sun, 24 Jun 2007 19:44:47 -0400 Original-Received: (qmail invoked by alias); 24 Jun 2007 23:44:45 -0000 Original-Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO siduxbox) [62.178.240.212] by mail.gmx.net (mp001) with SMTP; 25 Jun 2007 01:44:45 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19x5eYrJU1xtbOqMZce6mRaAJ9RwqoTm1AO75L57O 7UUVNdASMypM51 In-Reply-To: <200706250130.30535.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Mon\, 25 Jun 2007 01\:30\:30 +0300") X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:73779 Archived-At: Paul Pogonyshev writes: > Can it then behave like TAB, but if this doesn't change indentation > at all, then start dedenting from what TAB proposes as default? Put this in your .emacs: (defun python-personal-dedent () (interactive) (let ((cyclic 'python-indent-line-backward) (old (current-indentation))) (setq this-command cyclic) (python-indent-line-backward) (setq last-command cyclic) (when (and (> python-indent-list-length 1) (= old (current-indentation))) (python-indent-line-backward)))) (add-hook 'python-mode-hook (lambda () (local-set-key [backtab] 'python-personal-dedent)))