From a3269bc45f343c405986126c842361db10589476 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 17 Nov 2007 17:35:09 +0000 Subject: [PATCH] * eshell/esh-util.el (eshell-under-xemacs-p): Remove. * eshell/esh-mode.el (eshell-mode-syntax-table) (command-running-p): * eshell/esh-ext.el (eshell-external-command): * eshell/esh-cmd.el (require): * eshell/em-unix.el (eshell-plain-locate-behavior): * eshell/em-cmpl.el (eshell-cmpl-initialize): Replace eshell-under-xemacs-p with (featurep 'xemacs). * eshell/esh-mode.el (characterp,char-int): Remove unused conditional defaliases. * pcomplete.el (pcomplete-event-matches-key-specifier-p): Rename from event-matches-key-specifier-p, define unconditionally. (event-basic-type): Remove unused defalias. (pcomplete-show-completions): Use pcomplete-event-matches-key-specifier-p. * mh-e.el (mh-xemacs-flag): Remove. (mh-min-colors-defined-flag): * mh-xface.el (mh-show-xface-function): * mh-utils.el (mh-colors-available-p): * mh-show.el (mh-show-mode): * mh-gnus.el (mh-gnus-local-map-property): * mh-folder.el (mh-folder-mode-map) (mh-remove-xemacs-horizontal-scrollbar, mh-folder-mode): * mh-comp.el (mh-insert-x-mailer): Replace uses of mh-xemacs-flag with (featurep 'xemacs). --- lisp/ChangeLog | 19 +++++++++++++++++++ lisp/eshell/em-cmpl.el | 2 +- lisp/eshell/em-unix.el | 2 +- lisp/eshell/esh-cmd.el | 2 +- lisp/eshell/esh-ext.el | 2 +- lisp/eshell/esh-mode.el | 9 ++------- lisp/eshell/esh-util.el | 4 ---- lisp/mh-e/ChangeLog | 13 +++++++++++++ lisp/mh-e/mh-comp.el | 4 ++-- lisp/mh-e/mh-e.el | 6 +----- lisp/mh-e/mh-folder.el | 6 +++--- lisp/mh-e/mh-gnus.el | 2 +- lisp/mh-e/mh-show.el | 2 +- lisp/mh-e/mh-utils.el | 2 +- lisp/mh-e/mh-xface.el | 2 +- lisp/pcomplete.el | 15 +++++++-------- 16 files changed, 55 insertions(+), 37 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 635ec685fdc..466e1d7349e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2007-11-17 Dan Nicolaescu + + * eshell/esh-util.el (eshell-under-xemacs-p): Remove. + * eshell/esh-mode.el (eshell-mode-syntax-table) + (command-running-p): + * eshell/esh-ext.el (eshell-external-command): + * eshell/esh-cmd.el (require): + * eshell/em-unix.el (eshell-plain-locate-behavior): + * eshell/em-cmpl.el (eshell-cmpl-initialize): Replace + eshell-under-xemacs-p with (featurep 'xemacs). + * eshell/esh-mode.el (characterp,char-int): Remove unused + conditional defaliases. + + * pcomplete.el (pcomplete-event-matches-key-specifier-p): Rename + from event-matches-key-specifier-p, define unconditionally. + (event-basic-type): Remove unused defalias. + (pcomplete-show-completions): + Use pcomplete-event-matches-key-specifier-p. + 2007-11-17 Eli Zaretskii * eshell/esh-module.el (eshell-load-defgroups): Don't make backups diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index 7247033a235..8672885cc60 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -296,7 +296,7 @@ to writing a completion function." (define-key eshell-mode-map [tab] 'pcomplete) (define-key eshell-mode-map [(control ?i)] 'pcomplete) ;; jww (1999-10-19): Will this work on anything but X? - (if (eshell-under-xemacs-p) + (if (featurep 'xemacs) (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse) (define-key eshell-mode-map [(shift iso-lefttab)] 'pcomplete-reverse) (define-key eshell-mode-map [(shift control ?i)] 'pcomplete-reverse)) diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 989230778b4..dc5ef908e56 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -78,7 +78,7 @@ receiving side of a command pipeline." :type 'boolean :group 'eshell-unix) -(defcustom eshell-plain-locate-behavior (eshell-under-xemacs-p) +(defcustom eshell-plain-locate-behavior (featurep 'xemacs) "*If non-nil, standalone \"locate\" commands will behave normally. Standalone in this context means not redirected, and not on the receiving side of a command pipeline." diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index f999bdcdf6d..8738ceb39b6 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -222,7 +222,7 @@ return non-nil if the command is complex." ;;; Code: (require 'esh-util) -(unless (eshell-under-xemacs-p) +(unless (featurep 'xemacs) (require 'eldoc)) (require 'esh-arg) (require 'esh-proc) diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 11090f97b83..7e3e8ac9e09 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -211,7 +211,7 @@ causing the user to wonder if anything's really going on..." (find-file-name-handler default-directory 'shell-command)))) (if (and handler - (not (and (eshell-under-xemacs-p) + (not (and (featurep 'xemacs) (eq handler 'dired-handler-fn)))) (eshell-remote-command handler command args)) (let ((interp (eshell-find-interpreter command))) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 1ac74f3f52d..b30c1a80539 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -222,11 +222,6 @@ This is used by `eshell-watch-for-password-prompt'." (define-abbrev-table 'eshell-mode-abbrev-table ()) -(eval-when-compile - (unless (eshell-under-xemacs-p) - (defalias 'characterp 'ignore) - (defalias 'char-int 'ignore))) - (if (not eshell-mode-syntax-table) (let ((i 0)) (setq eshell-mode-syntax-table (make-syntax-table)) @@ -269,7 +264,7 @@ This is used by `eshell-watch-for-password-prompt'." (modify-syntax-entry ?\[ "(] " eshell-mode-syntax-table) (modify-syntax-entry ?\] ")[ " eshell-mode-syntax-table) ;; All non-word multibyte characters should be `symbol'. - (if (eshell-under-xemacs-p) + (if (featurep 'xemacs) (map-char-table (function (lambda (key val) @@ -467,7 +462,7 @@ This is used by `eshell-watch-for-password-prompt'." (eshell-deftest mode command-running-p "Modeline shows no command running" - (or (eshell-under-xemacs-p) + (or (featurep 'xemacs) (not eshell-status-in-modeline) (and (memq 'eshell-command-running-string mode-line-format) (equal eshell-command-running-string "--")))) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 25afdc38506..a0495a67434 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -139,10 +139,6 @@ function `string-to-number'." ;;; Functions: -(defsubst eshell-under-xemacs-p () - "Return non-nil if we are running under XEmacs." - (boundp 'xemacs-logo)) - (defsubst eshell-under-windows-p () "Return non-nil if we are running under MS-DOS/Windows." (memq system-type '(ms-dos windows-nt))) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 2619e20e6f7..25b83463958 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,16 @@ +2007-11-17 Dan Nicolaescu + + * mh-e.el (mh-xemacs-flag): Remove. + (mh-min-colors-defined-flag): + * mh-xface.el (mh-show-xface-function): + * mh-utils.el (mh-colors-available-p): + * mh-show.el (mh-show-mode): + * mh-gnus.el (mh-gnus-local-map-property): + * mh-folder.el (mh-folder-mode-map) + (mh-remove-xemacs-horizontal-scrollbar, mh-folder-mode): + * mh-comp.el (mh-insert-x-mailer): Replace uses of mh-xemacs-flag + with (featurep 'xemacs). + 2007-09-11 Bill Wohler * mh-e.el (Version, mh-version): Add +cvs to version. diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index bb2d1506adf..2dcc3d52825 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -928,8 +928,8 @@ The versions of MH-E, Emacs, and MH are shown." (setq mh-x-mailer-string (format "MH-E %s; %s; %sEmacs %s" mh-version mh-variant-in-use - (if mh-xemacs-flag "X" "GNU ") - (cond ((not mh-xemacs-flag) + (if (featurep 'xemacs) "X" "GNU ") + (cond ((not (featurep 'xemacs)) (string-match "[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)?" emacs-version) (match-string 0 emacs-version)) diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index faec4db35b7..69454110701 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -99,10 +99,6 @@ (require 'mh-buffers) (require 'mh-compat) -(eval-and-compile - (defvar mh-xemacs-flag (featurep 'xemacs) - "Non-nil means the current Emacs is XEmacs.")) - (mh-do-in-xemacs (require 'mh-xemacs)) @@ -3398,7 +3394,7 @@ consumed by `defface-mh'.") The :inherit keyword is available on all supported versions of GNU Emacs and XEmacs from at least 21.5.23 on.") -(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag) +(defvar mh-min-colors-defined-flag (and (not (featurep 'xemacs)) (>= emacs-major-version 22)) "Non-nil means `defface' supports min-colors display requirement.") diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 75cebfe519d..bc15d3eb118 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el @@ -351,7 +351,7 @@ annotation.") "\M-\t" mh-prev-button) (cond - (mh-xemacs-flag + ((featurep 'xemacs) (define-key mh-folder-mode-map [button2] 'mh-show-mouse)) (t (define-key mh-folder-mode-map [mouse-2] 'mh-show-mouse))) @@ -513,7 +513,7 @@ font-lock is done highlighting.") (defmacro mh-remove-xemacs-horizontal-scrollbar () "Get rid of the horizontal scrollbar that XEmacs insists on putting in." - (when mh-xemacs-flag + (when (featurep 'xemacs) `(if (and (featurep 'scrollbar) (fboundp 'set-specifier)) (set-specifier horizontal-scrollbar-visible-p nil @@ -656,7 +656,7 @@ perform the operation on all messages in that region. (easy-menu-add mh-folder-folder-menu) (mh-inc-spool-make) (mh-set-help mh-folder-mode-help-messages) - (if (and mh-xemacs-flag + (if (and (featurep 'xemacs) font-lock-auto-fontify) (turn-on-font-lock))) ; Force font-lock in XEmacs. diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el index 0624346ca05..e099c2e726b 100644 --- a/lisp/mh-e/mh-gnus.el +++ b/lisp/mh-e/mh-gnus.el @@ -41,7 +41,7 @@ ;; Copy of function from gnus-util.el. (defun-mh mh-gnus-local-map-property gnus-local-map-property (map) "Return a list suitable for a text property list specifying keymap MAP." - (cond (mh-xemacs-flag (list 'keymap map)) + (cond ((featurep 'xemacs) (list 'keymap map)) ((>= emacs-major-version 21) (list 'keymap map)) (t (list 'local-map map)))) diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index fd171107ac3..c97715dabf3 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -872,7 +872,7 @@ See also `mh-folder-mode'. (mh-gnus-article-highlight-citation)) (t (setq font-lock-defaults '(mh-show-font-lock-keywords t)))) - (if (and mh-xemacs-flag + (if (and (featurep 'xemacs) font-lock-auto-fontify) (turn-on-font-lock)) (when mh-decode-mime-flag diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 5b618e35b87..da2ace3fd2c 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -67,7 +67,7 @@ used in lieu of `search' in the CL package." ;;;###mh-autoload (defun mh-colors-available-p () "Check if colors are available in the Emacs being used." - (or mh-xemacs-flag + (or (featurep 'xemacs) (let ((color-cells (mh-display-color-cells))) (and (numberp color-cells) (>= color-cells 8))))) diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index 8445cf32ed1..a6a6efc0fb2 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -36,7 +36,7 @@ (autoload 'message-fetch-field "message") (defvar mh-show-xface-function - (cond ((and mh-xemacs-flag (locate-library "x-face") (not (featurep 'xface))) + (cond ((and (featurep 'xemacs) (locate-library "x-face") (not (featurep 'xface))) (load "x-face" t t) #'mh-face-display-function) ((>= emacs-major-version 21) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 79b269870b1..62a71621dc6 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -944,17 +944,16 @@ generate the completions list. This means that the hook ;; Abstractions so that the code below will work for both Emacs 20 and ;; XEmacs 21 -(unless (fboundp 'event-matches-key-specifier-p) - (defalias 'event-matches-key-specifier-p 'eq)) +(defalias 'pcomplete-event-matches-key-specifier-p + (if (featurep 'xemacs) + 'event-matches-key-specifier-p + 'eq)) (defun pcomplete-read-event (&optional prompt) (if (fboundp 'read-event) (read-event prompt) (aref (read-key-sequence prompt) 0))) -(unless (fboundp 'event-basic-type) - (defalias 'event-basic-type 'event-key)) - (defun pcomplete-show-completions (completions) "List in help buffer sorted COMPLETIONS. Typing SPC flushes the help buffer." @@ -973,13 +972,13 @@ Typing SPC flushes the help buffer." (while (with-current-buffer (get-buffer "*Completions*") (setq event (pcomplete-read-event))) (cond - ((event-matches-key-specifier-p event ?\s) + ((pcomplete-event-matches-key-specifier-p event ?\s) (set-window-configuration pcomplete-last-window-config) (setq pcomplete-last-window-config nil) (throw 'done nil)) - ((or (event-matches-key-specifier-p event 'tab) + ((or (pcomplete-event-matches-key-specifier-p event 'tab) ;; Needed on a terminal - (event-matches-key-specifier-p event 9)) + (pcomplete-event-matches-key-specifier-p event 9)) (let ((win (or (get-buffer-window "*Completions*" 0) (display-buffer "*Completions*" 'not-this-window)))) -- 2.39.2