all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Reitter <david.reitter@gmail.com>
To: emacs- devel <emacs-devel@gnu.org>
Subject: python-mode: do not deactivate mark when shifting
Date: Mon, 19 Feb 2007 15:35:25 +0000	[thread overview]
Message-ID: <04A1645A-2665-480F-BECE-DF20E6FBFF50@gmail.com> (raw)

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  <david.reitter@gmail.com>
+
+ 	* 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  <lekktu@gmail.com>

   	* 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.

             reply	other threads:[~2007-02-19 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-19 15:35 David Reitter [this message]
2007-02-20 22:32 ` python-mode: do not deactivate mark when shifting Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04A1645A-2665-480F-BECE-DF20E6FBFF50@gmail.com \
    --to=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.