* 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 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
: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
: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
(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
"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 ""
((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)
'(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)
(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))
(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)
(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))
;; 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))
)
: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)
: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)
(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)
))
(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)))))
;; 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.