Anonymous avatar Anonymous committed 95a5de5

Make selection deletion optional in pc-select.

Comments (0)

Files changed (3)

+1998-07-25  SL Baur  <steve@altair.xemacs.org>
+
+	* pc-select.el (pc-select-keep-regions): New variable.
+	(pc-select-move-char-right): Use it.
+	(pc-select-move-char-left): Ditto.
+	(pc-select-move-word-right): Ditto.
+	(pc-select-move-word-left): Ditto.
+	(pc-select-move-line-up): Ditto.
+	(pc-select-move-line-down): Ditto.
+	(pc-select-move-bol): Ditto.
+	(pc-select-move-eol): Ditto.
+	(pc-select-move-page-up): Ditto.
+	(pc-select-move-page-down): Ditto.
+	(pc-select-move-bob): Ditto.
+	(pc-select-move-eob): Ditto.
+	(pc-select-toggle-regions): New function.  Allow toggling of
+	zmacs region retention.
+
 1998-04-22  Didier Verna  <verna@inf.enst.fr>
 
 	* pending-del.el (pending-delete-mode): ;;;###autoload the
 
 # This XEmacs package contains independent single file lisp packages
 
-VERSION = 1.10
+VERSION = 1.11
 AUTHOR_VERSION =
 MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
 PACKAGE = pc
 A value of nil means pc-select mode is not enabled.  A value of t
 indicates it is enabled.")
 
+(defvar pc-select-keep-regions nil
+  "Non-nil means that the zmacs region will be preserved on motion commands.")
+
 (defconst pc-select-version "1.4"
   "The version of the pc-select package.")
 
   "Move point right ARG characters, deselecting any marked region.
 Moves left if ARG is negative."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'forward-char)
   (forward-char arg))
 
   "Move point left ARG characters, deselecting any marked region.
 Moves right if ARG negative."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'backward-char)
   (forward-char (- arg)))
 
   "Move point right ARG words, deselecting any marked region.
 Moves left if ARG is negative."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'forward-word)
   (forward-word arg))
 
   "Move point left ARG words, deselecting any marked region.
 Moves right if ARG is negative."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'backward-word)
   (forward-word (- arg)))
 
   "Move point up ARG lines, deselecting any marked region.
 Moves down if ARG is negative."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'previous-line)
   (next-line (- arg)))
 
   "Move point down ARG lines, deselecting any marked region.
 Moves up if ARG is negative."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'next-line)
   (next-line arg))
 
 With argument ARG not nil or 1, move forward ARG - 1 lines first.
 If scan reaches end of buffer, stop there without error."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'beginning-of-line)
   (beginning-of-line arg))
 
 With argument ARG not nil or 1, move forward ARG -1 lines first.
 If scan reaches end of buffer, stop there without error."
   (interactive "p")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'end-of-line)
   (end-of-line arg))
 
 
 See `scroll-down' for further info."
   (interactive "P")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'scroll-down)
   (scroll-down arg))
 
 
 See `scroll-up' for further info."
   (interactive "P")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'scroll-up)
   (scroll-up arg))
 
 If the buffer is narrowed, this command uses the beginning and size
 of the accessible part of the buffer."
   (interactive "P")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'beginning-of-buffer)
   (beginning-of-buffer))
 
 If the buffer is narrowed, this command uses the beginning and size
 of the accessible part of the buffer."
   (interactive "P")
-  (setq zmacs-region-stays nil)
+  (setq zmacs-region-stays pc-select-keep-regions)
   (setq this-command 'end-of-buffer)
   (end-of-buffer))
 
       (setq minor-mode-alist
             (cons '(pc-select-enabled pc-select-modeline-string) minor-mode-alist))))
 
+(defun pc-select-toggle-regions (&optional force)
+  "Toggle region retention behavior."
+  (interactive "_P")
+  (if force
+      (setq pc-select-keep-regions t)
+    (setq pc-select-keep-regions (not pc-select-keep-regions))))
+
 (provide 'pc-select)
 
 ;;; pc-select.el ends here
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.