From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.devel Subject: Re: python-mode: keep mark when shifting [patch] Date: Mon, 13 Mar 2006 00:22:49 +0000 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1142209439 9261 80.91.229.2 (13 Mar 2006 00:23:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Mar 2006 00:23:59 +0000 (UTC) Cc: David Reitter , emacs-devel@gnu.org, henrik.enberg@telia.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 13 01:23:57 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FIaqG-0006GH-8C for ged-emacs-devel@m.gmane.org; Mon, 13 Mar 2006 01:23:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FIaqF-0000Jv-Lx for ged-emacs-devel@m.gmane.org; Sun, 12 Mar 2006 19:23:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FIaq2-0000Je-Ic for emacs-devel@gnu.org; Sun, 12 Mar 2006 19:23:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FIaq1-0000JP-0F for emacs-devel@gnu.org; Sun, 12 Mar 2006 19:23:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FIaq0-0000JM-U4 for emacs-devel@gnu.org; Sun, 12 Mar 2006 19:23:04 -0500 Original-Received: from [217.158.120.143] (helo=mail.ukfsn.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FIato-0006lp-HJ; Sun, 12 Mar 2006 19:27:00 -0500 Original-Received: from localhost (84-45-211-153.no-dns-yet.enta.net [84.45.211.153]) by mail.ukfsn.org (Postfix) with ESMTP id 708B7E7074; Mon, 13 Mar 2006 00:22:43 +0000 (GMT) Original-Received: from fx by localhost with local (Exim 4.52) id 1FIapm-0000QQ-O8; Mon, 13 Mar 2006 00:22:52 +0000 Original-To: Richard Stallman X-Draft-From: ("nndoc:nnml:Misc-119" 1) In-Reply-To: Richard Stallman's message of "12-Mar-2006 12:47" User-Agent: Gnus/5.11 (Gnus v5.11) 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:51540 Archived-At: Richard Stallman writes: > In C or Lisp I > would use C-u TAB to shift a subexpression to the proper position. > (There's no need to specify left or right, because the command figures > that out.) Could that work in Python mode? There isn't a single correct indentation in general. (TAB cycles between the valid values.) Note that Python mode obeys the Emacs conventions for indentation commands, unlike Lisp mode. It just binds `indent-line-function', which doesn't take an arg. It would probably make sense for C-u TAB to re-indent the rest of a block rigidly when used on the head line of the block, and/or to have TAB act on the region when it's active, but there are better things to spend time on. The shift-region functions are inherited from the old python-mode.el and may or may not really be a good idea. > I recall Python is weird in regard to indentation. Maybe it simply > needs different kinds of commands from those needed by other > languages. Python uses something like Landin's offside rule to define blocks by indentation. I don't think it needs different commands, though the behaviour of TAB is unusual -- successive use cycles between the valid indentations for a line (like in Haskell mode).