aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu <[email protected]>2007-10-21 17:22:04 +0000
committerDan Nicolaescu <[email protected]>2007-10-21 17:22:04 +0000
commitf82460271ec718957a1ae311c2cdbd8f7d5ca8c4 (patch)
treed207d4304089ead427d20211bcf3fab48342ce32
parent3cd79f623b94e3aeef6c08dde13128733e5e6dec (diff)
* emulation/edt-mapper.el (function-key-map):
(edt-map-key): Make it a function instead of using fset. Inline edt-gnu-map-key and edt-lucid-map-key. Use featurep 'xemacs. (edt-gnu-map-key, edt-lucid-map-key): Remove. (edt-x-emacs-p): Remove. (edt-emacs-variant, edt-window-system, edt-xserver): Use featurep 'xemacs. * net/eudc.el: Use (featurep 'xemacs) instead of the string test. Replace eudc-xemacs-p with its definition. (eudc-xemacs-p, eudc-emacs-p, eudc-xemacs-mule-p) (eudc-emacs-mule-p): Remove. (eudc-install-menu, eudc-mode): Replace eudc-emacs-p and eudc-xemacs-p with feature tests. * net/eudc-bob.el (eudc-bob-generic-menu, eudc-bob-mail-keymap) (eudc-bob-url-keymap, eudc-bob-sound-keymap) (eudc-bob-generic-keymap, eudc-bob-popup-menu) (eudc-bob-toggle-inline-display): * net/eudc-hotlist.el (eudc-hotlist-emacs-menu): Replace eudc-emacs-p and eudc-xemacs-p with feature tests. * net/eudcb-ph.el (eudc-ph-open-session): Replace eudc-xemacs-mule-p with its former definition. * progmodes/octave-mod.el (octave-xemacs-p): Remove. (octave-abbrev-start): Replace octave-xemacs-p with (featurep 'xemacs). * progmodes/vera-mode.el (vera-xemacs): Remove. (vera-mode-syntax-table): Replace vera-xemacs with (featurep 'xemacs). * progmodes/vhdl-mode.el (vhdl-xemacs): Remove. (vhdl-doc-mode, vhdl-doc-variable, vhdl-compile-init) (vhdl-speedbar-initialize, vhdl-ps-print-init) (vhdl-forward-comment, vhdl-mode-map-init, vhdl-show-messages) (vhdl-emacs-22, vhdl-emacs-21): Replace vhdl-xemacs with (featurep 'xemacs). * progmodes/antlr-mode.el (cond-emacs-xemacs-macfn, defunx) (save-buffer-state-x): * obsolete/fast-lock.el (fast-lock-verbose): * emulation/viper-init.el (viper-xemacs-p) (viper-cond-compile-for-xemacs-or-emacs): * emacs-lisp/checkdoc.el (checkdoc-minor-mode-map): * ps-print.el (case-fold-search): * ediff-hook.el (ediff-cond-compile-for-xemacs-or-emacs): * calculator.el (calculator-help): Use featurep 'xemacs.
-rw-r--r--lisp/ChangeLog50
-rw-r--r--lisp/calculator.el2
-rw-r--r--lisp/ediff-hook.el4
-rw-r--r--lisp/emacs-lisp/checkdoc.el2
-rw-r--r--lisp/emulation/edt-mapper.el71
-rw-r--r--lisp/emulation/viper-init.el4
-rw-r--r--lisp/net/eudc-bob.el39
-rw-r--r--lisp/net/eudc-hotlist.el10
-rw-r--r--lisp/net/eudc.el17
-rw-r--r--lisp/net/eudcb-ph.el2
-rw-r--r--lisp/obsolete/fast-lock.el2
-rw-r--r--lisp/progmodes/antlr-mode.el8
-rw-r--r--lisp/progmodes/octave-mod.el5
-rw-r--r--lisp/progmodes/vera-mode.el8
-rw-r--r--lisp/progmodes/vhdl-mode.el33
-rw-r--r--lisp/ps-print.el2
16 files changed, 144 insertions, 115 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e346d83e34..f03f5cc953 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,55 @@
2007-10-21 Dan Nicolaescu <[email protected]>
+ * emulation/edt-mapper.el (function-key-map):
+ (edt-map-key): Make it a function instead of using fset. Inline
+ edt-gnu-map-key and edt-lucid-map-key. Use featurep 'xemacs.
+ (edt-gnu-map-key, edt-lucid-map-key): Remove.
+ (edt-x-emacs-p): Remove.
+ (edt-emacs-variant, edt-window-system, edt-xserver):
+ Use featurep 'xemacs.
+
+ * net/eudc.el: Use (featurep 'xemacs) instead of the string test.
+ Replace eudc-xemacs-p with its definition.
+ (eudc-xemacs-p, eudc-emacs-p, eudc-xemacs-mule-p)
+ (eudc-emacs-mule-p): Remove.
+ (eudc-install-menu, eudc-mode): Replace eudc-emacs-p and
+ eudc-xemacs-p with feature tests.
+
+ * net/eudc-bob.el (eudc-bob-generic-menu, eudc-bob-mail-keymap)
+ (eudc-bob-url-keymap, eudc-bob-sound-keymap)
+ (eudc-bob-generic-keymap, eudc-bob-popup-menu)
+ (eudc-bob-toggle-inline-display):
+ * net/eudc-hotlist.el (eudc-hotlist-emacs-menu): Replace
+ eudc-emacs-p and eudc-xemacs-p with feature tests.
+
+ * net/eudcb-ph.el (eudc-ph-open-session): Replace
+ eudc-xemacs-mule-p with its former definition.
+
+ * progmodes/octave-mod.el (octave-xemacs-p): Remove.
+ (octave-abbrev-start): Replace octave-xemacs-p with
+ (featurep 'xemacs).
+
+ * progmodes/vera-mode.el (vera-xemacs): Remove.
+ (vera-mode-syntax-table): Replace vera-xemacs with
+ (featurep 'xemacs).
+
+ * progmodes/vhdl-mode.el (vhdl-xemacs): Remove.
+ (vhdl-doc-mode, vhdl-doc-variable, vhdl-compile-init)
+ (vhdl-speedbar-initialize, vhdl-ps-print-init)
+ (vhdl-forward-comment, vhdl-mode-map-init, vhdl-show-messages)
+ (vhdl-emacs-22, vhdl-emacs-21): Replace vhdl-xemacs
+ with (featurep 'xemacs).
+
+ * progmodes/antlr-mode.el (cond-emacs-xemacs-macfn, defunx)
+ (save-buffer-state-x):
+ * obsolete/fast-lock.el (fast-lock-verbose):
+ * emulation/viper-init.el (viper-xemacs-p)
+ (viper-cond-compile-for-xemacs-or-emacs):
+ * emacs-lisp/checkdoc.el (checkdoc-minor-mode-map):
+ * ps-print.el (case-fold-search):
+ * ediff-hook.el (ediff-cond-compile-for-xemacs-or-emacs):
+ * calculator.el (calculator-help): Use featurep 'xemacs.
+
* progmodes/prolog.el: Undo previous change.
(comint-prompt-regexp, comint-process-echoes): Pacify
byte-compiler.
diff --git a/lisp/calculator.el b/lisp/calculator.el
index 2676bedadb..aca37dd7cd 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -1715,7 +1715,7 @@ Used by `calculator-paste' and `get-register'."
(use-global-map calculator-saved-global-map))
(if (or (not calculator-electric-mode)
;; XEmacs has a problem with electric-describe-mode
- (string-match "XEmacs" (emacs-version)))
+ (featurep 'xemacs))
(describe-mode)
(electric-describe-mode))
(if calculator-electric-mode
diff --git a/lisp/ediff-hook.el b/lisp/ediff-hook.el
index 951abc20f7..00e6ba6bab 100644
--- a/lisp/ediff-hook.el
+++ b/lisp/ediff-hook.el
@@ -53,10 +53,10 @@
;; compiler at hand (emacs or xemacs).
;; The autoload, below, is useless in Emacs because ediff-hook.el
;; is dumped with emacs, but it is needed in XEmacs
-;;;###autoload (defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form) (if (string-match "XEmacs" emacs-version) xemacs-form emacs-form))
+;;;###autoload (defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form) (if (featurep 'xemacs) xemacs-form emacs-form))
(defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form)
- (if (string-match "XEmacs" emacs-version)
+ (if (featurep 'xemacs)
xemacs-form emacs-form))
;; This autoload is useless in Emacs because ediff-hook.el is dumped with
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index edbf382f39..185df6fbe4 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1182,7 +1182,7 @@ generating a buffered list of errors."
;; Override some bindings
(define-key map "\C-\M-x" 'checkdoc-eval-defun)
(define-key map "\C-x`" 'checkdoc-continue)
- (if (not (string-match "XEmacs" emacs-version))
+ (if (not (featurep 'xemacs))
(define-key map [menu-bar emacs-lisp eval-buffer]
'checkdoc-eval-current-buffer))
;; Add some new bindings under C-c ?
diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el
index 9cf377f564..484cfe58b3 100644
--- a/lisp/emulation/edt-mapper.el
+++ b/lisp/emulation/edt-mapper.el
@@ -118,17 +118,17 @@
;;; Decide Emacs Variant, GNU Emacs or XEmacs (aka Lucid Emacs).
;;; Determine Window System, and X Server Vendor (if appropriate).
;;;
-(defconst edt-x-emacs-p (string-match "XEmacs" emacs-version)
+(defconst (featurep 'xemacs) (string-match "XEmacs" emacs-version)
"Non-nil if we are running XEmacs version 19, or higher.")
-(defconst edt-emacs-variant (if edt-x-emacs-p "xemacs" "gnu")
+(defconst edt-emacs-variant (if (featurep 'xemacs) "xemacs" "gnu")
"Indicates Emacs variant: GNU Emacs or XEmacs \(aka Lucid Emacs\).")
-(defconst edt-window-system (if edt-x-emacs-p (console-type) window-system)
+(defconst edt-window-system (if (featurep 'xemacs) (console-type) window-system)
"Indicates window system \(in GNU Emacs\) or console type \(in XEmacs\).")
(defconst edt-xserver (if (eq edt-window-system 'x)
- (if edt-x-emacs-p
+ (if (featurep 'xemacs)
;; The Cygwin window manager has a `/' in its
;; name, which breaks the generated file name of
;; the custom key map file. Replace `/' with a
@@ -245,7 +245,7 @@
;;; function-key-map.
;;;
(cond
- (edt-x-emacs-p
+ ((featurep 'xemacs)
(setq edt-return-seq (read-key-sequence "Hit carriage-return <CR> to continue "))
(setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]")))
(t
@@ -327,40 +327,37 @@
;;;
;;; Key mapping functions
;;;
-(defun edt-lucid-map-key (ident descrip)
+(defun edt-map-key (ident descrip)
(interactive)
- (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
- (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]"))
- (cond ((not (equal edt-key edt-return))
- (set-buffer "Keys")
- (insert (format " (\"%s\" . %s)\n" ident edt-key))
- (set-buffer "Directions"))
- ;; bogosity to get next prompt to come up, if the user hits <CR>!
- ;; check periodically to see if this is still needed...
- (t
- (set-buffer "Keys")
- (insert (format " (\"%s\" . \"\" )\n" ident))
- (set-buffer "Directions")))
+ (if (featurep 'xemacs)
+ (progn
+ (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
+ (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]"))
+ (cond ((not (equal edt-key edt-return))
+ (set-buffer "Keys")
+ (insert (format " (\"%s\" . %s)\n" ident edt-key))
+ (set-buffer "Directions"))
+ ;; bogosity to get next prompt to come up, if the user hits <CR>!
+ ;; check periodically to see if this is still needed...
+ (t
+ (set-buffer "Keys")
+ (insert (format " (\"%s\" . \"\" )\n" ident))
+ (set-buffer "Directions"))))
+ (setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip)))
+ (cond ((not (equal edt-key edt-return))
+ (set-buffer "Keys")
+ (insert (if (vectorp edt-key)
+ (format " (\"%s\" . %s)\n" ident edt-key)
+ (format " (\"%s\" . \"%s\")\n" ident edt-key)))
+ (set-buffer "Directions"))
+ ;; bogosity to get next prompt to come up, if the user hits <CR>!
+ ;; check periodically to see if this is still needed...
+ (t
+ (set-buffer "Keys")
+ (insert (format " (\"%s\" . \"\" )\n" ident))
+ (set-buffer "Directions"))))
edt-key)
-(defun edt-gnu-map-key (ident descrip)
- (interactive)
- (setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip)))
- (cond ((not (equal edt-key edt-return))
- (set-buffer "Keys")
- (insert (if (vectorp edt-key)
- (format " (\"%s\" . %s)\n" ident edt-key)
- (format " (\"%s\" . \"%s\")\n" ident edt-key)))
- (set-buffer "Directions"))
- ;; bogosity to get next prompt to come up, if the user hits <CR>!
- ;; check periodically to see if this is still needed...
- (t
- (set-buffer "Keys")
- (insert (format " (\"%s\" . \"\" )\n" ident))
- (set-buffer "Directions")))
- edt-key)
-
-(fset 'edt-map-key (if edt-x-emacs-p 'edt-lucid-map-key 'edt-gnu-map-key))
(set-buffer "Keys")
(insert "
;;
@@ -494,7 +491,7 @@
;;;
;;; Restore function-key-map.
;;;
-(if (and edt-window-system (not edt-x-emacs-p))
+(if (and edt-window-system (not (featurep 'xemacs)))
(setq function-key-map edt-save-function-key-map))
(setq EDT-key-name "")
(while (not
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 2b0e886b9c..1b05ef7189 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -50,7 +50,7 @@
(message "Viper version is %s" viper-version))
;; Is it XEmacs?
-(defconst viper-xemacs-p (string-match "XEmacs" emacs-version))
+(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
@@ -61,7 +61,7 @@
;; compiler at hand.
;; Suggested by rms.
(defmacro viper-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form)
- (if (string-match "XEmacs" emacs-version)
+ (if (featurep 'xemacs)
xemacs-form emacs-form))
diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el
index f3b9baa13b..1ba6f4a092 100644
--- a/lisp/net/eudc-bob.el
+++ b/lisp/net/eudc-bob.el
@@ -149,7 +149,7 @@ display a button."
"Toggle inline display of an image."
(interactive)
(when (eudc-bob-can-display-inline-images)
- (cond (eudc-xemacs-p
+ (cond ((featurep 'xemacs)
(let ((overlays (append (overlays-at (1- (point)))
(overlays-at (point))))
overlay glyph)
@@ -266,7 +266,7 @@ display a button."
(interactive "@e")
(run-hooks 'activate-menubar-hook)
(eudc-jump-to-event event)
- (if eudc-xemacs-p
+ (if (featurep 'xemacs)
(progn
(run-hooks 'activate-popup-menu-hook)
(popup-menu (eudc-bob-menu)))
@@ -282,7 +282,7 @@ display a button."
(let ((map (make-sparse-keymap)))
(define-key map "s" 'eudc-bob-save-object)
(define-key map "!" 'eudc-bob-pipe-object-to-external-program)
- (define-key map (if eudc-xemacs-p
+ (define-key map (if (featurep 'xemacs)
[button3]
[down-mouse-3]) 'eudc-bob-popup-menu)
map))
@@ -295,7 +295,7 @@ display a button."
(setq eudc-bob-sound-keymap
(let ((map (make-sparse-keymap)))
(define-key map [return] 'eudc-bob-play-sound-at-point)
- (define-key map (if eudc-xemacs-p
+ (define-key map (if (featurep 'xemacs)
[button2]
[down-mouse-2]) 'eudc-bob-play-sound-at-mouse)
map))
@@ -303,7 +303,7 @@ display a button."
(setq eudc-bob-url-keymap
(let ((map (make-sparse-keymap)))
(define-key map [return] 'browse-url-at-point)
- (define-key map (if eudc-xemacs-p
+ (define-key map (if (featurep 'xemacs)
[button2]
[down-mouse-2]) 'browse-url-at-mouse)
map))
@@ -311,7 +311,7 @@ display a button."
(setq eudc-bob-mail-keymap
(let ((map (make-sparse-keymap)))
(define-key map [return] 'goto-address-at-point)
- (define-key map (if eudc-xemacs-p
+ (define-key map (if (featurep 'xemacs)
[button2]
[down-mouse-2]) 'goto-address-at-mouse)
map))
@@ -319,20 +319,19 @@ display a button."
(set-keymap-parent eudc-bob-image-keymap eudc-bob-generic-keymap)
(set-keymap-parent eudc-bob-sound-keymap eudc-bob-generic-keymap)
-(if eudc-emacs-p
- (progn
- (easy-menu-define eudc-bob-generic-menu
- eudc-bob-generic-keymap
- ""
- eudc-bob-generic-menu)
- (easy-menu-define eudc-bob-image-menu
- eudc-bob-image-keymap
- ""
- eudc-bob-image-menu)
- (easy-menu-define eudc-bob-sound-menu
- eudc-bob-sound-keymap
- ""
- eudc-bob-sound-menu)))
+(when (not (featurep 'xemacs))
+ (easy-menu-define eudc-bob-generic-menu
+ eudc-bob-generic-keymap
+ ""
+ eudc-bob-generic-menu)
+ (easy-menu-define eudc-bob-image-menu
+ eudc-bob-image-keymap
+ ""
+ eudc-bob-image-menu)
+ (easy-menu-define eudc-bob-sound-menu
+ eudc-bob-sound-keymap
+ ""
+ eudc-bob-sound-menu))
;;;###autoload
(defun eudc-display-generic-binary (data)
diff --git a/lisp/net/eudc-hotlist.el b/lisp/net/eudc-hotlist.el
index 2914ebdc1b..5308bb2db1 100644
--- a/lisp/net/eudc-hotlist.el
+++ b/lisp/net/eudc-hotlist.el
@@ -190,11 +190,11 @@ These are the special commands of this mode:
["Save and Quit" eudc-hotlist-quit-edit t]
["Exit without Saving" kill-this-buffer t]))
-(if eudc-emacs-p
- (easy-menu-define eudc-hotlist-emacs-menu
- eudc-hotlist-mode-map
- ""
- eudc-hotlist-menu))
+(when (not (featurep 'xemacs))
+ (easy-menu-define eudc-hotlist-emacs-menu
+ eudc-hotlist-mode-map
+ ""
+ eudc-hotlist-menu))
;;; arch-tag: 9b633ab3-6a6e-4b46-b12e-d96739a7e0e8
;;; eudc-hotlist.el ends here
diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el
index 0f300c2073..f43b37187f 100644
--- a/lisp/net/eudc.el
+++ b/lisp/net/eudc.el
@@ -66,13 +66,6 @@
;;{{{ Internal variables and compatibility tricks
-(defconst eudc-xemacs-p (string-match "XEmacs" emacs-version))
-(defconst eudc-emacs-p (not eudc-xemacs-p))
-(defconst eudc-xemacs-mule-p (and eudc-xemacs-p
- (featurep 'mule)))
-(defconst eudc-emacs-mule-p (and eudc-emacs-p
- (featurep 'mule)))
-
(defvar eudc-form-widget-list nil)
(defvar eudc-mode-map nil)
@@ -670,7 +663,7 @@ These are the special commands of EUDC mode:
(setq major-mode 'eudc-mode)
(setq mode-name "EUDC")
(use-local-map eudc-mode-map)
- (if eudc-emacs-p
+ (if (not (featurep 'xemacs))
(easy-menu-define eudc-emacs-menu eudc-mode-map "" (eudc-menu))
(setq mode-popup-menu (eudc-menu)))
(run-mode-hooks 'eudc-mode-hook))
@@ -1186,9 +1179,9 @@ queries the server for the existing fields and displays a corresponding form."
(defun eudc-install-menu ()
(cond
- ((and eudc-xemacs-p (featurep 'menubar))
+ ((and (featurep 'xemacs) (featurep 'menubar))
(add-submenu '("Tools") (eudc-menu)))
- (eudc-emacs-p
+ ((not (featurep 'xemacs))
(cond
((fboundp 'easy-menu-create-menu)
(define-key
@@ -1236,7 +1229,7 @@ This does nothing except loading eudc by autoload side-effect."
nil)
;;;###autoload
-(cond ((not (string-match "XEmacs" emacs-version))
+(cond ((not (featurep 'xemacs))
(defvar eudc-tools-menu (make-sparse-keymap "Directory Search"))
(fset 'eudc-tools-menu (symbol-value 'eudc-tools-menu))
(define-key eudc-tools-menu [phone]
@@ -1267,7 +1260,7 @@ This does nothing except loading eudc by autoload side-effect."
["Get Email" eudc-get-email t]
["Get Phone" eudc-get-phone t])))
(if (not (featurep 'eudc-autoloads))
- (if eudc-xemacs-p
+ (if (featurep 'xemacs)
(if (and (featurep 'menubar)
(not (featurep 'infodock)))
(add-submenu '("Tools") menu))
diff --git a/lisp/net/eudcb-ph.el b/lisp/net/eudcb-ph.el
index 373b015b07..5fed37f90a 100644
--- a/lisp/net/eudcb-ph.el
+++ b/lisp/net/eudcb-ph.el
@@ -179,7 +179,7 @@ SERVER is either a string naming the server or a list (NAME PORT)."
(set-buffer eudc-ph-process-buffer)
(erase-buffer)
(setq eudc-ph-read-point (point))
- (and eudc-xemacs-mule-p
+ (and (featurep 'xemacs) (featurep 'mule)
(set-buffer-file-coding-system 'binary t)))
(setq process (open-network-stream "ph" eudc-ph-process-buffer host port))
(if (null process)
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index dd33fe0b46..e2fb338242 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -337,7 +337,7 @@ If a number, only buffers greater than this size have processing messages."
:group 'fast-lock)
(defvar fast-lock-save-faces
- (when (save-match-data (string-match "XEmacs" (emacs-version)))
+ (when (featurep 'xemacs)
;; XEmacs uses extents for everything, so we have to pick the right ones.
font-lock-face-list)
"Faces that will be saved in a Font Lock cache file.
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 594b628ad4..01f1c86618 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -99,7 +99,7 @@
(and (eq (car args) :@) (null msg) ; (:@ ...spliced...)
(setq args (cdr args)
msg "(:@ ....) must return exactly one element"))
- (let ((ignore (if (string-match "XEmacs" emacs-version) :EMACS :XEMACS))
+ (let ((ignore (if (featurep 'xemacs) :EMACS :XEMACS))
(mode :BOTH) code)
(while (consp args)
(if (memq (car args) '(:EMACS :XEMACS :BOTH)) (setq mode (pop args)))
@@ -115,7 +115,7 @@
;; existing functions when they are `fboundp', provide shortcuts if they are
;; known to be defined in a specific Emacs branch (for short .elc)
(defmacro defunx (name arglist &rest definition)
- (let ((xemacsp (string-match "XEmacs" emacs-version)) reuses)
+ (let ((xemacsp (featurep 'xemacs)) reuses)
(while (memq (car definition)
'(:try :emacs-and-try :xemacs-and-try))
(if (eq (pop definition) (if xemacsp :xemacs-and-try :emacs-and-try))
@@ -152,7 +152,7 @@
(defmacro ignore-errors-x (&rest body)
(let ((specials '((scan-sexps . 4) (scan-lists . 5)))
spec nils)
- (if (and (string-match "XEmacs" emacs-version)
+ (if (and (featurep 'xemacs)
(null (cdr body)) (consp (car body))
(setq spec (assq (caar body) specials))
(>= (setq nils (- (cdr spec) (length (car body)))) 0))
@@ -166,7 +166,7 @@
`(let ((,modified (buffer-modified-p)))
(unwind-protect
(let ((buffer-undo-list t) (inhibit-read-only t)
- ,@(unless (string-match "XEmacs" emacs-version)
+ ,@(unless (featurep 'xemacs)
'((inhibit-point-motion-hooks t) deactivate-mark))
before-change-functions after-change-functions
buffer-file-name buffer-file-truename)
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index b7084950a0..a0d33f56ee 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -621,9 +621,6 @@ the end keyword."
(delete-horizontal-space)
(insert (concat " " octave-continuation-string))))
-(defvar octave-xemacs-p
- (string-match "XEmacs\\|Lucid" emacs-version))
-
;;; Comments
(defun octave-comment-region (beg end &optional arg)
"Comment or uncomment each line in the region as Octave code.
@@ -1341,7 +1338,7 @@ Note that all Octave mode abbrevs start with a grave accent."
(self-insert-command 1)
(let (c)
(insert last-command-char)
- (if (if octave-xemacs-p
+ (if (if (featurep 'xemacs)
(or (eq (event-to-character (setq c (next-event))) ??)
(eq (event-to-character c) help-char))
(or (eq (setq c (read-event)) ??)
diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el
index 9aaee22b9a..11f47b4059 100644
--- a/lisp/progmodes/vera-mode.el
+++ b/lisp/progmodes/vera-mode.el
@@ -77,10 +77,6 @@
;;; Code:
-;; XEmacs handling
-(defconst vera-xemacs (string-match "XEmacs" emacs-version)
- "Non-nil if XEmacs is used.")
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -231,7 +227,7 @@ If nil, TAB always indents current line."
(modify-syntax-entry ?\{ "(}" syntax-table)
(modify-syntax-entry ?\} "){" syntax-table)
;; comment
- (if vera-xemacs
+ (if (featurep 'xemacs)
(modify-syntax-entry ?\/ ". 1456" syntax-table) ; XEmacs
(modify-syntax-entry ?\/ ". 124b" syntax-table)) ; Emacs
(modify-syntax-entry ?\* ". 23" syntax-table)
@@ -600,7 +596,7 @@ Key bindings:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; XEmacs compatibility
-(when vera-xemacs
+(when (featurep 'xemacs)
(require 'font-lock)
(copy-face 'font-lock-reference-face 'font-lock-constant-face)
(copy-face 'font-lock-preprocessor-face 'font-lock-builtin-face))
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 60d30eb8a6..df315e4f46 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -125,13 +125,10 @@
;;; Code:
-;; XEmacs handling
-(defconst vhdl-xemacs (string-match "XEmacs" emacs-version)
- "Non-nil if XEmacs is used.")
;; Emacs 21+ handling
-(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not vhdl-xemacs))
+(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not (featurep 'xemacs)))
"Non-nil if GNU Emacs 21, 22, ... is used.")
-(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not vhdl-xemacs))
+(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not (featurep 'xemacs)))
"Non-nil if GNU Emacs 22, ... is used.")
(defvar compilation-file-regexp-alist)
@@ -1844,13 +1841,13 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
;; add related general customizations
(custom-add-to-group 'vhdl-related 'hideshow 'custom-group)
-(if vhdl-xemacs
+(if (featurep 'xemacs)
(custom-add-to-group 'vhdl-related 'paren-mode 'custom-variable)
(custom-add-to-group 'vhdl-related 'paren-showing 'custom-group))
(custom-add-to-group 'vhdl-related 'ps-print 'custom-group)
(custom-add-to-group 'vhdl-related 'speedbar 'custom-group)
(custom-add-to-group 'vhdl-related 'line-number-mode 'custom-variable)
-(unless vhdl-xemacs
+(unless (featurep 'xemacs)
(custom-add-to-group 'vhdl-related 'transient-mark-mode 'custom-variable))
(custom-add-to-group 'vhdl-related 'user-full-name 'custom-variable)
(custom-add-to-group 'vhdl-related 'mail-host-address 'custom-variable)
@@ -2093,7 +2090,7 @@ Ignore byte-compiler warnings you might see."
newstr)))
;; `itimer.el': idle timer bug fix in version 1.09 (XEmacs 21.1.9)
-(when (and vhdl-xemacs (string< itimer-version "1.09")
+(when (and (featurep 'xemacs) (string< itimer-version "1.09")
(not noninteractive))
(load "itimer")
(when (string< itimer-version "1.09")
@@ -2486,7 +2483,7 @@ conversion."
(defun vhdl-show-messages ()
"Get *Messages* buffer to show recent messages."
(interactive)
- (display-buffer (if vhdl-xemacs " *Message-Log*" "*Messages*")))
+ (display-buffer (if (featurep 'xemacs) " *Message-Log*" "*Messages*")))
(defun vhdl-use-direct-instantiation ()
"Return whether direct instantiation is used."
@@ -2686,7 +2683,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
(define-key vhdl-mode-map "\M-\C-u" 'vhdl-backward-up-list)
(define-key vhdl-mode-map "\M-\C-a" 'vhdl-backward-same-indent)
(define-key vhdl-mode-map "\M-\C-e" 'vhdl-forward-same-indent)
- (unless vhdl-xemacs ; would override `M-backspace' in XEmacs
+ (unless (featurep 'xemacs) ; would override `M-backspace' in XEmacs
(define-key vhdl-mode-map "\M-\C-h" 'vhdl-mark-defun))
(define-key vhdl-mode-map "\M-\C-q" 'vhdl-indent-sexp)
(define-key vhdl-mode-map "\M-^" 'vhdl-delete-indentation)
@@ -2713,7 +2710,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
(define-key vhdl-mode-map "\C-c\C-p\C-i" 'vhdl-port-paste-instance)
(define-key vhdl-mode-map "\C-c\C-p\C-s" 'vhdl-port-paste-signals)
(define-key vhdl-mode-map "\C-c\C-p\M-c" 'vhdl-port-paste-constants)
- (if vhdl-xemacs ; `... C-g' not allowed in XEmacs
+ (if (featurep 'xemacs) ; `... C-g' not allowed in XEmacs
(define-key vhdl-mode-map "\C-c\C-p\M-g" 'vhdl-port-paste-generic-map)
(define-key vhdl-mode-map "\C-c\C-p\C-g" 'vhdl-port-paste-generic-map))
(define-key vhdl-mode-map "\C-c\C-p\C-z" 'vhdl-port-paste-initializations)
@@ -5395,7 +5392,7 @@ negative, skip forward otherwise."
(skip-chars-forward " \t\n"))))
;; XEmacs hack: work around buggy `forward-comment' in XEmacs 21.4+
-(unless (and vhdl-xemacs (string< "21.2" emacs-version))
+(unless (and (featurep 'xemacs) (string< "21.2" emacs-version))
(defalias 'vhdl-forward-comment 'forward-comment))
;; This is the best we can do in Win-Emacs.
@@ -13013,7 +13010,7 @@ This does background highlighting of translate-off regions.")
(defun vhdl-ps-print-init ()
"Initialize postscript printing."
- (if vhdl-xemacs
+ (if (featurep 'xemacs)
(when (boundp 'ps-print-color-p)
(vhdl-ps-print-settings))
(make-local-variable 'ps-print-hook)
@@ -14064,10 +14061,10 @@ if required."
(save-excursion (beginning-of-line) (looking-at "[0-9]+:"))]
["Rescan Directory" vhdl-speedbar-rescan-hierarchy
:active (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))
- ,(if vhdl-xemacs :active :visible) (not vhdl-speedbar-show-projects)]
+ ,(if (featurep 'xemacs) :active :visible) (not vhdl-speedbar-show-projects)]
["Rescan Project" vhdl-speedbar-rescan-hierarchy
:active (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))
- ,(if vhdl-xemacs :active :visible) vhdl-speedbar-show-projects]
+ ,(if (featurep 'xemacs) :active :visible) vhdl-speedbar-show-projects]
["Save Caches" vhdl-save-caches vhdl-updated-project-list])))
;; hook-ups
(speedbar-add-expansion-list
@@ -16189,7 +16186,7 @@ no project is defined."
(assoc (car sublist) regexp-alist))
(setq regexp-alist (cons (list (nth 0 sublist)
(if (= 0 (nth 1 sublist))
- (if vhdl-xemacs 9 nil)
+ (if (featurep 'xemacs) 9 nil)
(nth 1 sublist))
(nth 2 sublist) (nth 3 sublist))
regexp-alist)))
@@ -16989,7 +16986,7 @@ to visually support naming conventions.")
(defun vhdl-doc-variable (variable)
"Display VARIABLE's documentation in *Help* buffer."
(interactive)
- (unless vhdl-xemacs
+ (unless (featurep 'xemacs)
(help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p)))
(with-output-to-temp-buffer
(if (fboundp 'help-buffer) (help-buffer) "*Help*")
@@ -17001,7 +16998,7 @@ to visually support naming conventions.")
(defun vhdl-doc-mode ()
"Display VHDL Mode documentation in *Help* buffer."
(interactive)
- (unless vhdl-xemacs
+ (unless (featurep 'xemacs)
(help-setup-xref (list #'vhdl-doc-mode) (interactive-p)))
(with-output-to-temp-buffer
(if (fboundp 'help-buffer) (help-buffer) "*Help*")
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index a8633b9a75..49b0960f9b 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -1449,7 +1449,7 @@ Please send all bug fixes and enhancements to
(error "`ps-print' requires floating point support"))
(let ((case-fold-search t))
- (cond ((string-match "XEmacs" emacs-version))
+ (cond ((featurep 'xemacs))
((string-match "Lucid" emacs-version)
(error "`ps-print' doesn't support Lucid"))
((string-match "Epoch" emacs-version)