summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog23
-rw-r--r--lisp/ediff-diff.el21
-rw-r--r--lisp/ediff-help.el6
-rw-r--r--lisp/ediff-init.el14
-rw-r--r--lisp/ediff-wind.el5
-rw-r--r--lisp/emulation/viper-cmd.el13
-rw-r--r--lisp/emulation/viper-init.el18
-rw-r--r--lisp/emulation/viper-util.el16
-rw-r--r--lisp/emulation/viper.el4
9 files changed, 77 insertions, 43 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5ad7944f726..4145a9a85c4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index e6864bf02fe..1ba2b8df803 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -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
diff --git a/lisp/ediff-help.el b/lisp/ediff-help.el
index 0de065f5e86..246bb5b9a8f 100644
--- a/lisp/ediff-help.el
+++ b/lisp/ediff-help.el
@@ -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 ""
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el
index de8bed967db..4c1fc9b48a3 100644
--- a/lisp/ediff-init.el
+++ b/lisp/ediff-init.el
@@ -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)
diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el
index 82415d94eba..46d56595511 100644
--- a/lisp/ediff-wind.el
+++ b/lisp/ediff-wind.el
@@ -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))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index b97995b5458..ce3b24c19cb 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -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))
)
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index bd479456ee4..d03632004c8 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -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)
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index a36478f0652..51f0efc6266 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -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)
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 4d8c74118b6..21db6b0d5b9 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -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.