(defun viper-submit-report ()
"Submit bug report on Viper."
(interactive)
- (defvar viper-device-type)
(defvar viper-color-display-p)
(defvar viper-frame-parameters)
(defvar viper-minibuffer-emacs-face)
(defvar viper-minibuffer-vi-face)
(defvar viper-minibuffer-insert-face)
(let ((reporter-prompt-for-summary-p t)
- (viper-device-type (viper-device-type))
(viper-color-display-p (if (viper-window-display-p)
(viper-color-display-p)
'non-x))
'ex-cycle-through-non-files
'viper-expert-level
'major-mode
- 'viper-device-type
+ 'window-system
'viper-color-display-p
'viper-frame-parameters
'viper-minibuffer-vi-face
;; Tell whether we are running as a window application or on a TTY
-(defsubst viper-device-type ()
- (if (featurep 'xemacs)
- (device-type (selected-device))
- window-system))
+(define-obsolete-function-alias 'viper-device-type 'window-system "27.1")
(defun viper-color-display-p ()
(condition-case nil
- (if (featurep 'xemacs)
- (eq (device-class (selected-device)) 'color)
- (display-color-p))
+ (display-color-p)
(error nil)))
;; in XEmacs: device-type is tty on tty and stream in batch.
(defun viper-window-display-p ()
- (and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
+ (and window-system (not (memq window-system '(tty stream pc)))))
(defcustom viper-ms-style-os-p (memq system-type '(ms-dos windows-nt))
"Non-nil if Emacs is running under an MS-style OS: MS-DOS, or MS-Windows."
(cond ((viper-window-display-p))
(viper-force-faces)
((viper-color-display-p))
- (t (memq (viper-device-type) '(pc)))))
+ (t (memq window-system '(pc)))))
\f
;;; Macros
;; internal var, used to remember the default cursor color of emacs frames
(defvar viper-vi-state-cursor-color nil)
-;; Frame-local variables are obsolete from Emacs 22.2 onwards, so we
-;; do it by hand with viper-frame-value (qv).
-(when (and (featurep 'xemacs)
- (fboundp 'make-variable-frame-local))
- (make-variable-frame-local 'viper-replace-overlay-cursor-color)
- (make-variable-frame-local 'viper-insert-state-cursor-color)
- (make-variable-frame-local 'viper-emacs-state-cursor-color)
- (make-variable-frame-local 'viper-vi-state-cursor-color))
-
(viper-deflocalvar viper-replace-overlay nil "")
(put 'viper-replace-overlay 'permanent-local t)
:type 'string
:group 'viper)
(defcustom viper-use-replace-region-delimiters
- (or (not (viper-has-face-support-p))
- (and (featurep 'xemacs) (eq (viper-device-type) 'tty)))
+ (not (viper-has-face-support-p))
"If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
`viper-replace-region-start-delimiter' to delimit replacement regions, even on
color displays. By default, the delimiters are used only on TTYs."
:type 'symbol
:group 'viper)
-;; XEmacs requires glyphs
-(when (featurep 'xemacs)
- (or (glyphp viper-replace-region-end-delimiter)
- (setq viper-replace-region-end-delimiter
- (make-glyph viper-replace-region-end-delimiter)))
- (or (glyphp viper-replace-region-start-delimiter)
- (setq viper-replace-region-start-delimiter
- (make-glyph viper-replace-region-start-delimiter))))
-
;; These are local marker that must be initialized to nil and moved with
;; `viper-move-marker-locally'
;;
(defun viper-restore-cursor-type ()
(condition-case nil
- (if (featurep 'xemacs)
- (set (make-local-variable 'bar-cursor) nil)
- (setq cursor-type (default-value 'cursor-type)))
+ (setq cursor-type (default-value 'cursor-type))
(error nil)))
(defun viper-set-insert-cursor-type ()
- (if (featurep 'xemacs)
- (set (make-local-variable 'bar-cursor) 2)
- (setq cursor-type '(bar . 2))))
+ (setq cursor-type '(bar . 2)))
(defun viper-ESC-keyseq-timeout ()
"Key sequence beginning with ESC and separated by no more than this many milliseconds is considered to be generated by a keyboard function key.
;; Returns window where click occurs
(defun viper-mouse-click-window (click)
- (let ((win (if (featurep 'xemacs) (event-window click)
- (posn-window (event-start click)))))
+ (let ((win (posn-window (event-start click))))
(if (window-live-p win)
win
(error "Click was not over a live window"))))
(defsubst viper-mouse-click-window-buffer-name (click)
(buffer-name (viper-mouse-click-window-buffer click)))
-;; Returns position of a click
(defsubst viper-mouse-click-posn (click)
- (if (featurep 'xemacs) (event-point click)
- (posn-point (event-start click))))
+ "Returns position of a click."
+ (declare (obsolete nil "27.1"))
+ (posn-point (event-start click)))
`viper-surrounding-word-function'."
(let ((click-word "")
- (click-pos (viper-mouse-click-posn click))
+ (click-pos (posn-point (event-start click)))
(click-buf (viper-mouse-click-window-buffer click)))
(or (natnump count) (setq count 1))
(or (natnump click-count) (setq click-count 1))
(or (not (eq (key-binding viper-mouse-down-insert-key-parsed)
'viper-mouse-catch-frame-switch))
(not (eq (key-binding viper-mouse-up-insert-key-parsed)
- 'viper-mouse-click-insert-word))
- (and (featurep 'xemacs) (not (event-over-text-area-p click)))))
+ 'viper-mouse-click-insert-word))))
() ; do nothing, if binding isn't right or not over text
;; turn arg into a number
(cond ((integerp arg) nil)
(or (not (eq (key-binding viper-mouse-down-search-key-parsed)
'viper-mouse-catch-frame-switch))
(not (eq (key-binding viper-mouse-up-search-key-parsed)
- 'viper-mouse-click-search-word))
- (and (featurep 'xemacs) (not (event-over-text-area-p click)))))
+ 'viper-mouse-click-search-word))))
() ; do nothing, if binding isn't right or not over text
(let ((previous-search-string viper-s-string)
click-word click-count)
(y-or-n-p
(format
"File %s is checked in. Check it out? "
- (viper-abbreviate-file-name file))))
+ (abbreviate-file-name file))))
(with-current-buffer buf
(command-execute checkout-function)))))
;; just have keymap attached to replace overlay.
;;(overlay-put
;; viper-replace-overlay
- ;; (if (featurep 'xemacs) 'keymap 'local-map)
+ ;; 'local-map
;; viper-replace-map)
)
(if (viper-has-face-support-p)
\f
;;; XEmacs compatibility
-(defun viper-abbreviate-file-name (file)
- (abbreviate-file-name file))
+(define-obsolete-function-alias 'viper-abbreviate-file-name
+ 'abbreviate-file-name "27.1")
;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
;; in sit-for, so this function smooths out the differences.