From 55d7ff38f14396444ef366bfe74eee6dadcf9853 Mon Sep 17 00:00:00 2001 From: Michael Kifer Date: Mon, 28 Feb 2000 06:16:44 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/ediff-help.el | 1 + lisp/ediff-wind.el | 2 +- lisp/ediff.el | 2 +- lisp/emulation/viper-cmd.el | 18 +++++++++++++++++- lisp/emulation/viper-init.el | 13 +++++++++++++ lisp/emulation/viper-util.el | 6 +++++- lisp/emulation/viper.el | 4 +++- 8 files changed, 55 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a141a6dbc2..f92513255f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2000-02-28 Michael Kifer + * 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 * faces.el (face-font-family-alternatives): Add arial to helv. diff --git a/lisp/ediff-help.el b/lisp/ediff-help.el index ee7b4d4ac0..0de065f5e8 100644 --- a/lisp/ediff-help.el +++ b/lisp/ediff-help.el @@ -311,6 +311,7 @@ the value of this variable and the variables `ediff-help-message-*' in ediff-brief-help-message)) (run-hooks 'ediff-display-help-hook)) +;;;###autoload (defun ediff-customize () (interactive) (customize-group "ediff")) diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el index 073160e5c3..7fec54975b 100644 --- a/lisp/ediff-wind.el +++ b/lisp/ediff-wind.el @@ -274,8 +274,8 @@ into icons, regardless of the window manager." )) +;; 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)) diff --git a/lisp/ediff.el b/lisp/ediff.el index 1f8582b826..efab0dec0d 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el @@ -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 ;; Created: February 2, 1994 diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index a2b9455220..91be4cf776 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -890,7 +890,8 @@ as a Meta key and any number of multiple escapes is allowed." ;; 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 @@ Undo previous insertion and inserts new." ;; 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 @@ One can use `` and '' to temporarily jump 1 step back." (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)) diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index acc95b1ef0..bd479456ee 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -505,6 +505,19 @@ on a dumb terminal." :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' diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index b8fdf3365b..b384710e1e 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -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)) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 4e95448ab2..f5094a1b8d 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -6,7 +6,7 @@ ;; Keywords: emulations ;; Author: Michael Kifer -;; 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 @@ widget." asm-mode prolog-mode flora-mode + sql-mode text-mode indented-text-mode tex-mode latex-mode bibtex-mode + ps-mode completion-list-mode -- 2.20.1