summaryrefslogtreecommitdiff
path: root/lisp/emulation
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/viper-cmd.el3
-rw-r--r--lisp/emulation/viper-ex.el10
-rw-r--r--lisp/emulation/viper-util.el4
3 files changed, 10 insertions, 7 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index fe57535a14b..224ce5802c6 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -131,9 +131,6 @@
;; define viper-vi-command-p
(viper-test-com-defun viper-vi-command)
-;; Where viper saves mark. This mark is resurrected by m^
-(defvar viper-saved-mark nil)
-
;; Contains user settings for vars affected by viper-set-expert-level function.
;; Not a user option.
(defvar viper-saved-user-settings nil)
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 347e66f8ff1..d95a828614e 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -548,9 +548,13 @@ reversed."
(setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
(goto-char (point-max)))
- (cond ((looking-back quit-regex1) (exit-minibuffer))
- ((looking-back stay-regex) (insert " "))
- ((looking-back quit-regex2) (exit-minibuffer))
+ (cond ((looking-back quit-regex1 (line-beginning-position))
+ (exit-minibuffer))
+ ;; Almost certainly point-min should be line-beginning-position,
+ ;; but probably the two are identical anyway, and who really cares?
+ ((looking-back stay-regex (point-min)) (insert " "))
+ ((looking-back quit-regex2 (line-beginning-position))
+ (exit-minibuffer))
(t (insert " ")))))
(declare-function viper-tmp-insert-at-eob "viper-cmd" (msg))
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index f0540401803..9fd68b7a61f 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -39,7 +39,6 @@
(defvar ex-unix-type-shell-options)
(defvar viper-ex-tmp-buf-name)
(defvar viper-syntax-preference)
-(defvar viper-saved-mark)
(require 'ring)
@@ -886,6 +885,9 @@ Otherwise return the normal value."
(if (featurep 'xemacs) (mark-marker t)
(mark-marker)))
+(defvar viper-saved-mark nil
+ "Where viper saves mark. This mark is resurrected by m^.")
+
;; like (set-mark-command nil) but doesn't push twice, if (car mark-ring)
;; is the same as (mark t).
(defsubst viper-set-mark-if-necessary ()