From unknown Sat Aug 16 16:02:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#2381 <2381@debbugs.gnu.org> To: bug#2381 <2381@debbugs.gnu.org> Subject: Status: Python mode: python-shift-left and python-shift-right are not working if the region is inactive Reply-To: bug#2381 <2381@debbugs.gnu.org> Date: Sat, 16 Aug 2025 23:02:05 +0000 retitle 2381 Python mode: python-shift-left and python-shift-right are not = working if the region is inactive reassign 2381 emacs submitter 2381 Guillaume Salagnac severity 2381 normal thanks From guillaume.salagnac@gmail.com Wed Feb 18 22:54:03 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 19 Feb 2009 06:54:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1J6rxO3029166 for ; Wed, 18 Feb 2009 22:54:00 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1La2nH-00080L-0l for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 01:53:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1La2nE-0007xV-RA for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 01:53:58 -0500 Received: from [199.232.76.173] (port=32853 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1La2nE-0007xC-L2 for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 01:53:56 -0500 Received: from wa-out-1112.google.com ([209.85.146.176]:23711) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1La2nE-0006JI-4w for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2009 01:53:56 -0500 Received: by wa-out-1112.google.com with SMTP id k17so146656waf.26 for ; Wed, 18 Feb 2009 22:53:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:content-type :message-id:cc:content-transfer-encoding:from:subject:date:to :x-mailer; bh=JJm/gxg1ar/po7dyun7mECVUN4CqMuil5DJ3jce4Blk=; b=UUNWHjPYw7j1j9OSEYiznrC555UFgwhzAHwzcmNcmPk/dy5FlE6tENWWElWRHvTA85 AzCVHULaumQd1VPzrAtCR5ReH+wgAn/FLEC04WJzHyrTuqsA67O7BQUKYxXRLfTOcvfV 6ImZibudtux2LYRAm8GJnARrKGI6AGuasMzf0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:content-type:message-id:cc:content-transfer-encoding :from:subject:date:to:x-mailer; b=W122gkdn+OQ5VUih15s5nBYuoHwEfBXahY1flixYGdVhnnFj5rd+4PKRjVy0lRBBJA nXOp2DidUgiPiclFS1iczKPxLCWcnmrIJe8IaPhHCoknRN7QJCSXad8+l/Mpxk1K/3uG 1JYQ7bKX0VkHl1NgXEyPn5+y+lxjLcw53k1zQ= Received: by 10.115.92.2 with SMTP id u2mr3544584wal.137.1235026433213; Wed, 18 Feb 2009 22:53:53 -0800 (PST) Received: from ?140.253.32.116? (lois-ph.cat.csiro.au [140.253.32.116]) by mx.google.com with ESMTPS id m29sm1876396poh.20.2009.02.18.22.53.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 18 Feb 2009 22:53:52 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3D92E094-6B70-4489-A162-A5050842D94C@gmail.com> Cc: Guillaume Salagnac Content-Transfer-Encoding: 7bit From: Guillaume Salagnac Subject: Python mode: python-shift-left and python-shift-right are not working if the region is inactive Date: Thu, 19 Feb 2009 16:53:53 +1000 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.753.1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) In Python mode (the one provided by lisp/progmodes/python.el) there are two functions that look very handy for indenting/reindenting code : python-shift-left and python-shift-right. According to their documentation string, they can work either on the current active region, or on the current line if the region is not active. However, this latter feature does not seem to work properly. Steps to reproduce error: open emacs, type M-x python-mode, type some code, and try "C-c <" or "C-c >" with no active region. A simple fix seems to be achieved by replacing this "(point) (point)" default value, which is obviously empty, by "(line-beginning- position) (line-end-position)" in both functions. Cheers, -Guillaume Standard report-emacs-bug gibberish follows : In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3) of 2008-10-14 on rothera, modified by Debian (emacs-snapshot package, version 1:20081013-1) Windowing system distributor `The X.Org Foundation', version 11.0.10502000 configured using `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '-- libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/ info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable- locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/ 23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/ 23.0.60/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with- x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux- gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Python Minor modes in effect: tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x p y t h o n SPC m o d e i f SPC T r u e : x = 1 y = 1 C-c < M-x r e p o r t - e m a c s - b u g Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. call-interactively: End of buffer [4 times] From rudalics@gmx.at Fri Feb 20 08:33:43 2009 Received: (at 2381-done) by emacsbugs.donarmstrong.com; 20 Feb 2009 16:33:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=GMAIL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n1KGXclm008628 for <2381-done@emacsbugs.donarmstrong.com>; Fri, 20 Feb 2009 08:33:40 -0800 Received: (qmail invoked by alias); 20 Feb 2009 16:33:32 -0000 Received: from 62-47-63-147.adsl.highway.telekom.at (EHLO [62.47.63.147]) [62.47.63.147] by mail.gmx.net (mp020) with SMTP; 20 Feb 2009 17:33:32 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19YxRhK689YeQjgtmBm1FWY5RzxURafUgKNG62JMh ZuTHS3sEJNm3lq Message-ID: <499EDAEF.5010300@gmx.at> Date: Fri, 20 Feb 2009 17:31:43 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: 2381-done@debbugs.gnu.org CC: Guillaume Salagnac Subject: Re: bug#2381: Python mode: python-shift-left and python-shift-right are not working if the region is inactive References: <3D92E094-6B70-4489-A162-A5050842D94C@gmail.com> In-Reply-To: <3D92E094-6B70-4489-A162-A5050842D94C@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.66 > In Python mode (the one provided by lisp/progmodes/python.el) there are > two functions that look very handy for indenting/reindenting code : > python-shift-left and python-shift-right. > > According to their documentation string, they can work either on the > current active region, or on the current line if the region is not > active. However, this latter feature does not seem to work properly. > > Steps to reproduce error: open emacs, type M-x python-mode, type some > code, and try "C-c <" or "C-c >" with no active region. > > A simple fix seems to be achieved by replacing this "(point) (point)" > default value, which is obviously empty, by "(line-beginning-position) > (line-end-position)" in both functions. I checked in your suggestion as * progmodes/python.el (python-shift-left, python-shift-right): When the mark is not active shift the current line. (Bug#2381) Suggested by Guillaume Salagnac Thanks for the report, martin. From unknown Sat Aug 16 16:02:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sat, 21 Mar 2009 14:24:10 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator