]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove some XEmacs compat code from esh*.el
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 5 Oct 2019 14:59:13 +0000 (16:59 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 5 Oct 2019 14:59:13 +0000 (16:59 +0200)
* lisp/eshell/esh-util.el: Remove some XEmacs compat functions.

lisp/eshell/esh-cmd.el
lisp/eshell/esh-mode.el
lisp/eshell/esh-util.el

index 83cc5999dc374a0e349a34e4d0c311d1d92a5326..9bd5de8983754ea6cbadc9964bb924c646c71c69 100644 (file)
 ;;; Code:
 
 (require 'esh-util)
-(unless (featurep 'xemacs)
-  (require 'eldoc))
+(require 'eldoc)
 (require 'esh-arg)
 (require 'esh-proc)
 (require 'esh-module)
index 91204877f5db3df4b1a04adb0e09851890fcf5bf..5cdbf754cd9a34edb9622fe5fe54cfbcbaf57913 100644 (file)
@@ -267,19 +267,13 @@ This is used by `eshell-watch-for-password-prompt'."
     (modify-syntax-entry ?\] ")[  " st)
     ;; All non-word multibyte characters should be `symbol'.
     (map-char-table
-     (if (featurep 'xemacs)
-         (lambda (key _val)
-           (and (characterp key)
-                (>= (char-int key) 256)
-                (/= (char-syntax key) ?w)
-                (modify-syntax-entry key "_   " st)))
-       (lambda (key _val)
-         (and (if (consp key)
-                  (and (>= (car key) 128)
-                       (/= (char-syntax (car key)) ?w))
-                (and (>= key 256)
-                     (/= (char-syntax key) ?w)))
-              (modify-syntax-entry key "_   " st))))
+     (lambda (key _val)
+       (and (if (consp key)
+                (and (>= (car key) 128)
+                     (/= (char-syntax (car key)) ?w))
+              (and (>= key 256)
+                   (/= (char-syntax key) ?w)))
+            (modify-syntax-entry key "_   " st)))
      (standard-syntax-table))
     st))
 
index 353b9400f2e0fdb11ba6211e6018a3c2063a0573..bab42423c68b95490d6ea2b5d999980ca0dc204a 100644 (file)
@@ -511,19 +511,6 @@ list."
       (eshell-read-hosts eshell-hosts-file 'eshell-host-names
                         'eshell-host-timestamp)))
 
-(and (featurep 'xemacs)
-     (not (fboundp 'subst-char-in-string))
-     (defun subst-char-in-string (fromchar tochar string &optional inplace)
-       "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
-Unless optional argument INPLACE is non-nil, return a new string."
-       (let ((i (length string))
-            (newstr (if inplace string (copy-sequence string))))
-        (while (> i 0)
-          (setq i (1- i))
-          (if (eq (aref newstr i) fromchar)
-              (aset newstr i tochar)))
-        newstr)))
-
 (defsubst eshell-copy-environment ()
   "Return an unrelated copy of `process-environment'."
   (mapcar 'concat process-environment))
@@ -559,27 +546,6 @@ Unless optional argument INPLACE is non-nil, return a new string."
          (substring string 0 sublen)
        string)))
 
-(defvar ange-cache)
-
-;; Partial reimplementation of Emacs's builtin directory-files-and-attributes.
-;; id-format not implemented.
-(and (featurep 'xemacs)
-     (not (fboundp 'directory-files-and-attributes))
-     (defun directory-files-and-attributes (directory &optional full match nosort _id-format)
-    "Return a list of names of files and their attributes in DIRECTORY.
-There are three optional arguments:
-If FULL is non-nil, return absolute file names.  Otherwise return names
- that are relative to the specified directory.
-If MATCH is non-nil, mention only file names that match the regexp MATCH.
-If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
- NOSORT is useful if you plan to sort the result yourself."
-    (let ((directory (expand-file-name directory)) ange-cache)
-      (mapcar
-       (function
-       (lambda (file)
-         (cons file (eshell-file-attributes (expand-file-name file directory)))))
-       (directory-files directory full match nosort)))))
-
 (defun eshell-directory-files-and-attributes (dir &optional full match nosort id-format)
   "Make sure to use the handler for `directory-file-and-attributes'."
   (let* ((dir (expand-file-name dir)))