changeset 27899:42f9a58e0fc4

* viper-cmd.el (viper-envelop-ESC-key): added the option to translate all ESC key sequences. (viper-goto-mark-subr): restore markers for files for which they were saved. * viper-init.el (viper-translate-all-ESC-keysequences): new variable. * viper-util.el (viper-set-replace-overlay-glyphs, viper-set-replace-overlay): always check if the replacement overlay is live. * viper.el (viper-vi-state-mode-list): added major modes. * ediff-wind.el: minor comment changes. * ediff.el: copyright notice date fix.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Mon, 28 Feb 2000 06:16:44 +0000
parents eed97491259b
children 117f66873369
files lisp/ChangeLog lisp/ediff-help.el lisp/ediff-wind.el lisp/ediff.el lisp/emulation/viper-cmd.el lisp/emulation/viper-init.el lisp/emulation/viper-util.el lisp/emulation/viper.el
diffstat 8 files changed, 55 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/ChangeLog	Mon Feb 28 06:16:44 2000 +0000
@@ -1,3 +1,17 @@
+2000-02-28  Michael Kifer  <kifer@cs.sunysb.edu>
+	* viper-cmd.el (viper-envelop-ESC-key): added the option to
+	translate all ESC key sequences.
+	(viper-goto-mark-subr): restore markers for files for which
+	they were saved.
+	* viper-init.el (viper-translate-all-ESC-keysequences): new variable.
+	* viper-util.el (viper-set-replace-overlay-glyphs,
+	viper-set-replace-overlay): always check if the replacement
+	overlay is live.
+	* viper.el (viper-vi-state-mode-list): added major modes.
+	* ediff-wind.el: minor comment changes.
+	* ediff.el: copyright notice date fix.
+	
+	
 2000-02-27  Jason Rumney  <jasonr@gnu.org>
 
 	* faces.el (face-font-family-alternatives): Add arial to helv.
--- a/lisp/ediff-help.el	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/ediff-help.el	Mon Feb 28 06:16:44 2000 +0000
@@ -311,6 +311,7 @@
 			     ediff-brief-help-message))
   (run-hooks 'ediff-display-help-hook))
 
+;;;###autoload
 (defun ediff-customize ()
   (interactive)
   (customize-group "ediff"))
--- a/lisp/ediff-wind.el	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/ediff-wind.el	Mon Feb 28 06:16:44 2000 +0000
@@ -274,8 +274,8 @@
     ))
       
 
+;; Select the lowest window on the frame.
 (defun ediff-select-lowest-window ()
-  "Select the lowest window on the frame."
   (if ediff-xemacs-p
       (select-window (frame-lowest-window))
     (let* ((lowest-window (selected-window))
--- a/lisp/ediff.el	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/ediff.el	Mon Feb 28 06:16:44 2000 +0000
@@ -1,6 +1,6 @@
 ;;; ediff.el --- a comprehensive visual interface to diff & patch
 
-;; Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 ;; Created: February 2, 1994
--- a/lisp/emulation/viper-cmd.el	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/emulation/viper-cmd.el	Mon Feb 28 06:16:44 2000 +0000
@@ -890,7 +890,8 @@
 		;; ESC-sequences).
 		(let* ((first-key (elt keyseq 0))
 		       (key-mod (event-modifiers first-key)))
-		  (cond ((viper-ESC-event-p first-key)
+		  (cond ((and (viper-ESC-event-p first-key)
+			      (not viper-translate-all-ESC-keysequences))
 			 ;; put keys following ESC on the unread list
 			 ;; and return ESC as the key-sequence
 			 (viper-set-unread-command-events (subseq keyseq 1))
@@ -1857,6 +1858,8 @@
 
 ;; Thie is a temp hook that uses free variables init-message and initial.
 ;; A dirty feature, but it is the simplest way to have it do the right thing.
+;; The init-message and initial vars come from the scope set by 
+;; viper-read-string-with-history
 (defun viper-minibuffer-standard-hook ()
   (if (stringp init-message)
       (viper-tmp-insert-at-eob init-message))
@@ -4284,6 +4287,19 @@
 	 (let* ((buff (current-buffer))
 	        (reg (1+ (- char ?a)))
 	        (text-marker (get-register reg)))
+	   ;; If marker points to file that had markers set (and those markers
+	   ;; were saved (as e.g., in session.el), then restore those markers
+	   (if (and (consp text-marker)
+ 		    (eq (car text-marker) 'file-query)
+ 		    (or (find-buffer-visiting (nth 1 text-marker))
+ 			(y-or-n-p (format "Visit file %s again? "
+ 					  (nth 1 text-marker)))))
+ 	       (save-excursion
+ 		 (find-file (nth 1 text-marker))
+ 		 (when (and (<= (nth 2 text-marker) (point-max))
+ 			    (<= (point-min) (nth 2 text-marker)))
+ 		   (setq text-marker (copy-marker (nth 2 text-marker)))
+ 		   (set-register reg text-marker))))
 	   (if com (viper-move-marker-locally 'viper-com-point (point)))
 	   (if (not (viper-valid-marker text-marker))
 	       (error viper-EmptyTextmarker char))
--- a/lisp/emulation/viper-init.el	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/emulation/viper-init.el	Mon Feb 28 06:16:44 2000 +0000
@@ -505,6 +505,19 @@
   :type 'integer
   :group 'viper-misc)
 
+(defcustom viper-translate-all-ESC-keysequences (not (viper-window-display-p))
+  "Allow translation of all key sequences into commands.
+Normally, Viper lets Emacs translate only those ESC key sequences that are
+defined in the low-level key-translation-map or function-key-map, such as those
+emitted by the arrow and function keys. Other sequences, e.g., \\e/, are
+treated as ESQ command followed by a `/'. This is done for people who type fast
+and tend to hit other characters right after they hit ESC. Other people like
+Emacs to translate ESC sequences all the time. 
+The default is to translate all sequences only when using a dumb terminal.
+This permits you to use ESC as a meta key in insert mode."
+  :type 'boolean
+  :group 'viper-misc)
+
 ;; Modes and related variables
 
 ;; Current mode.  One of: `emacs-state', `vi-state', `insert-state'
--- a/lisp/emulation/viper-util.el	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/emulation/viper-util.el	Mon Feb 28 06:16:44 2000 +0000
@@ -73,6 +73,7 @@
       (fset 'viper-overlay-p (symbol-function 'extentp))
       (fset 'viper-overlay-get (symbol-function 'extent-property))
       (fset 'viper-move-overlay (symbol-function 'set-extent-endpoints))
+      (fset 'viper-overlay-live-p (symbol-function 'extent-live-p))
       (if (viper-window-display-p)
 	  (fset 'viper-iconify (symbol-function 'iconify-frame)))
       (cond ((viper-has-face-support-p)
@@ -88,6 +89,7 @@
   (fset 'viper-overlay-p (symbol-function 'overlayp))
   (fset 'viper-overlay-get (symbol-function 'overlay-get))
   (fset 'viper-move-overlay (symbol-function 'move-overlay))
+  (fset 'viper-overlay-live-p (symbol-function 'overlayp))
   (if (viper-window-display-p)
       (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame)))
   (cond ((viper-has-face-support-p)
@@ -704,7 +706,7 @@
   (viper-move-overlay viper-replace-overlay beg end))
   
 (defun viper-set-replace-overlay (beg end)
-  (if (viper-overlay-p viper-replace-overlay)
+  (if (viper-overlay-live-p viper-replace-overlay)
       (viper-move-replace-overlay beg end)
     (setq viper-replace-overlay (viper-make-overlay beg end (current-buffer)))
     ;; never detach
@@ -729,6 +731,8 @@
   
       
 (defun viper-set-replace-overlay-glyphs (before-glyph after-glyph)
+  (or (viper-overlay-live-p viper-replace-overlay)
+      (viper-set-replace-overlay (point-min) (point-min)))
   (if (or (not (viper-has-face-support-p))
 	  viper-use-replace-region-delimiters)
       (let ((before-name (if viper-xemacs-p 'begin-glyph 'before-string))
--- a/lisp/emulation/viper.el	Sun Feb 27 21:52:51 2000 +0000
+++ b/lisp/emulation/viper.el	Mon Feb 28 06:16:44 2000 +0000
@@ -6,7 +6,7 @@
 ;;  Keywords: emulations
 ;;  Author: Michael Kifer <kifer@cs.sunysb.edu>
 
-;; Copyright (C) 1994 -- 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
 
 (defconst viper-version "3.08 of October 31, 1999"
   "The current version of Viper")
@@ -393,9 +393,11 @@
     asm-mode
     prolog-mode
     flora-mode
+    sql-mode
 
     text-mode indented-text-mode
     tex-mode latex-mode bibtex-mode
+    ps-mode
 				  
     completion-list-mode