Commits

steveb  committed 5e6c1a2

Fixes for pc-select.el

  • Participants
  • Parent commits 65a5ed6

Comments (0)

Files changed (4)

+_pkg.el
+auto-autoloads.el
+custom-load.el
+package-info
+1998-02-25  SL Baur  <steve@altair.xemacs.org>
+
+	* pc-select.el-1.5.
+	From Gary D. Foster <gfoster@suzieq.ml.org>
+
 1998-02-01  SL Baur  <steve@altair.xemacs.org>
 
 	* pending-del.el (pending-delete-active-region): Fixes for
 
 # This XEmacs package contains independent single file lisp packages
 
-VERSION = 1.06
+VERSION = 1.07
 AUTHOR_VERSION =
 MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
 PACKAGE = pc

File pc-select.el

 
 ;; Author: Gary D. Foster <Gary.Foster@sun.com>
 ;; Created: 23 Dec 1997
-;; Version: 1.4
+;; Version: 1.5
 ;; Keywords: hardware, mouse
 
 ;; This file is part of XEmacs.
 ;; Note: This package enables (and is dependant upon) pending-del mode
 ;; when the pc-select minor mode is enabled.
 
+;;; $Log$
+;;; Revision 1.5  1998/02/20 06:25:28  gfoster
+;;; Fixed a really esoteric bug where point position wasn't being
+;;; preserved exactly when traversing ragged lines.
+;;;
+;;; Kudos to Erik Sundermann <erik@petaxp.rug.ac.be> for
+;;; spotting this.
+;;;
+;;; Also, switched to using '(forward-char (- arg))' style
+;;; routines which (according to Hrvoje) should be a
+;;; skosh faster.
+;;;
+
 ;;; Revision 1.4  1997/12/29 21:08:06  gfoster
 ;;; Added a bunch of keybindings (prior/next/home/end and various
 ;;; permutations thereof).
 Moves left if ARG is negative."
   (interactive "p")
   (setq zmacs-region-stays nil)
+  (setq this-command 'forward-char)
   (forward-char arg))
 
 (defun pc-select-move-char-left (&optional arg)
 Moves right if ARG negative."
   (interactive "p")
   (setq zmacs-region-stays nil)
-  (backward-char arg))
+  (setq this-command 'backward-char)
+  (forward-char (- arg)))
 
 (defun pc-select-move-word-right (&optional arg)
   "Move point right ARG words, deselecting any marked region.
 Moves left if ARG is negative."
   (interactive "p")
   (setq zmacs-region-stays nil)
+  (setq this-command 'forward-word)
   (forward-word arg))
 
 (defun pc-select-move-word-left (&optional arg)
 Moves right if ARG is negative."
   (interactive "p")
   (setq zmacs-region-stays nil)
-  (backward-word arg))
+  (setq this-command 'backward-word)
+  (forward-word (- arg)))
 
 (defun pc-select-move-line-up (&optional arg)
   "Move point up ARG lines, deselecting any marked region.
 Moves down if ARG is negative."
   (interactive "p")
   (setq zmacs-region-stays nil)
+  (setq this-command 'previous-line)
   (next-line (- arg)))
 
 (defun pc-select-move-line-down (&optional arg)
 Moves up if ARG is negative."
   (interactive "p")
   (setq zmacs-region-stays nil)
+  (setq this-command 'next-line)
   (next-line arg))
 
 (defun pc-select-move-bol (&optional arg)
 If scan reaches end of buffer, stop there without error."
   (interactive "p")
   (setq zmacs-region-stays nil)
+  (setq this-command 'beginning-of-line)
   (beginning-of-line arg))
 
 (defun pc-select-move-eol (&optional arg)
 If scan reaches end of buffer, stop there without error."
   (interactive "p")
   (setq zmacs-region-stays nil)
+  (setq this-command 'end-of-line)
   (end-of-line arg))
 
 (defun pc-select-move-page-up (&optional arg)
 See `scroll-down' for further info."
   (interactive "P")
   (setq zmacs-region-stays nil)
+  (setq this-command 'scroll-down)
   (scroll-down arg))
 
 (defun pc-select-move-page-down (&optional arg)
 See `scroll-up' for further info."
   (interactive "P")
   (setq zmacs-region-stays nil)
+  (setq this-command 'scroll-up)
   (scroll-up arg))
 
 (defun pc-select-move-bob (&optional arg)
 of the accessible part of the buffer."
   (interactive "P")
   (setq zmacs-region-stays nil)
+  (setq this-command 'beginning-of-buffer)
   (beginning-of-buffer))
 
 (defun pc-select-move-eob (&optional arg)
 of the accessible part of the buffer."
   (interactive "P")
   (setq zmacs-region-stays nil)
+  (setq this-command 'end-of-buffer)
   (end-of-buffer))
 
 ;; marking movement functions
 Moves and selects left if ARG is negative."
   (interactive "p")
   (pc-select-ensure-mark)
+  (setq this-command 'forward-char)
   (forward-char arg))
 
 (defun pc-select-mark-char-left (&optional arg)
 Moves and selects right if ARG is negative."
   (interactive "p")
   (pc-select-ensure-mark)
-  (backward-char arg))
+  (setq this-command 'backward-char)
+  (forward-char (- arg)))
 
 (defun pc-select-mark-word-right (&optional arg)
   "Move point right and mark ARG words.
 Moves and selects left if ARG is negative."
   (interactive "p")
   (pc-select-ensure-mark)
+  (setq this-command 'forward-word)
   (forward-word arg))
 
 (defun pc-select-mark-word-left (&optional arg)
 Moves and selects right if ARG is negative."
   (interactive "p")
   (pc-select-ensure-mark)
-  (backward-word arg))
+  (setq this-command 'backward-word)
+  (forward-word (- arg)))
 
 (defun pc-select-mark-line-up (&optional arg)
   "Move point up and select ARG lines.
 Moves down if ARG is negative."
   (interactive "p")
   (pc-select-ensure-mark)
+  (setq this-command 'previous-line)
   (next-line (- arg)))
 
 (defun pc-select-mark-line-down (&optional arg)
 Moves up if ARG is negative."
   (interactive "p")
   (pc-select-ensure-mark)
+  (setq this-command 'next-line)
   (next-line arg))
 
 (defun pc-select-mark-to-bol (&optional arg)
 If scan reaches end of buffer, stop there without error."
   (interactive "p")
   (pc-select-ensure-mark)
+  (setq this-command 'beginning-of-line)
   (beginning-of-line arg))
 
 (defun pc-select-mark-to-eol (&optional arg)
 If scan reaches end of buffer, stop there without error."
   (interactive "p")
   (pc-select-ensure-mark)
+  (setq this-command 'end-of-line)
   (end-of-line arg))
 
 (defun pc-select-mark-page-up (&optional arg)
 See `scroll-down' for further info."
   (interactive "P")
   (pc-select-ensure-mark)
+  (setq this-command 'scroll-down)
   (scroll-down arg))
 
 (defun pc-select-mark-page-down (&optional arg)
 See `scroll-up' for further info."
   (interactive "P")
   (pc-select-ensure-mark)
+  (setq this-command 'scroll-up)
   (scroll-up arg))
 
 (defun pc-select-mark-to-bob (&optional arg)
 of the accessible part of the buffer."
   (interactive "P")
   (pc-select-ensure-mark)
+  (setq this-command 'beginning-of-buffer)
   (beginning-of-buffer arg))
 
 (defun pc-select-mark-to-eob (&optional arg)
   "Move point and mark to the end of buffer."
   (interactive "P")
   (pc-select-ensure-mark)
+  (setq this-command 'end-of-buffer)
   (end-of-buffer arg))
 
 ;; enable the mode