summaryrefslogtreecommitdiff
path: root/lisp/emulation
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-08-26 15:15:02 +0000
committerRichard M. Stallman <rms@gnu.org>1996-08-26 15:15:02 +0000
commitdff82a4ae8558de2bb43d931dd8316b283bc0b10 (patch)
tree0d90b94f801b3dd2cf7fd04ceb9eeb41555e314a /lisp/emulation
parent32de99bf903b31b5748314c2521a5fda074fc239 (diff)
downloademacs-dff82a4ae8558de2bb43d931dd8316b283bc0b10.tar.gz
(ensure-mark): Minor rewrite.
(scroll-down-mark): Handle pc-select-override-scroll-error, (scroll-down-nomark): Likewise. (scroll-up-mark, scroll-up-nomark): Likewise. (pc-selection-mode): Get rid of the advice on scroll-up, scroll-down.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/pc-select.el33
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el
index 77a50c5f3c1..a9ca7048243 100644
--- a/lisp/emulation/pc-select.el
+++ b/lisp/emulation/pc-select.el
@@ -108,7 +108,7 @@ and transient-mark-mode."
(defun ensure-mark()
;; make sure mark is active
;; test if it is active, if it isn't, set it and activate it
- (and (not mark-active) (set-mark-command nil)))
+ (or mark-active (set-mark-command nil)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; forward and mark
@@ -196,7 +196,10 @@ Negative ARG means scroll upward.
When calling from a program, supply a number as argument or nil."
(interactive "P")
(ensure-mark)
- (scroll-down arg))
+ (cond (pc-select-override-scroll-error
+ (condition-case nil (scroll-down arg)
+ (beginning-of-buffer (goto-char (point-min)))))
+ (t (scroll-down arg))))
(defun end-of-buffer-mark (&optional arg)
"Ensure mark is active; move point to the end of the buffer.
@@ -318,7 +321,10 @@ Negative ARG means scroll upward.
When calling from a program, supply a number as argument or nil."
(interactive "P")
(setq mark-active nil)
- (scroll-down arg))
+ (cond (pc-select-override-scroll-error
+ (condition-case nil (scroll-down arg)
+ (beginning-of-buffer (goto-char (point-min)))))
+ (t (scroll-down arg))))
(defun end-of-buffer-nomark (&optional arg)
"Deactivate mark; move point to the end of the buffer.
@@ -422,7 +428,10 @@ Negative ARG means scroll downward.
When calling from a program, supply a number as argument or nil."
(interactive "P")
(ensure-mark)
- (scroll-up arg))
+ (cond (pc-select-override-scroll-error
+ (condition-case nil (scroll-up arg)
+ (end-of-buffer (goto-char (point-max)))))
+ (t (scroll-up arg))))
(defun beginning-of-buffer-mark (&optional arg)
"Ensure mark is active; move point to the beginning of the buffer.
@@ -508,7 +517,10 @@ Negative ARG means scroll downward.
When calling from a program, supply a number as argument or nil."
(interactive "P")
(setq mark-active nil)
- (scroll-up arg))
+ (cond (pc-select-override-scroll-error
+ (condition-case nil (scroll-up arg)
+ (end-of-buffer (goto-char (point-max)))))
+ (t (scroll-up arg))))
(defun beginning-of-buffer-nomark (&optional arg)
"Deactivate mark; move point to the beginning of the buffer.
@@ -673,14 +685,5 @@ In addition, certain other PC bindings are imitated:
(setq transient-mark-mode t)
(setq mark-even-if-inactive t)
(delete-selection-mode 1)
- (cond (pc-select-override-scroll-error
- (defadvice scroll-up (around scroll-to-bottom-if-eob activate)
- (condition-case nil
- ad-do-it
- (end-of-buffer (goto-char (point-max)))))
- (defadvice scroll-down (around scroll-to-top-if-bob activate)
- (condition-case nil
- ad-do-it
- (beginning-of-buffer (goto-char (point-min))))))))
-
+)
;;; pc-select.el ends here