From e83d1fe87564d06d2fcbb4006dfd9133bc340aa8 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 9 Nov 2007 05:20:57 +0000 Subject: [PATCH] * ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) (ediff-current-diff-A, ediff-current-diff-B) (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) (ediff-odd-diff-Ancestor, ediff-reset-mouse): * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) (ediff-setup-windows-plain-merge) (ediff-setup-windows-plain-compare, ediff-setup-control-frame) (ediff-refresh-control-frame, ediff-get-visible-buffer-window): * ediff-util.el (ediff-setup-keymap, ) (ediff-toggle-wide-display, ediff-toggle-multiframe) (ediff-toggle-use-toolbar, ediff-really-quit) (ediff-good-frame-under-mouse) (ediff-highlight-diff-in-one-buffer) (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) (ediff-make-bullet-proof-overlay): * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) (ediff-set-meta-overlay): * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): * ediff.el (ediff-documentation): Replace ediff-xemacs-p and ediff-emacs-p with their former definitions. * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. (viper-has-face-support-p, viper-inactivate-input-method) (viper-activate-input-method) (viper-use-replace-region-delimiters, viper-restore-cursor-type): * emulation/viper-mous.el (viper-multiclick-timeout) (viper-surrounding-word, viper-mouse-click-insert-word) (viper-mouse-click-search-word, viper-parse-mouse-key): * emulation/viper-macs.el (viper-char-array-to-macro): * emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-check-version, viper-get-visible-buffer-window) (viper-file-checked-in-p, viper-set-replace-overlay) (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) (viper-check-minibuffer-overlay, viper-read-key-sequence) (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p with their former definitions. (viper-eventify-list-xemacs): Only do work for XEmacs. (viper-set-unread-command-events): Only do work for Emacs. (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) (viper-move-overlay, viper-overlay-start, viper-overlay-end) (viper-overlay-get, viper-overlay-put, viper-read-event) (viper-characterp, viper-int-to-char, viper-get-face) (viper-color-defined-p, viper-iconify): New defaliases replacing the old fsets. * progmodes/fortran.el (comment-region-function) (uncomment-region-function): Pacify byte compiler. * vc.el (vc-diff-internal): Remove code for an old version of gnus. --- lisp/ChangeLog | 61 +++++++++++++++++++++ lisp/ediff-help.el | 4 +- lisp/ediff-init.el | 57 +++++++++----------- lisp/ediff-mult.el | 6 +-- lisp/ediff-util.el | 37 +++++++------ lisp/ediff-wind.el | 17 +++--- lisp/ediff.el | 2 +- lisp/emulation/viper-cmd.el | 22 ++++---- lisp/emulation/viper-ex.el | 8 +-- lisp/emulation/viper-init.el | 20 +++---- lisp/emulation/viper-macs.el | 2 +- lisp/emulation/viper-mous.el | 28 +++++----- lisp/emulation/viper-util.el | 126 ++++++++++++++++++++----------------------- lisp/emulation/viper.el | 26 ++++----- lisp/progmodes/fortran.el | 3 +- lisp/vc.el | 4 +- 16 files changed, 230 insertions(+), 193 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d61d09008fb..bac3ee7a691 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,64 @@ +2007-11-09 Dan Nicolaescu + + * ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove. + (ediff-has-face-support-p, ediff-BAD-INFO, ediff-check-version) + (ediff-current-diff-A, ediff-current-diff-B) + (ediff-current-diff-C, ediff-fine-diff-C, ediff-fine-diff-A) + (ediff-fine-diff-B, ediff-fine-diff-Ancestor, ediff-even-diff-A) + (ediff-even-diff-B, ediff-even-diff-C, ediff-even-diff-Ancestor) + (ediff-odd-diff-A, ediff-odd-diff-B, ediff-odd-diff-C) + (ediff-odd-diff-Ancestor, ediff-reset-mouse): + * ediff-wind.el (ediff-narrow-control-frame-leftward-shift) + (ediff-setup-windows-plain-merge) + (ediff-setup-windows-plain-compare, ediff-setup-control-frame) + (ediff-refresh-control-frame, ediff-get-visible-buffer-window): + * ediff-util.el (ediff-setup-keymap, ) + (ediff-toggle-wide-display, ediff-toggle-multiframe) + (ediff-toggle-use-toolbar, ediff-really-quit) + (ediff-good-frame-under-mouse) + (ediff-highlight-diff-in-one-buffer) + (ediff-remove-flags-from-buffer, ediff-place-flags-in-buffer1) + (ediff-make-bullet-proof-overlay): + * ediff-mult.el (ediff-setup-meta-map, ediff-emacs-p) + (ediff-set-meta-overlay): + * ediff-help.el (ediff-help-region-map, ediff-set-help-overlays): + * ediff.el (ediff-documentation): Replace ediff-xemacs-p and + ediff-emacs-p with their former definitions. + + * emulation/viper-init.el (viper-xemacs-p, viper-emacs-p): Remove. + (viper-has-face-support-p, viper-inactivate-input-method) + (viper-activate-input-method) + (viper-use-replace-region-delimiters, viper-restore-cursor-type): + * emulation/viper-mous.el (viper-multiclick-timeout) + (viper-surrounding-word, viper-mouse-click-insert-word) + (viper-mouse-click-search-word, viper-parse-mouse-key): + * emulation/viper-macs.el (viper-char-array-to-macro): + * emulation/viper.el (viper-go-away, viper-set-hooks) + (viper-non-hook-settings): + * emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) + (viper-get-saved-cursor-color-in-insert-mode) + (viper-get-saved-cursor-color-in-emacs-mode) + (viper-check-version, viper-get-visible-buffer-window) + (viper-file-checked-in-p, viper-set-replace-overlay) + (viper-set-replace-overlay-glyphs, viper-set-minibuffer-overlay) + (viper-check-minibuffer-overlay, viper-read-key-sequence) + (viper-key-to-emacs-key): Replace viper-xemacs-p and viper-emacs-p + with their former definitions. + (viper-eventify-list-xemacs): Only do work for XEmacs. + (viper-set-unread-command-events): Only do work for Emacs. + (viper-overlay-p, viper-make-overlay, viper-overlay-live-p) + (viper-move-overlay, viper-overlay-start, viper-overlay-end) + (viper-overlay-get, viper-overlay-put, viper-read-event) + (viper-characterp, viper-int-to-char, viper-get-face) + (viper-color-defined-p, viper-iconify): New defaliases replacing + the old fsets. + + * progmodes/fortran.el (comment-region-function) + (uncomment-region-function): Pacify byte compiler. + + * vc.el (vc-diff-internal): Remove code for an old version of + gnus. + 2007-11-08 Michael Albinus * net/tramp.el (tramp-maybe-open-connection): Use a local copy of diff --git a/lisp/ediff-help.el b/lisp/ediff-help.el index 1c7a72870fe..0c37be31372 100644 --- a/lisp/ediff-help.el +++ b/lisp/ediff-help.el @@ -165,7 +165,7 @@ the value of this variable and the variables `ediff-help-message-*' in (define-key ediff-help-region-map - (if ediff-emacs-p [mouse-2] [button2]) + (if (featurep 'emacs) [mouse-2] [button2]) 'ediff-help-for-quick-help) ;; runs in the control buffer @@ -177,7 +177,7 @@ the value of this variable and the variables `ediff-help-message-*' in end (match-end 0) cmd (buffer-substring (match-beginning 1) (match-end 1))) (setq overl (ediff-make-overlay beg end)) - (if ediff-emacs-p + (if (featurep 'emacs) (ediff-overlay-put overl 'mouse-face 'highlight) (ediff-overlay-put overl 'highlight t)) (ediff-overlay-put overl 'ediff-help-info cmd)))) diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index 21e6bf660ee..dd69b52b022 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el @@ -43,11 +43,6 @@ (load "ange-ftp" 'noerror))) ;; end pacifier -;; Is it XEmacs? -(defconst ediff-xemacs-p (featurep 'xemacs)) -;; Is it Emacs? -(defconst ediff-emacs-p (not ediff-xemacs-p)) - ;; This is used to avoid compilation warnings. When emacs/xemacs forms can ;; generate compile time warnings, we use this macro. ;; In this case, the macro will expand into the form that is appropriate to the @@ -78,8 +73,8 @@ that Ediff doesn't know about.") (cond ((ediff-window-display-p)) (ediff-force-faces) ((ediff-color-display-p)) - (ediff-emacs-p (memq (ediff-device-type) '(pc))) - (ediff-xemacs-p (memq (ediff-device-type) '(tty pc))) + ((featurep 'emacs) (memq (ediff-device-type) '(pc))) + ((featurep 'xemacs) (memq (ediff-device-type) '(tty pc))) )) ;; toolbar support for emacs hasn't been implemented in ediff @@ -506,7 +501,7 @@ set local variables that determine how the display looks like." *** of %sEmacs, does not seem to be properly installed. *** *** Please contact your system administrator. " - (if ediff-xemacs-p "X" ""))) + (if (featurep 'xemacs) "X" ""))) ;; Selective browsing @@ -785,8 +780,8 @@ to temp files when Ediff needs to find fine differences." ;; testing for sufficiently high Emacs versions. (defun ediff-check-version (op major minor &optional type-of-emacs) (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version)) - (and (cond ((eq type-of-emacs 'xemacs) ediff-xemacs-p) - ((eq type-of-emacs 'emacs) ediff-emacs-p) + (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) + ((eq type-of-emacs 'emacs) (featurep 'emacs)) (t t)) (cond ((eq op '=) (and (= emacs-minor-version minor) (= emacs-major-version major))) @@ -908,7 +903,7 @@ to temp files when Ediff needs to find fine differences." (defface ediff-current-diff-A - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "firebrick" :background "pale green")) (((class color)) @@ -929,7 +924,7 @@ this variable represents.") (ediff-hide-face ediff-current-diff-face-A) ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. ;; This means that some user customization may be trashed. -(if (and ediff-xemacs-p +(if (and (featurep 'xemacs) (ediff-has-face-support-p) (not (ediff-color-display-p))) (copy-face 'modeline ediff-current-diff-face-A)) @@ -937,7 +932,7 @@ this variable represents.") (defface ediff-current-diff-B - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "DarkOrchid" :background "Yellow")) (((class color)) @@ -960,14 +955,14 @@ this variable represents.") (ediff-hide-face ediff-current-diff-face-B) ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. ;; This means that some user customization may be trashed. -(if (and ediff-xemacs-p +(if (and (featurep 'xemacs) (ediff-has-face-support-p) (not (ediff-color-display-p))) (copy-face 'modeline ediff-current-diff-face-B)) (defface ediff-current-diff-C - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "Navy" :background "Pink")) (((class color)) @@ -988,14 +983,14 @@ this variable represents.") (ediff-hide-face ediff-current-diff-face-C) ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. ;; This means that some user customization may be trashed. -(if (and ediff-xemacs-p +(if (and (featurep 'xemacs) (ediff-has-face-support-p) (not (ediff-color-display-p))) (copy-face 'modeline ediff-current-diff-face-C)) (defface ediff-current-diff-Ancestor - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "Black" :background "VioletRed")) (((class color)) @@ -1016,14 +1011,14 @@ this variable represents.") (ediff-hide-face ediff-current-diff-face-Ancestor) ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. ;; This means that some user customization may be trashed. -(if (and ediff-xemacs-p +(if (and (featurep 'xemacs) (ediff-has-face-support-p) (not (ediff-color-display-p))) (copy-face 'modeline ediff-current-diff-face-Ancestor)) (defface ediff-fine-diff-A - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "Navy" :background "sky blue")) (((class color)) @@ -1044,7 +1039,7 @@ this variable represents.") (ediff-hide-face ediff-fine-diff-face-A) (defface ediff-fine-diff-B - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "Black" :background "cyan")) (((class color)) @@ -1065,7 +1060,7 @@ this variable represents.") (ediff-hide-face ediff-fine-diff-face-B) (defface ediff-fine-diff-C - (if ediff-emacs-p + (if (featurep 'emacs) '((((type pc)) (:foreground "white" :background "Turquoise")) (((class color) (min-colors 16)) @@ -1091,7 +1086,7 @@ this variable represents.") (ediff-hide-face ediff-fine-diff-face-C) (defface ediff-fine-diff-Ancestor - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "Black" :background "Green")) (((class color)) @@ -1123,7 +1118,7 @@ this variable represents.") (t "Stipple"))) (defface ediff-even-diff-A - (if ediff-emacs-p + (if (featurep 'emacs) `((((type pc)) (:foreground "green3" :background "light grey")) (((class color) (min-colors 16)) @@ -1149,7 +1144,7 @@ this variable represents.") (ediff-hide-face ediff-even-diff-face-A) (defface ediff-even-diff-B - (if ediff-emacs-p + (if (featurep 'emacs) `((((class color) (min-colors 16)) (:foreground "White" :background "Grey")) (((class color)) @@ -1170,7 +1165,7 @@ this variable represents.") (ediff-hide-face ediff-even-diff-face-B) (defface ediff-even-diff-C - (if ediff-emacs-p + (if (featurep 'emacs) `((((type pc)) (:foreground "yellow3" :background "light grey")) (((class color) (min-colors 16)) @@ -1196,7 +1191,7 @@ this variable represents.") (ediff-hide-face ediff-even-diff-face-C) (defface ediff-even-diff-Ancestor - (if ediff-emacs-p + (if (featurep 'emacs) `((((type pc)) (:foreground "cyan3" :background "light grey")) (((class color) (min-colors 16)) @@ -1229,7 +1224,7 @@ this variable represents.") (Ancestor . ediff-even-diff-Ancestor))) (defface ediff-odd-diff-A - (if ediff-emacs-p + (if (featurep 'emacs) '((((type pc)) (:foreground "green3" :background "gray40")) (((class color) (min-colors 16)) @@ -1254,7 +1249,7 @@ this variable represents.") (defface ediff-odd-diff-B - (if ediff-emacs-p + (if (featurep 'emacs) '((((type pc)) (:foreground "White" :background "gray40")) (((class color) (min-colors 16)) @@ -1278,7 +1273,7 @@ this variable represents.") (ediff-hide-face ediff-odd-diff-face-B) (defface ediff-odd-diff-C - (if ediff-emacs-p + (if (featurep 'emacs) '((((type pc)) (:foreground "yellow3" :background "gray40")) (((class color) (min-colors 16)) @@ -1302,7 +1297,7 @@ this variable represents.") (ediff-hide-face ediff-odd-diff-face-C) (defface ediff-odd-diff-Ancestor - (if ediff-emacs-p + (if (featurep 'emacs) '((((class color) (min-colors 16)) (:foreground "cyan3" :background "gray40")) (((class color)) @@ -1630,7 +1625,7 @@ This default should work without changes." (or frame (setq frame (selected-frame))) (if (ediff-window-display-p) (let ((frame-or-wind frame)) - (if ediff-xemacs-p + (if (featurep 'xemacs) (setq frame-or-wind (frame-selected-window frame))) (or do-not-grab-mouse ;; don't set mouse if the user said to never do this diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el index 3696d8ae776..51502615cf7 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el @@ -404,7 +404,7 @@ Toggled by ediff-toggle-verbose-help-meta-buffer" ) (define-key ediff-meta-buffer-map "=h" 'ediff-meta-mark-equal-files))) (if ediff-no-emacs-help-in-control-buffer (define-key ediff-meta-buffer-map "\C-h" 'ediff-previous-meta-item)) - (if ediff-emacs-p + (if (featurep 'emacs) (define-key ediff-meta-buffer-map [mouse-2] ediff-meta-action-function) (define-key ediff-meta-buffer-map [button2] ediff-meta-action-function)) @@ -448,7 +448,7 @@ Commands: (define-key ediff-dir-diffs-buffer-map "\C-?" 'previous-line) (define-key ediff-dir-diffs-buffer-map "p" 'previous-line) (define-key ediff-dir-diffs-buffer-map "C" 'ediff-dir-diff-copy-file) -(if ediff-emacs-p +(if (featurep 'emacs) (define-key ediff-dir-diffs-buffer-map [mouse-2] 'ediff-dir-diff-copy-file) (define-key ediff-dir-diffs-buffer-map [button2] 'ediff-dir-diff-copy-file)) (define-key ediff-dir-diffs-buffer-map [delete] 'previous-line) @@ -1493,7 +1493,7 @@ Useful commands: (defun ediff-set-meta-overlay (b e prop &optional session-number hidden) (let (overl) (setq overl (ediff-make-overlay b e)) - (if ediff-emacs-p + (if (featurep 'emacs) (ediff-overlay-put overl 'mouse-face 'highlight) (ediff-overlay-put overl 'highlight t)) (ediff-overlay-put overl 'ediff-meta-info prop) diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el index f3cffe0847f..2ed8f73a282 100644 --- a/lisp/ediff-util.el +++ b/lisp/ediff-util.el @@ -38,7 +38,6 @@ (defvar bottom-toolbar-visible-p) (defvar bottom-toolbar-height) (defvar mark-active) -(defvar ediff-emacs-p) (defvar ediff-after-quit-hook-internal nil) @@ -64,7 +63,7 @@ (or (featurep 'ediff) (load "ediff.el" nil nil 'nosuffix)) (or (featurep 'ediff-tbar) - ediff-emacs-p + (featurep 'emacs) (load "ediff-tbar.el" 'noerror nil 'nosuffix)) )) ;; end pacifier @@ -77,7 +76,7 @@ (require 'ediff-diff) (require 'ediff-merg) -(if ediff-xemacs-p +(if (featurep 'xemacs) (require 'ediff-tbar)) @@ -154,7 +153,7 @@ to invocation.") (suppress-keymap ediff-mode-map) (define-key ediff-mode-map - (if ediff-emacs-p [mouse-2] [button2]) 'ediff-help-for-quick-help) + (if (featurep 'emacs) [mouse-2] [button2]) 'ediff-help-for-quick-help) (define-key ediff-mode-map "\C-m" 'ediff-help-for-quick-help) (define-key ediff-mode-map "p" 'ediff-previous-difference) @@ -1275,7 +1274,7 @@ This is especially useful when comparing buffers side-by-side." (ediff-barf-if-not-control-buffer) (or (ediff-window-display-p) (error "%sEmacs is not running as a window application" - (if ediff-emacs-p "" "X"))) + (if (featurep 'emacs) "" "X"))) (ediff-recenter 'no-rehighlight) ; make sure buffs are displayed in windows (let ((ctl-buf ediff-control-buffer)) (setq ediff-wide-display-p (not ediff-wide-display-p)) @@ -1283,7 +1282,7 @@ This is especially useful when comparing buffers side-by-side." (ediff-with-current-buffer ctl-buf (modify-frame-parameters ediff-wide-display-frame ediff-wide-display-orig-parameters) - ;;(sit-for (if ediff-xemacs-p 0.4 0)) + ;;(sit-for (if (featurep 'xemacs) 0.4 0)) ;; restore control buf, since ctl window may have been deleted ;; during resizing (set-buffer ctl-buf) @@ -1291,7 +1290,7 @@ This is especially useful when comparing buffers side-by-side." ediff-window-B nil) ; force update of window config (ediff-recenter 'no-rehighlight)) (funcall ediff-make-wide-display-function) - ;;(sit-for (if ediff-xemacs-p 0.4 0)) + ;;(sit-for (if (featurep 'xemacs) 0.4 0)) (ediff-with-current-buffer ctl-buf (setq ediff-window-B nil) ; force update of window config (ediff-recenter 'no-rehighlight))))) @@ -1305,7 +1304,7 @@ which see." (let (window-setup-func) (or (ediff-window-display-p) (error "%sEmacs is not running as a window application" - (if ediff-emacs-p "" "X"))) + (if (featurep 'emacs) "" "X"))) (cond ((eq ediff-window-setup-function 'ediff-setup-windows-multiframe) (setq window-setup-func 'ediff-setup-windows-plain)) @@ -1335,7 +1334,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." (progn (or (ediff-window-display-p) (error "%sEmacs is not running as a window application" - (if ediff-emacs-p "" "X"))) + (if (featurep 'emacs) "" "X"))) (if (ediff-use-toolbar-p) (ediff-kill-bottom-toolbar)) ;; do this only after killing the toolbar @@ -2529,7 +2528,7 @@ temporarily reverses the meaning of this variable." (cond ((ediff-good-frame-under-mouse)) (t warp-frame))) (if (and (ediff-window-display-p) (frame-live-p warp-frame) ediff-grab-mouse) - (set-mouse-position (if ediff-emacs-p + (set-mouse-position (if (featurep 'emacs) warp-frame (frame-selected-window warp-frame)) 2 1)) @@ -2544,11 +2543,11 @@ temporarily reverses the meaning of this variable." (buf-name "") frame obj-ok) (setq obj-ok - (if ediff-emacs-p + (if (featurep 'emacs) (frame-live-p frame-or-win) (window-live-p frame-or-win))) (if obj-ok - (setq frame (if ediff-emacs-p frame-or-win (window-frame frame-or-win)) + (setq frame (if (featurep 'emacs) frame-or-win (window-frame frame-or-win)) buf-name (buffer-name (window-buffer (frame-selected-window frame))))) (if (string-match "Minibuf" buf-name) @@ -3031,7 +3030,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (ediff-get-symbol-from-alist buf-type ediff-current-diff-overlay-alist)))) - (if ediff-xemacs-p + (if (featurep 'xemacs) (ediff-move-overlay current-diff-overlay begin end-hilit) (ediff-move-overlay current-diff-overlay begin end-hilit buff)) (ediff-overlay-put current-diff-overlay 'priority @@ -3611,11 +3610,11 @@ Ediff Control Panel to restore highlighting." (defun ediff-remove-flags-from-buffer (buffer overlay) (ediff-with-current-buffer buffer (let ((inhibit-read-only t)) - (if ediff-xemacs-p + (if (featurep 'xemacs) (ediff-overlay-put overlay 'begin-glyph nil) (ediff-overlay-put overlay 'before-string nil)) - (if ediff-xemacs-p + (if (featurep 'xemacs) (ediff-overlay-put overlay 'end-glyph nil) (ediff-overlay-put overlay 'after-string nil)) ))) @@ -3643,7 +3642,7 @@ Ediff Control Panel to restore highlighting." ediff-before-flag-bol ediff-before-flag-mol)))) ;; insert the flag itself - (if ediff-xemacs-p + (if (featurep 'xemacs) (ediff-overlay-put curr-overl 'begin-glyph flag) (ediff-overlay-put curr-overl 'before-string flag)) @@ -3659,7 +3658,7 @@ Ediff Control Panel to restore highlighting." ediff-after-flag-eol ediff-after-flag-mol)))) ;; insert the flag itself - (if ediff-xemacs-p + (if (featurep 'xemacs) (ediff-overlay-put curr-overl 'end-glyph flag) (ediff-overlay-put curr-overl 'after-string flag)) )) @@ -3786,10 +3785,10 @@ Ediff Control Panel to restore highlighting." ;; never detach (ediff-overlay-put - overl (if ediff-emacs-p 'evaporate 'detachable) nil) + overl (if (featurep 'emacs) 'evaporate 'detachable) nil) ;; make overlay open-ended ;; In emacs, it is made open ended at creation time - (if ediff-xemacs-p + (if (featurep 'xemacs) (progn (ediff-overlay-put overl 'start-open nil) (ediff-overlay-put overl 'end-open nil))) diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el index c2c130ac6bb..8b72a673d17 100644 --- a/lisp/ediff-wind.el +++ b/lisp/ediff-wind.el @@ -39,7 +39,6 @@ (defvar top-gutter) (defvar frame-icon-title-format) (defvar ediff-diff-status) -(defvar ediff-emacs-p) (eval-when-compile (let ((load-path (cons (expand-file-name ".") load-path))) @@ -50,7 +49,7 @@ (or (featurep 'ediff-help) (load "ediff-help.el" nil nil 'nosuffix)) (or (featurep 'ediff-tbar) - ediff-emacs-p + (featurep 'emacs) (load "ediff-tbar.el" 'noerror nil 'nosuffix)) )) ;; end pacifier @@ -58,7 +57,7 @@ (require 'ediff-init) ;; be careful with ediff-tbar -(if ediff-xemacs-p +(if (featurep 'xemacs) (condition-case nil (require 'ediff-tbar) (error @@ -213,7 +212,7 @@ customization of the default control frame positioning." :type 'integer :group 'ediff-window) -(defcustom ediff-narrow-control-frame-leftward-shift (if ediff-xemacs-p 7 3) +(defcustom ediff-narrow-control-frame-leftward-shift (if (featurep 'xemacs) 7 3) "*The leftward shift of control frame from the right edge of buf A's frame. Measured in characters. This is used by the default control frame positioning function, @@ -380,7 +379,7 @@ into icons, regardless of the window manager." ;; XEmacs used to have a lot of trouble with display ;; It did't set things right unless we tell it to sit still ;; 19.12 seems ok. - ;;(if ediff-xemacs-p (sit-for 0)) + ;;(if (featurep 'xemacs) (sit-for 0)) (split-window-vertically (max 2 (- (window-height) merge-window-lines))) (if (eq (selected-window) wind-A) @@ -443,7 +442,7 @@ into icons, regardless of the window manager." ;; XEmacs used to have a lot of trouble with display ;; It did't set things right unless we told it to sit still ;; 19.12 seems ok. - ;;(if ediff-xemacs-p (sit-for 0)) + ;;(if (featurep 'xemacs) (sit-for 0)) (funcall split-window-function wind-width-or-height) @@ -1043,7 +1042,7 @@ into icons, regardless of the window manager." (or (eq this-command 'ediff-quit) (not (eq ediff-grab-mouse t))))) - (if ediff-xemacs-p + (if (featurep 'xemacs) (ediff-with-current-buffer ctl-buffer (ediff-cond-compile-for-xemacs-or-emacs (make-local-hook 'select-frame-hook) ; xemacs @@ -1238,7 +1237,7 @@ It assumes that it is called from within the control buffer." (defun ediff-refresh-control-frame () - (if ediff-emacs-p + (if (featurep 'emacs) ;; set frame/icon titles for Emacs (modify-frame-parameters ediff-control-frame @@ -1288,7 +1287,7 @@ It assumes that it is called from within the control buffer." ;; If buff is not live, return nil (defun ediff-get-visible-buffer-window (buff) (if (ediff-buffer-live-p buff) - (if ediff-xemacs-p + (if (featurep 'xemacs) (get-buffer-window buff t) (get-buffer-window buff 'visible)))) diff --git a/lisp/ediff.el b/lisp/ediff.el index 8911dc599f1..a2aafc90292 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el @@ -1440,7 +1440,7 @@ With optional NODE, goes to that node." (condition-case nil (progn (pop-to-buffer (get-buffer-create "*info*")) - (info (if ediff-xemacs-p "ediff.info" "ediff")) + (info (if (featurep 'xemacs) "ediff.info" "ediff")) (if node (Info-goto-node node) (message "Type `i' to search for a specific topic")) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 88af961e488..5e13edb9495 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -834,7 +834,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to viper-emacs-kbd-minor-mode ch) (cond ((and viper-special-input-method - viper-emacs-p + (featurep 'emacs) (fboundp 'quail-input-method)) ;; (let ...) is used to restore unread-command-events to the ;; original state. We don't want anything left in there after @@ -861,7 +861,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to (1- (length quail-current-str))))) )) ((and viper-special-input-method - viper-xemacs-p + (featurep 'xemacs) (fboundp 'quail-start-translation)) ;; same as above but for XEmacs, which doesn't have ;; quail-input-method @@ -893,7 +893,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to (t ;;(setq ch (read-char-exclusive)) (setq ch (aref (read-key-sequence nil) 0)) - (if viper-xemacs-p + (if (featurep 'xemacs) (setq ch (event-to-character ch))) ;; replace ^M with the newline (if (eq ch ?\C-m) (setq ch ?\n)) @@ -902,13 +902,13 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to (progn ;;(setq ch (read-char-exclusive)) (setq ch (aref (read-key-sequence nil) 0)) - (if viper-xemacs-p + (if (featurep 'xemacs) (setq ch (event-to-character ch)))) ) (insert ch)) ) (setq last-command-event - (viper-copy-event (if viper-xemacs-p + (viper-copy-event (if (featurep 'xemacs) (character-to-event ch) ch))) ) ; let (error nil) @@ -1080,10 +1080,10 @@ as a Meta key and any number of multiple escapes is allowed." ;; and return ESC as the key-sequence (viper-set-unread-command-events (viper-subseq keyseq 1)) (setq last-input-event event - keyseq (if viper-emacs-p + keyseq (if (featurep 'emacs) "\e" (vector (character-to-event ?\e))))) - ((and viper-xemacs-p + ((and (featurep 'xemacs) (key-press-event-p first-key) (equal '(meta) key-mod)) (viper-set-unread-command-events @@ -1320,7 +1320,7 @@ as a Meta key and any number of multiple escapes is allowed." (setq last-command-char char) (setq last-command-event (viper-copy-event - (if viper-xemacs-p (character-to-event char) char))) + (if (featurep 'xemacs) (character-to-event char) char))) (condition-case err (funcall cmd-to-exec-at-end cmd-info) (error @@ -2791,7 +2791,7 @@ On reaching beginning of line, stop and signal error." (defun viper-next-line-carefully (arg) (condition-case nil ;; do not use forward-line! need to keep column - (next-line arg) + (with-no-warnings (next-line arg)) (error nil))) @@ -3091,7 +3091,7 @@ On reaching beginning of line, stop and signal error." (com (viper-getCom arg))) (if com (viper-move-marker-locally 'viper-com-point (point))) ;; do not use forward-line! need to keep column - (next-line val) + (with-no-warnings (next-line val)) (if viper-ex-style-motion (if (and (eolp) (not (bolp))) (backward-char 1))) (setq this-command 'next-line) @@ -3135,7 +3135,7 @@ If point is on a widget or a button, simulate clicking on that widget/button." (com (viper-getCom arg))) (if com (viper-move-marker-locally 'viper-com-point (point))) ;; do not use forward-line! need to keep column - (previous-line val) + (with-no-warnings (previous-line val)) (if viper-ex-style-motion (if (and (eolp) (not (bolp))) (backward-char 1))) (setq this-command 'previous-line) diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index d9cc97719ca..caeecd12c8a 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -1103,7 +1103,7 @@ reversed." beg end cont val) (viper-add-keymap ex-read-filename-map - (if viper-emacs-p + (if (featurep 'emacs) minibuffer-local-completion-map read-file-name-map)) @@ -1558,7 +1558,7 @@ reversed." ;; setup buffer (if (setq wind (viper-get-visible-buffer-window buf)) () - (setq wind (get-lru-window (if viper-xemacs-p nil 'visible))) + (setq wind (get-lru-window (if (featurep 'xemacs) nil 'visible))) (set-window-buffer wind buf)) (if (viper-window-display-p) @@ -1878,7 +1878,7 @@ reversed." (condition-case nil (progn (pop-to-buffer (get-buffer-create "*info*")) - (info (if viper-xemacs-p "viper.info" "viper")) + (info (if (featurep 'xemacs) "viper.info" "viper")) (message "Type `i' to search for a specific topic")) (error (beep 1) (with-output-to-temp-buffer " *viper-info*" @@ -1887,7 +1887,7 @@ The Info file for Viper does not seem to be installed. This file is part of the standard distribution of %sEmacs. Please contact your system administrator. " - (if viper-xemacs-p "X" "") + (if (featurep 'xemacs) "X" "") )))))) ;; Ex source command. Loads the file specified as argument or `~/.viper' diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 1b05ef7189d..1b1e07a0a0c 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -49,10 +49,6 @@ (interactive) (message "Viper version is %s" viper-version)) -;; Is it XEmacs? -(defconst viper-xemacs-p (featurep 'xemacs)) -;; Is it Emacs? -(defconst viper-emacs-p (not viper-xemacs-p)) ;; Tell whether we are running as a window application or on a TTY ;; This is used to avoid compilation warnings. When emacs/xemacs forms can @@ -116,8 +112,8 @@ In all likelihood, you don't need to bother with this setting." (cond ((viper-window-display-p)) (viper-force-faces) ((viper-color-display-p)) - (viper-emacs-p (memq (viper-device-type) '(pc))) - (viper-xemacs-p (memq (viper-device-type) '(tty pc))))) + ((featurep 'emacs) (memq (viper-device-type) '(pc))) + ((featurep 'xemacs) (memq (viper-device-type) '(tty pc))))) ;;; Macros @@ -356,9 +352,9 @@ Use `M-x viper-set-expert-level' to change this.") ""))))) (defun viper-inactivate-input-method () - (cond ((and viper-emacs-p (fboundp 'inactivate-input-method)) + (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method)) (inactivate-input-method)) - ((and viper-xemacs-p (boundp 'current-input-method)) + ((and (featurep 'xemacs) (boundp 'current-input-method)) ;; XEmacs had broken quil-mode for some time, so we are working around ;; it here (setq quail-mode nil) @@ -370,7 +366,7 @@ Use `M-x viper-set-expert-level' to change this.") (force-mode-line-update)) )) (defun viper-activate-input-method () - (cond ((and viper-emacs-p (fboundp 'activate-input-method)) + (cond ((and (featurep 'emacs) (fboundp 'activate-input-method)) (activate-input-method default-input-method)) ((featurep 'xemacs) (if (fboundp 'quail-mode) (quail-mode 1))))) @@ -475,7 +471,7 @@ is non-nil." :group 'viper) (defcustom viper-use-replace-region-delimiters (or (not (viper-has-face-support-p)) - (and viper-xemacs-p (eq (viper-device-type) 'tty))) + (and (featurep 'xemacs) (eq (viper-device-type) 'tty))) "*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." @@ -1018,13 +1014,13 @@ Should be set in `~/.viper' file." (defun viper-restore-cursor-type () (condition-case nil - (if viper-xemacs-p + (if (featurep 'xemacs) (set (make-local-variable 'bar-cursor) nil) (setq cursor-type default-cursor-type)) (error nil))) (defun viper-set-insert-cursor-type () - (if viper-xemacs-p + (if (featurep 'xemacs) (set (make-local-variable 'bar-cursor) 2) (setq cursor-type '(bar . 2)))) diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el index bf3f0eefb39..788feaf86e6 100644 --- a/lisp/emulation/viper-macs.el +++ b/lisp/emulation/viper-macs.el @@ -826,7 +826,7 @@ name from there." (defun viper-char-array-to-macro (array) (let ((vec (vconcat array)) macro) - (if viper-xemacs-p + (if (featurep 'xemacs) (setq macro (mapcar 'character-to-event vec)) (setq macro vec)) (vconcat (mapcar 'viper-event-key macro)))) diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index e95e80aa4e0..7a47d321890 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el @@ -79,7 +79,7 @@ or a tripple-click." ;; time interval in millisecond within which successive clicks are ;; considered related (defcustom viper-multiclick-timeout (if (viper-window-display-p) - (if viper-xemacs-p + (if (featurep 'xemacs) mouse-track-multi-click-time double-click-time) 500) @@ -227,7 +227,7 @@ is ignored." ) ; if ;; XEmacs doesn't have set-text-properties, but there buffer-substring ;; doesn't return properties together with the string, so it's not needed. - (if viper-emacs-p + (if (featurep 'emacs) (set-text-properties 0 (length result) nil result)) result )) @@ -273,7 +273,7 @@ See `viper-surrounding-word' for the definition of a word in this case." 'viper-mouse-catch-frame-switch)) (not (eq (key-binding viper-mouse-up-insert-key-parsed) 'viper-mouse-click-insert-word)) - (and viper-xemacs-p (not (event-over-text-area-p click))))) + (and (featurep 'xemacs) (not (event-over-text-area-p click))))) () ; do nothing, if binding isn't right or not over text ;; turn arg into a number (cond ((integerp arg) nil) @@ -364,7 +364,7 @@ this command." 'viper-mouse-catch-frame-switch)) (not (eq (key-binding viper-mouse-up-search-key-parsed) 'viper-mouse-click-search-word)) - (and viper-xemacs-p (not (event-over-text-area-p click))))) + (and (featurep 'xemacs) (not (event-over-text-area-p click))))) () ; do nothing, if binding isn't right or not over text (let ((previous-search-string viper-s-string) click-word click-count) @@ -507,19 +507,19 @@ bindings in the Viper manual." () (setq button-spec (cond ((memq 1 key) - (if viper-emacs-p + (if (featurep 'emacs) (if (eq 'up event-type) "mouse-1" "down-mouse-1") (if (eq 'up event-type) 'button1up 'button1))) ((memq 2 key) - (if viper-emacs-p + (if (featurep 'emacs) (if (eq 'up event-type) "mouse-2" "down-mouse-2") (if (eq 'up event-type) 'button2up 'button2))) ((memq 3 key) - (if viper-emacs-p + (if (featurep 'emacs) (if (eq 'up event-type) "mouse-3" "down-mouse-3") (if (eq 'up event-type) @@ -528,18 +528,18 @@ bindings in the Viper manual." "%S: invalid button number, %S" key-var key))) meta-spec (if (memq 'meta key) - (if viper-emacs-p "M-" 'meta) - (if viper-emacs-p "" nil)) + (if (featurep 'emacs) "M-" 'meta) + (if (featurep 'emacs) "" nil)) shift-spec (if (memq 'shift key) - (if viper-emacs-p "S-" 'shift) - (if viper-emacs-p "" nil)) + (if (featurep 'emacs) "S-" 'shift) + (if (featurep 'emacs) "" nil)) control-spec (if (memq 'control key) - (if viper-emacs-p "C-" 'control) - (if viper-emacs-p "" nil))) + (if (featurep 'emacs) "C-" 'control) + (if (featurep 'emacs) "" nil))) - (setq key-spec (if viper-emacs-p + (setq key-spec (if (featurep 'emacs) (vector (intern (concat diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 7073cd019dd..c757eb63aef 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -64,48 +64,34 @@ (fset 'x-color-defined-p (symbol-function 'ns-color-defined-p))) -;;; XEmacs support - - -(viper-cond-compile-for-xemacs-or-emacs - (progn ; xemacs - (fset 'viper-overlay-p (symbol-function 'extentp)) - (fset 'viper-make-overlay (symbol-function 'make-extent)) - (fset 'viper-overlay-live-p (symbol-function 'extent-live-p)) - (fset 'viper-move-overlay (symbol-function 'set-extent-endpoints)) - (fset 'viper-overlay-start (symbol-function 'extent-start-position)) - (fset 'viper-overlay-end (symbol-function 'extent-end-position)) - (fset 'viper-overlay-get (symbol-function 'extent-property)) - (fset 'viper-overlay-put (symbol-function 'set-extent-property)) - (fset 'viper-read-event (symbol-function 'next-command-event)) - (fset 'viper-characterp (symbol-function 'characterp)) - (fset 'viper-int-to-char (symbol-function 'int-to-char)) - (if (viper-window-display-p) - (fset 'viper-iconify (symbol-function 'iconify-frame))) - (cond ((viper-has-face-support-p) - (fset 'viper-get-face (symbol-function 'get-face)) - (fset 'viper-color-defined-p (symbol-function 'valid-color-name-p)) - ))) - (progn ; emacs - (fset 'viper-overlay-p (symbol-function 'overlayp)) - (fset 'viper-make-overlay (symbol-function 'make-overlay)) - (fset 'viper-overlay-live-p (symbol-function 'overlayp)) - (fset 'viper-move-overlay (symbol-function 'move-overlay)) - (fset 'viper-overlay-start (symbol-function 'overlay-start)) - (fset 'viper-overlay-end (symbol-function 'overlay-end)) - (fset 'viper-overlay-get (symbol-function 'overlay-get)) - (fset 'viper-overlay-put (symbol-function 'overlay-put)) - (fset 'viper-read-event (symbol-function 'read-event)) - (fset 'viper-characterp (symbol-function 'integerp)) - (fset 'viper-int-to-char (symbol-function 'identity)) - (if (viper-window-display-p) - (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame))) - (cond ((viper-has-face-support-p) - (fset 'viper-get-face (symbol-function 'internal-get-face)) - (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p)) - ))) - ) - +(defalias 'viper-overlay-p + (if (featurep 'xemacs) 'extentp 'overlayp)) +(defalias 'viper-make-overlay + (if (featurep 'xemacs) 'make-extent 'make-overlay)) +(defalias 'viper-overlay-live-p + (if (featurep 'xemacs) 'extent-live-p 'overlayp)) +(defalias 'viper-move-overlay + (if (featurep 'xemacs) 'set-extent-endpoints 'move-overlay)) +(defalias 'viper-overlay-start + (if (featurep 'xemacs) 'extent-start-position 'overlay-start)) +(defalias 'viper-overlay-end + (if (featurep 'xemacs) 'extent-end-position 'overlay-end)) +(defalias 'viper-overlay-get + (if (featurep 'xemacs) 'extent-property 'overlay-get)) +(defalias 'viper-overlay-put + (if (featurep 'xemacs) 'set-extent-property 'overlay-put)) +(defalias 'viper-read-event + (if (featurep 'xemacs) 'next-command-event 'read-event)) +(defalias 'viper-characterp + (if (featurep 'xemacs) 'characterp 'integerp)) +(defalias 'viper-int-to-char + (if (featurep 'xemacs) 'int-to-char 'identity)) +(defalias 'viper-get-face + (if (featurep 'xemacs) 'get-face 'internal-get-face)) +(defalias 'viper-color-defined-p + (if (featurep 'xemacs) 'valid-color-name-p 'x-color-defined-p)) +(defalias 'viper-iconify + (if (featurep 'xemacs) 'iconify-frame 'iconify-or-deiconify-frame)) ;; CHAR is supposed to be a char or an integer (positive or negative) @@ -201,7 +187,7 @@ (defsubst viper-get-saved-cursor-color-in-replace-mode () (or (funcall - (if viper-emacs-p 'frame-parameter 'frame-property) + (if (featurep 'emacs) 'frame-parameter 'frame-property) (selected-frame) 'viper-saved-cursor-color-in-replace-mode) (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) @@ -211,7 +197,7 @@ (defsubst viper-get-saved-cursor-color-in-insert-mode () (or (funcall - (if viper-emacs-p 'frame-parameter 'frame-property) + (if (featurep 'emacs) 'frame-parameter 'frame-property) (selected-frame) 'viper-saved-cursor-color-in-insert-mode) (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) @@ -221,7 +207,7 @@ (defsubst viper-get-saved-cursor-color-in-emacs-mode () (or (funcall - (if viper-emacs-p 'frame-parameter 'frame-property) + (if (featurep 'emacs) 'frame-parameter 'frame-property) (selected-frame) 'viper-saved-cursor-color-in-emacs-mode) viper-vi-state-cursor-color)) @@ -249,8 +235,8 @@ ;; testing for sufficiently high Emacs versions. (defun viper-check-version (op major minor &optional type-of-emacs) (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version)) - (and (cond ((eq type-of-emacs 'xemacs) viper-xemacs-p) - ((eq type-of-emacs 'emacs) viper-emacs-p) + (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) + ((eq type-of-emacs 'emacs) (featurep 'emacs)) (t t)) (cond ((eq op '=) (and (= emacs-minor-version minor) (= emacs-major-version major))) @@ -267,7 +253,7 @@ (defun viper-get-visible-buffer-window (wind) - (if viper-xemacs-p + (if (featurep 'xemacs) (get-buffer-window wind t) (get-buffer-window wind 'visible))) @@ -724,13 +710,14 @@ (defsubst viper-file-checked-in-p (file) (and (featurep 'vc-hooks) ;; CVS files are considered not checked in + ;; FIXME: Should this deal with more than CVS? (not (memq (vc-backend file) '(nil CVS))) (if (fboundp 'vc-state) (and (not (memq (vc-state file) '(edited needs-merge))) (not (stringp (vc-state file)))) ;; XEmacs has no vc-state - (not (vc-locking-user file))) + (if (featurep 'xemacs)(not (vc-locking-user file)))) )) ;; checkout if visited file is checked in @@ -787,7 +774,7 @@ (setq viper-replace-overlay (viper-make-overlay beg end (current-buffer))) ;; never detach (viper-overlay-put - viper-replace-overlay (if viper-emacs-p 'evaporate 'detachable) nil) + viper-replace-overlay (if (featurep 'emacs) 'evaporate 'detachable) nil) (viper-overlay-put viper-replace-overlay 'priority viper-replace-overlay-priority) ;; If Emacs will start supporting overlay maps, as it currently supports @@ -795,7 +782,7 @@ ;; just have keymap attached to replace overlay. ;;(viper-overlay-put ;; viper-replace-overlay - ;; (if viper-xemacs-p 'keymap 'local-map) + ;; (if (featurep 'xemacs) 'keymap 'local-map) ;; viper-replace-map) ) (if (viper-has-face-support-p) @@ -811,8 +798,8 @@ (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)) - (after-name (if viper-xemacs-p 'end-glyph 'after-string))) + (let ((before-name (if (featurep 'xemacs) 'begin-glyph 'before-string)) + (after-name (if (featurep 'xemacs) 'end-glyph 'after-string))) (viper-overlay-put viper-replace-overlay before-name before-glyph) (viper-overlay-put viper-replace-overlay after-name after-glyph)))) @@ -843,11 +830,11 @@ ;; never detach (viper-overlay-put viper-minibuffer-overlay - (if viper-emacs-p 'evaporate 'detachable) + (if (featurep 'emacs) 'evaporate 'detachable) nil) ;; make viper-minibuffer-overlay open-ended ;; In emacs, it is made open ended at creation time - (if viper-xemacs-p + (if (featurep 'xemacs) (progn (viper-overlay-put viper-minibuffer-overlay 'start-open nil) (viper-overlay-put viper-minibuffer-overlay 'end-open nil))) @@ -860,7 +847,7 @@ (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1) (1+ (buffer-size))) (setq viper-minibuffer-overlay - (if viper-xemacs-p + (if (featurep 'xemacs) (viper-make-overlay 1 (1+ (buffer-size)) (current-buffer)) ;; make overlay open-ended (viper-make-overlay @@ -983,7 +970,7 @@ (defun viper-read-key-sequence (prompt &optional continue-echo) (let (inhibit-quit event keyseq) (setq keyseq (read-key-sequence prompt continue-echo)) - (setq event (if viper-xemacs-p + (setq event (if (featurep 'xemacs) (elt keyseq 0) ; XEmacs returns vector of events (elt (listify-key-sequence keyseq) 0))) (if (viper-ESC-event-p event) @@ -1078,7 +1065,7 @@ (defun viper-key-to-emacs-key (key) (let (key-name char-p modifiers mod-char-list base-key base-key-name) - (cond (viper-xemacs-p key) + (cond ((featurep 'xemacs) key) ((symbolp key) (setq key-name (symbol-name key)) @@ -1086,10 +1073,10 @@ (string-to-char key-name)) ;; Emacs doesn't recognize `return' and `escape' as events on ;; dumb terminals, so we translate them into characters - ((and viper-emacs-p (not (viper-window-display-p)) + ((and (featurep 'emacs) (not (viper-window-display-p)) (string= key-name "return")) ?\C-m) - ((and viper-emacs-p (not (viper-window-display-p)) + ((and (featurep 'emacs) (not (viper-window-display-p)) (string= key-name "escape")) ?\e) ;; pass symbol-event as is @@ -1123,14 +1110,15 @@ ;; LIS is assumed to be a list of events of characters (defun viper-eventify-list-xemacs (lis) - (mapcar - (lambda (elt) - (cond ((viper-characterp elt) (character-to-event elt)) - ((eventp elt) elt) - (t (error - "viper-eventify-list-xemacs: can't convert to event, %S" - elt)))) - lis)) + (if (featurep 'xemacs) + (mapcar + (lambda (elt) + (cond ((viper-characterp elt) (character-to-event elt)) + ((eventp elt) elt) + (t (error + "viper-eventify-list-xemacs: can't convert to event, %S" + elt)))) + lis))) ;; Smoothes out the difference between Emacs' unread-command-events @@ -1142,7 +1130,7 @@ ;; into an event. Below, we delete nil from event lists, since nil is the most ;; common symbol that might appear in this wrong context. (defun viper-set-unread-command-events (arg) - (if viper-emacs-p + (if (featurep 'emacs) (setq unread-command-events (let ((new-events diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index c0118250167..65d40e8bad7 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -690,7 +690,7 @@ It also can't undo some Viper settings." (setq default-major-mode (viper-standard-value 'default-major-mode viper-saved-non-viper-variables)) - (if viper-emacs-p + (if (featurep 'emacs) (setq-default mark-even-if-inactive (viper-standard-value @@ -701,7 +701,7 @@ It also can't undo some Viper settings." (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) (viper-delocalize-var 'minor-mode-map-alist)) (viper-delocalize-var 'require-final-newline) - (if viper-xemacs-p (viper-delocalize-var 'bar-cursor)) + (if (featurep 'xemacs) (viper-delocalize-var 'bar-cursor)) ;; deactivate all advices done by Viper. @@ -788,7 +788,7 @@ It also can't undo some Viper settings." ;; In emacs, we have to advice handle-switch-frame ;; This advice is undone earlier, when all advices matchine "viper-" are ;; deactivated. - (if viper-xemacs-p + (if (featurep 'xemacs) (remove-hook 'mouse-leave-frame-hook 'viper-remember-current-frame)) ) ; end viper-go-away @@ -981,7 +981,7 @@ It also can't undo some Viper settings." ))) ;; International input methods - (if viper-emacs-p + (if (featurep 'emacs) (eval-after-load "mule-cmds" '(progn (defadvice inactivate-input-method (after viper-mule-advice activate) @@ -1022,7 +1022,7 @@ It also can't undo some Viper settings." require-final-newline t) ;; don't bark when mark is inactive - (if viper-emacs-p + (if (featurep 'emacs) (setq mark-even-if-inactive t)) (setq scroll-step 1) @@ -1094,12 +1094,12 @@ It also can't undo some Viper settings." "Use `read-file-name' for reading arguments." (interactive (cons (read-file-name "Find file: " nil default-directory) ;; XEmacs: if Mule & prefix arg, ask for coding system - (cond ((and viper-xemacs-p (featurep 'mule)) + (cond ((and (featurep 'xemacs) (featurep 'mule)) (list (and current-prefix-arg (read-coding-system "Coding-system: ")))) ;; Emacs: do wildcards - ((and viper-emacs-p (boundp 'find-file-wildcards)) + ((and (featurep 'emacs) (boundp 'find-file-wildcards)) (list find-file-wildcards)))) )) @@ -1108,12 +1108,12 @@ It also can't undo some Viper settings." (interactive (cons (read-file-name "Find file in other window: " nil default-directory) ;; XEmacs: if Mule & prefix arg, ask for coding system - (cond ((and viper-xemacs-p (featurep 'mule)) + (cond ((and (featurep 'xemacs) (featurep 'mule)) (list (and current-prefix-arg (read-coding-system "Coding-system: ")))) ;; Emacs: do wildcards - ((and viper-emacs-p (boundp 'find-file-wildcards)) + ((and (featurep 'emacs) (boundp 'find-file-wildcards)) (list find-file-wildcards)))) )) @@ -1123,12 +1123,12 @@ It also can't undo some Viper settings." (interactive (cons (read-file-name "Find file in other frame: " nil default-directory) ;; XEmacs: if Mule & prefix arg, ask for coding system - (cond ((and viper-xemacs-p (featurep 'mule)) + (cond ((and (featurep 'xemacs) (featurep 'mule)) (list (and current-prefix-arg (read-coding-system "Coding-system: ")))) ;; Emacs: do wildcards - ((and viper-emacs-p (boundp 'find-file-wildcards)) + ((and (featurep 'emacs) (boundp 'find-file-wildcards)) (list find-file-wildcards)))) )) @@ -1159,7 +1159,7 @@ It also can't undo some Viper settings." ;; catch frame switching event (if (viper-window-display-p) - (if viper-xemacs-p + (if (featurep 'xemacs) (add-hook 'mouse-leave-frame-hook 'viper-remember-current-frame) (defadvice handle-switch-frame (before viper-frame-advice activate) @@ -1227,7 +1227,7 @@ These two lines must come in the order given. (cons 'mode-line-buffer-identification (list (default-value 'mode-line-buffer-identification))) (cons 'global-mode-string (list global-mode-string)) - (if viper-emacs-p + (if (featurep 'emacs) (cons 'mark-even-if-inactive (list mark-even-if-inactive))) ))) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 01c4c09c954..43cb61cba6b 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -59,7 +59,8 @@ (defvar gud-find-expr-function) (defvar imenu-case-fold-search) (defvar imenu-syntax-alist) - +(defvar comment-region-function) +(defvar uncomment-region-function) (defgroup fortran nil "Major mode for editing fixed format Fortran code." diff --git a/lisp/vc.el b/lisp/vc.el index 1bc6aac856d..474c41c30ae 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1930,9 +1930,7 @@ returns t if the buffer had changes, nil otherwise." (message "No changes between %s and %s" rev1-name rev2-name) nil) (pop-to-buffer (current-buffer)) - ;; Gnus-5.8.5 sets up an autoload for diff-mode, even if it's - ;; not available. Work around that. - (if (require 'diff-mode nil t) (diff-mode)) + (diff-mode) (vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name)) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. -- 2.11.4.GIT