diff options
-rw-r--r-- | lisp/emulation/viper-ex.el | 11 | ||||
-rw-r--r-- | lisp/emulation/viper-keym.el | 4 | ||||
-rw-r--r-- | lisp/emulation/viper-macs.el | 6 | ||||
-rw-r--r-- | lisp/emulation/viper-mous.el | 9 | ||||
-rw-r--r-- | lisp/emulation/viper-util.el | 87 | ||||
-rw-r--r-- | lisp/emulation/viper.el | 26 |
6 files changed, 101 insertions, 42 deletions
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index b0d671f8dfa..4720fcf2494 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -1,6 +1,6 @@ ;;; viper-ex.el --- functions implementing the Ex commands for Viper -;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -19,8 +19,15 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. + +;; Code + (require 'viper-util) +;; Compiler pacifier +(defvar read-file-name-map) +;; end compiler pacifier + ;;; Variables (defconst vip-ex-work-buf-name " *ex-working-space*") @@ -1340,7 +1347,7 @@ reversed.") (setq l (cdr l)))) (if find-alt-file (car l) (progn - (if (car l) + (if (and (car l) (get-file-buffer (car l))) (let* ((w (if cycle-other-window (get-lru-window) (selected-window))) (b (window-buffer w))) diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 714c49c7b6f..06d0fe559d2 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -1,6 +1,6 @@ ;;; viper-keym.el --- Viper keymaps -;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -19,6 +19,8 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;; Code + (require 'viper-util) ;;; Variables diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el index 9434ca2002d..9788c3f27c4 100644 --- a/lisp/emulation/viper-macs.el +++ b/lisp/emulation/viper-macs.el @@ -1,6 +1,6 @@ ;;; viper-macs.el --- functions implementing keyboard macros for Viper -;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -19,7 +19,11 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;; Code + (require 'viper-util) +(require 'viper-keym) + ;;; Variables diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index 257c2c2cbd1..25e8b934c46 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el @@ -1,6 +1,6 @@ ;;; viper-mous.el --- mouse support for Viper -;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -19,8 +19,15 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;; Code + (require 'viper-util) +;; compiler pacifier +(defvar double-click-time) +(defvar mouse-track-multi-click-time) +;; end compiler pacifier + ;;; Variables diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index af76f07b1ca..31950d4d986 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -1,6 +1,6 @@ ;;; viper-util.el --- Utilities used by viper.el -;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -19,11 +19,34 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. + +;; Code + (require 'ring) -;; Whether it is XEmacs or not +;; Compiler pacifier +(defvar vip-overriding-map) +(defvar pm-color-alist) +(defvar zmacs-region-stays) +(defvar vip-search-face) +(defvar vip-minibuffer-current-face) +(defvar vip-minibuffer-insert-face) +(defvar vip-minibuffer-vi-face) +(defvar vip-minibuffer-emacs-face) +(defvar vip-replace-overlay-face) +(defvar vip-minibuffer-overlay) +(defvar vip-replace-overlay) +(defvar vip-search-overlay) +(defvar vip-replace-overlay-cursor-color) +(defvar vip-intermediate-command) +(defvar vip-use-replace-region-delimiters) +(defvar vip-fast-keyseq-timeout) +(defvar vip-related-files-and-buffers-ring) +;; end compiler pacifier + +;; Is it XEmacs? (defconst vip-xemacs-p (string-match "\\(Lucid\\|XEmacs\\)" emacs-version)) -;; Whether it is Emacs or not +;; Is it Emacs? (defconst vip-emacs-p (not vip-xemacs-p)) ;; Tell whether we are running as a window application or on a TTY (defsubst vip-device-type () @@ -165,6 +188,9 @@ that Viper doesn't know about.") (if vip-emacs-p (x-display-color-p) (eq (device-class (selected-device)) 'color))) + +(defsubst vip-get-cursor-color () + (cdr (assoc 'cursor-color (frame-parameters)))) ;; OS/2 (cond ((eq (vip-device-type) 'pm) @@ -205,9 +231,6 @@ that Viper doesn't know about.") (defsubst vip-restore-cursor-color () (vip-change-cursor-color (vip-overlay-get vip-replace-overlay 'vip-cursor-color))) - -(defsubst vip-get-cursor-color () - (cdr (assoc 'cursor-color (frame-parameters)))) ;; Check the current version against the major and minor version numbers @@ -574,10 +597,16 @@ that Viper doesn't know about.") ;; Replace state +(defsubst vip-move-replace-overlay (beg end) + (vip-move-overlay vip-replace-overlay beg end)) + (defun vip-set-replace-overlay (beg end) (if (vip-overlay-p vip-replace-overlay) (vip-move-replace-overlay beg end) (setq vip-replace-overlay (vip-make-overlay beg end (current-buffer))) + ;; never detach + (vip-overlay-put + vip-replace-overlay (if vip-emacs-p 'evaporate 'detachable) nil) (vip-overlay-put vip-replace-overlay 'priority vip-replace-overlay-priority)) (if (vip-has-face-support-p) @@ -586,12 +615,6 @@ that Viper doesn't know about.") (vip-change-cursor-color vip-replace-overlay-cursor-color) ) - -(defsubst vip-hide-replace-overlay () - (vip-set-replace-overlay-glyphs nil nil) - (vip-restore-cursor-color) - (if (vip-has-face-support-p) - (vip-overlay-put vip-replace-overlay 'face nil))) (defsubst vip-set-replace-overlay-glyphs (before-glyph after-glyph) (if (or (not (vip-has-face-support-p)) @@ -600,16 +623,18 @@ that Viper doesn't know about.") (after-name (if vip-xemacs-p 'end-glyph 'after-string))) (vip-overlay-put vip-replace-overlay before-name before-glyph) (vip-overlay-put vip-replace-overlay after-name after-glyph)))) + +(defsubst vip-hide-replace-overlay () + (vip-set-replace-overlay-glyphs nil nil) + (vip-restore-cursor-color) + (if (vip-has-face-support-p) + (vip-overlay-put vip-replace-overlay 'face nil))) (defsubst vip-replace-start () (vip-overlay-start vip-replace-overlay)) (defsubst vip-replace-end () (vip-overlay-end vip-replace-overlay)) - -(defsubst vip-move-replace-overlay (beg end) - (vip-move-overlay vip-replace-overlay beg end) - ) ;; Minibuffer @@ -622,13 +647,15 @@ that Viper doesn't know about.") vip-minibuffer-overlay 'face vip-minibuffer-current-face) (vip-overlay-put vip-minibuffer-overlay 'priority vip-minibuffer-overlay-priority) - ;; prevent detachment and make vip-minibuffer-overlay open-ended + ;; never detach + (vip-overlay-put + vip-minibuffer-overlay (if vip-emacs-p 'evaporate 'detachable) nil) + ;; make vip-minibuffer-overlay open-ended ;; In emacs, it is made open ended at creation time - (if vip-emacs-p - (vip-overlay-put vip-minibuffer-overlay 'evaporate nil) - (vip-overlay-put vip-minibuffer-overlay 'detachable nil) - (vip-overlay-put vip-minibuffer-overlay 'start-open nil) - (vip-overlay-put vip-minibuffer-overlay 'end-open nil)) + (if vip-xemacs-p + (progn + (vip-overlay-put vip-minibuffer-overlay 'start-open nil) + (vip-overlay-put vip-minibuffer-overlay 'end-open nil))) ))) (defun vip-check-minibuffer-overlay () @@ -636,8 +663,9 @@ that Viper doesn't know about.") (setq vip-minibuffer-overlay (if vip-xemacs-p (vip-make-overlay 1 (1+ (buffer-size)) (current-buffer)) - ;; don't move front, move rear - (vip-make-overlay 1 (1+ (buffer-size)) (current-buffer) nil t))) + ;; make overlay open-ended + (vip-make-overlay + 1 (1+ (buffer-size)) (current-buffer) nil 'rear-advance))) )) @@ -667,16 +695,17 @@ that Viper doesn't know about.") (key (vip-event-key event))) (member key ESC-keys))) -;; like (set-mark-command nil) but doesn't push twice, if (car mark-ring) -;; is the same as (mark t). -(defsubst vip-set-mark-if-necessary () - (setq mark-ring (delete (vip-mark-marker) mark-ring)) - (set-mark-command nil)) (defsubst vip-mark-marker () (if vip-xemacs-p (mark-marker t) (mark-marker))) + +;; like (set-mark-command nil) but doesn't push twice, if (car mark-ring) +;; is the same as (mark t). +(defsubst vip-set-mark-if-necessary () + (setq mark-ring (delete (vip-mark-marker) mark-ring)) + (set-mark-command nil)) ;; In transient mark mode (zmacs mode), it is annoying when regions become ;; highlighted due to Viper's pushing marks. So, we deactivate marks, unless diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 0d88858fe88..9d0ec982d37 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -6,11 +6,11 @@ ;; Keywords: emulations ;; Author: Michael Kifer <kifer@cs.sunysb.edu> -(defconst viper-version "2.85 of February 14, 1996" - "The current version of Viper") - ;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +(defconst viper-version "2.86 of March 14, 1996" + "The current version of Viper") + ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify @@ -293,6 +293,7 @@ ;; much easier. ;; +;; Code (require 'advice) (require 'cl) @@ -300,6 +301,15 @@ (require 'viper-util) +;; Compiler pacifier +(defvar vip-minibuffer-current-face) +(defvar vip-minibuffer-insert-face) +(defvar vip-minibuffer-vi-face) +(defvar vip-minibuffer-emacs-face) +(defvar iso-accents-mode) +(defvar zmacs-region-stays) +;; end pacifier + ;;; Variables @@ -2417,11 +2427,11 @@ Undo previous insertion and inserts new." (end-of-line) ;; make sure all lines end with newline, unless in the minibuffer or ;; when requested otherwise (require-final-newline is nil) - (if (and - (eobp) - (not (bolp)) - require-final-newline - (not (vip-is-in-minibuffer))) + (if (and (eobp) + (not (bolp)) + require-final-newline + (not (vip-is-in-minibuffer)) + (not buffer-read-only)) (insert "\n")))) (defun vip-yank-defun () |