1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-02 20:16:25 +00:00

* ediff-diff.el: Moved variables around to have it compile under NT.

* ediff-help.el (ediff-use-long-help-message): made it customizable.

	* ediff-init.el (ediff-abbrev-jobname): use capitalize.

	* ediff-wind.el (ediff-skip-unsuitable-frames): deleted the
	redundant skip-small-frames test.

	* viper-cmd.el (viper-change-state-to-vi): disable overwrite mode.
	(viper-downgrade-to-insert): protect against errors in hooks.

	* viper-init.el (viper-vi-state-hook,viper-insert-state-hook,
	viper-replace-state-hook,viper-emacs-state-hook): do cursor handling.
	(viper-restore-cursor-type,viper-set-insert-cursor-type): new
	functions.

	* viper-util.el (viper-memq-char): bug fixes

	* viper.el (viper-mode): fix cursor handling.
This commit is contained in:
Michael Kifer 2000-11-24 08:15:11 +00:00
parent 1862a24e48
commit 7d0278167b
9 changed files with 77 additions and 43 deletions

View File

@ -1,3 +1,26 @@
2000-11-24 Michael Kifer <kifer@cs.sunysb.edu>
* ediff-diff.el: Moved variables around to have it compile under NT.
* ediff-help.el (ediff-use-long-help-message): made it customizable.
* ediff-init.el (ediff-abbrev-jobname): use capitalize.
* ediff-wind.el (ediff-skip-unsuitable-frames): deleted the
redundant skip-small-frames test.
* viper-cmd.el (viper-change-state-to-vi): disable overwrite mode.
(viper-downgrade-to-insert): protect against errors in hooks.
* viper-init.el (viper-vi-state-hook,viper-insert-state-hook,
viper-replace-state-hook,viper-emacs-state-hook): do cursor handling.
(viper-restore-cursor-type,viper-set-insert-cursor-type): new
functions.
* viper-util.el (viper-memq-char): bug fixes.
* viper.el (viper-mode): fix cursor handling.
2000-11-24 Kenichi Handa <handa@etl.go.jp>
* international/mule-diag.el (list-iso-charset-chars): For

View File

@ -44,6 +44,18 @@
:prefix "ediff-"
:group 'ediff)
;; these two must be here to prevent ediff-test-utility from barking
(defcustom ediff-diff-program "diff"
"*Program to use for generating the differential of the two files."
:type 'string
:group 'ediff-diff)
(defcustom ediff-diff3-program "diff3"
"*Program to be used for three-way comparison.
Must produce output compatible with Unix's diff3 program."
:type 'string
:group 'ediff-diff)
;; The following functions must precede all defcustom-defined variables.
;; The following functions needed for setting diff/diff3 options
;; test if diff supports the --binary option
@ -108,10 +120,6 @@ ignore changes whose lines all match RE."
:type '(repeat string)
:group 'ediff-diff)
(defcustom ediff-diff-program "diff"
"*Program to use for generating the differential of the two files."
:type 'string
:group 'ediff-diff)
(defcustom ediff-diff-options ""
"*Options to pass to `ediff-diff-program'.
If diff\(1\) is used as `ediff-diff-program', then the most useful options are
@ -135,11 +143,6 @@ This output is not used by Ediff internally."
(defvar ediff-match-diff3-line "^====\\(.?\\)$"
"Pattern to match lines produced by diff3 that describe differences.")
(defcustom ediff-diff3-program "diff3"
"*Program to be used for three-way comparison.
Must produce output compatible with Unix's diff3 program."
:type 'string
:group 'ediff-diff)
(defcustom ediff-diff3-options ""
"*Options to pass to `ediff-diff3-program'."
:set 'ediff-reset-diff-options

View File

@ -144,8 +144,10 @@ produce the brief help message. This function must return a string.")
"The long help message that the user can customize.
See `ediff-brief-help-message-function' for more.")
(defvar ediff-use-long-help-message nil
"*If t, Ediff displays a long help message. Short help message otherwise.")
(defcustom ediff-use-long-help-message nil
"*If t, Ediff displays a long help message. Short help message otherwise."
:type 'boolean
:group 'ediff-window)
;; The actual help message.
(ediff-defvar-local ediff-help-message ""

View File

@ -1683,17 +1683,9 @@ Checks if overlay's buffer exists."
((eq jobname 'ediff-merge-directory-revisions-with-ancestor)
"Merge dir versions via ancestors")
(t
(let* ((str (substring (symbol-name jobname) 6))
(len (length str))
(pos 0))
(while (< pos len)
(if (= pos 0)
(aset str pos (upcase (aref str pos))))
(if (= (aref str pos) ?-)
(aset str pos ?\ ))
(setq pos (1+ pos)))
str))))
(capitalize
(subst-char-in-string ?- ?\ (substring (symbol-name jobname) 6))))
))
(defsubst ediff-get-region-contents (n buf-type ctrl-buf &optional start end)

View File

@ -151,7 +151,7 @@ In this case, Ediff will use those frames to display these buffers."
'(vertical-scroll-bars . nil) ; Emacs only
'(scrollbar-width . 0) ; XEmacs only
'(menu-bar-lines . 0) ; Emacs only
'(tool-bar-lines . 0) ; Emacs 21+ only
'(tool-bar-lines . 0) ; Emacs 21+ only
;; don't lower and auto-raise
'(auto-lower . nil)
'(auto-raise . t)
@ -842,9 +842,6 @@ into icons, regardless of the window manager."
(or
(ediff-frame-has-dedicated-windows (selected-frame))
(ediff-frame-iconified-p (selected-frame))
;; skip small frames
(< (frame-height (selected-frame))
(* 3 window-min-height))
;; skip small windows
(< (window-height (selected-window))
(* 3 window-min-height))

View File

@ -597,7 +597,7 @@
(interactive)
(if (and viper-first-time (not (viper-is-in-minibuffer)))
(viper-mode)
(if overwrite-mode (overwrite-mode nil))
(if overwrite-mode (overwrite-mode -1))
(or (viper-overlay-p viper-replace-overlay)
(viper-set-replace-overlay (point-min) (point-min)))
(viper-hide-replace-overlay)
@ -646,8 +646,13 @@
(viper-message-conditions conds))))
(defsubst viper-downgrade-to-insert ()
(setq viper-current-state 'insert-state
viper-replace-minor-mode nil))
;; Protect against user errors in hooks
(condition-case conds
(run-hooks 'viper-insert-state-hook)
(error
(viper-message-conditions conds)))
(setq viper-current-state 'insert-state
viper-replace-minor-mode nil))
@ -2210,7 +2215,7 @@ problems."
;; guard against a smartie who switched from R-replace to normal replace
(remove-hook
'viper-post-command-hooks 'viper-R-state-post-command-sentinel 'local)
(if overwrite-mode (overwrite-mode nil))
(if overwrite-mode (overwrite-mode -1))
)

View File

@ -947,19 +947,19 @@ Should be set in `~/.viper' file."
:prefix "viper-"
:group 'viper)
(defcustom viper-vi-state-hook nil
(defcustom viper-vi-state-hook 'viper-restore-cursor-type
"*Hooks run just before the switch to Vi mode is completed."
:type 'hook
:group 'viper-hooks)
(defcustom viper-insert-state-hook nil
(defcustom viper-insert-state-hook 'viper-set-insert-cursor-type
"*Hooks run just before the switch to Insert mode is completed."
:type 'hook
:group 'viper-hooks)
(defcustom viper-replace-state-hook nil
(defcustom viper-replace-state-hook 'viper-restore-cursor-type
"*Hooks run just before the switch to Replace mode is completed."
:type 'hook
:group 'viper-hooks)
(defcustom viper-emacs-state-hook nil
(defcustom viper-emacs-state-hook 'viper-restore-cursor-type
"*Hooks run just before the switch to Emacs mode is completed."
:type 'hook
:group 'viper-hooks)
@ -969,6 +969,16 @@ Should be set in `~/.viper' file."
:type 'hook
:group 'viper-hooks)
(defun viper-restore-cursor-type ()
(if viper-xemacs-p
(setq bar-cursor nil)
(setq cursor-type default-cursor-type)))
(defun viper-set-insert-cursor-type ()
(if viper-xemacs-p
(setq bar-cursor 2)
(setq cursor-type '(bar . 2))))
;;; Local Variables:
;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)

View File

@ -102,17 +102,15 @@
(symbol-function
(if viper-xemacs-p 'characterp 'integerp)))
; CHAR is supposed to be a char or an integer; LIST is a list of chars, nil,
; and negative numbers
; Check if CHAR is a member by trying to convert into integers, if necessary.
; Introduced for compatibility with XEmacs, where integers are not the same as
; chars.
;; CHAR is supposed to be a char or an integer (positive or negative)
;; LIST is a list of chars, nil, and negative numbers
;; Check if CHAR is a member by trying to convert into integers, if necessary.
;; Introduced for compatibility with XEmacs, where integers are not the same as
;; chars.
(defun viper-memq-char (char list)
(cond (viper-emacs-p (memq char list))
((null char) (memq char list))
((characterp char) (memq char list))
((integerp char) (memq (int-to-char char) list))
(t nil)))
((and (integerp char) (>= char 0)) (memq (int-to-char char) list))
((memq char list))))
;; Like =, but accommodates null and also is t for eq-objects
(defun viper= (char char1)

View File

@ -592,6 +592,9 @@ This startup message appears whenever you load Viper, unless you type `y' now."
))
(viper-set-expert-level 'dont-change-unless)))
(if viper-xemacs-p
(make-variable-buffer-local 'bar-cursor))
(or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi
(memq major-mode viper-insert-state-mode-list) ; don't switch
(viper-change-state-to-vi)))))
@ -660,6 +663,7 @@ remains buffer-local."
;; Ideally, we would like to be able to de-localize local variables
(viper-delocalize-var 'minor-mode-map-alist)
(viper-delocalize-var 'require-final-newline)
(if viper-xemacs-p (viper-delocalize-var 'bar-cursor))
;; deactivate all advices done by Viper.