From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: python-mode: do not deactivate mark when shifting Date: Mon, 19 Feb 2007 15:35:25 +0000 Message-ID: <04A1645A-2665-480F-BECE-DF20E6FBFF50@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1171899355 25296 80.91.229.12 (19 Feb 2007 15:35:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2007 15:35:55 +0000 (UTC) To: emacs- devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 19 16:35:46 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 1HJAYL-0006p9-KT for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2007 16:35:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HJAYL-00057P-59 for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2007 10:35:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HJAY7-000541-VS for emacs-devel@gnu.org; Mon, 19 Feb 2007 10:35:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HJAY6-00051s-K8 for emacs-devel@gnu.org; Mon, 19 Feb 2007 10:35:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HJAY6-00051k-HG for emacs-devel@gnu.org; Mon, 19 Feb 2007 10:35:30 -0500 Original-Received: from ug-out-1314.google.com ([66.249.92.169]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HJAY6-00032Z-3a for emacs-devel@gnu.org; Mon, 19 Feb 2007 10:35:30 -0500 Original-Received: by ug-out-1314.google.com with SMTP id j3so654260ugf for ; Mon, 19 Feb 2007 07:35:29 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=BOJa1qQY57/M7g3JamIpug/J6JSPqxLGz2eaFInMXKZqVK4BHZvxiJQmHfs2bx39W+Ru1eqy+jyt7s+RfbXTnfirQ3Hz+Sfkz93/Rim9f309gCbJsjDqtUvhTTuZzhyTMT1+vDjmYfMnRjwQnB2M9w2hZFBXud65911MNpcP1M8= Original-Received: by 10.67.21.11 with SMTP id y11mr7023142ugi.1171899328888; Mon, 19 Feb 2007 07:35:28 -0800 (PST) Original-Received: from ?129.215.174.81? ( [129.215.174.81]) by mx.google.com with ESMTP id k1sm9216031ugf.2007.02.19.07.35.27; Mon, 19 Feb 2007 07:35:27 -0800 (PST) X-Mailer: Apple Mail (2.752.2) X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) 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:66526 Archived-At: Shifting the region in python is a common task, and more often than not, the command needs to be repeated on the same region. This patch leaves the region (visually) active rather than deactivating the mark. (Deactivating the mark suggests to transient-mark-mode / cua- mode users that the text needs to be selected again before the command can be repeated.) Please consider installing this if it's not a "dangerous" change. *** lisp/ChangeLog 19 Feb 2007 15:25:40 +0000 1.10707 --- lisp/ChangeLog 19 Feb 2007 15:28:53 +0000 *************** *** 1,3 **** --- 1,9 ---- + 2007-02-19 David Reitter + + * progmodes/python.el (python-shift-left, python-shift-right): Do + not deactivate the mark after shifting region so that the command + can be repeated with the region remaining (visually) active. + 2007-02-19 Juanma Barranquero * speedbar.el (speedbar-frame-mode, speedbar-frame-width) Index: python.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/python.el,v retrieving revision 1.53 diff -c -r1.53 python.el *** lisp/progmodes/python.el 21 Jan 2007 03:20:44 -0000 1.53 --- lisp/progmodes/python.el 19 Feb 2007 15:26:01 -0000 *************** *** 1784,1790 **** (not (looking-at "[ \t]*$"))) (error "Can't shift all lines enough")) (forward-line)) ! (indent-rigidly start end (- count))))) (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") --- 1784,1791 ---- (not (looking-at "[ \t]*$"))) (error "Can't shift all lines enough")) (forward-line)) ! (indent-rigidly start end (- count)))) ! (setq deactivate-mark nil)) (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") *************** *** 1799,1805 **** (if count (setq count (prefix-numeric-value count)) (setq count python-indent)) ! (indent-rigidly start end count)) (defun python-outline-level () "`outline-level' function for Python mode. --- 1800,1807 ---- (if count (setq count (prefix-numeric-value count)) (setq count python-indent)) ! (indent-rigidly start end count) ! (setq deactivate-mark nil)) (defun python-outline-level () "`outline-level' function for Python mode.