aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-10-05 16:59:13 +0200
committerLars Ingebrigtsen2019-10-05 16:59:13 +0200
commit9f6a59849f69efd1d8026b040b9e9a397df03499 (patch)
tree04a5c9f8d78f5cac7add77b243604cfacdfebe4c
parent33dc41043820c3c28e65ffe0010c047d3b9b0e78 (diff)
downloademacs-9f6a59849f69efd1d8026b040b9e9a397df03499.tar.gz
emacs-9f6a59849f69efd1d8026b040b9e9a397df03499.zip
Remove some XEmacs compat code from esh*.el
* lisp/eshell/esh-util.el: Remove some XEmacs compat functions.
-rw-r--r--lisp/eshell/esh-cmd.el3
-rw-r--r--lisp/eshell/esh-mode.el20
-rw-r--r--lisp/eshell/esh-util.el34
3 files changed, 8 insertions, 49 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 83cc5999dc3..9bd5de89837 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -101,8 +101,7 @@
101;;; Code: 101;;; Code:
102 102
103(require 'esh-util) 103(require 'esh-util)
104(unless (featurep 'xemacs) 104(require 'eldoc)
105 (require 'eldoc))
106(require 'esh-arg) 105(require 'esh-arg)
107(require 'esh-proc) 106(require 'esh-proc)
108(require 'esh-module) 107(require 'esh-module)
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 91204877f5d..5cdbf754cd9 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -267,19 +267,13 @@ This is used by `eshell-watch-for-password-prompt'."
267 (modify-syntax-entry ?\] ")[ " st) 267 (modify-syntax-entry ?\] ")[ " st)
268 ;; All non-word multibyte characters should be `symbol'. 268 ;; All non-word multibyte characters should be `symbol'.
269 (map-char-table 269 (map-char-table
270 (if (featurep 'xemacs) 270 (lambda (key _val)
271 (lambda (key _val) 271 (and (if (consp key)
272 (and (characterp key) 272 (and (>= (car key) 128)
273 (>= (char-int key) 256) 273 (/= (char-syntax (car key)) ?w))
274 (/= (char-syntax key) ?w) 274 (and (>= key 256)
275 (modify-syntax-entry key "_ " st))) 275 (/= (char-syntax key) ?w)))
276 (lambda (key _val) 276 (modify-syntax-entry key "_ " st)))
277 (and (if (consp key)
278 (and (>= (car key) 128)
279 (/= (char-syntax (car key)) ?w))
280 (and (>= key 256)
281 (/= (char-syntax key) ?w)))
282 (modify-syntax-entry key "_ " st))))
283 (standard-syntax-table)) 277 (standard-syntax-table))
284 st)) 278 st))
285 279
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 353b9400f2e..bab42423c68 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -511,19 +511,6 @@ list."
511 (eshell-read-hosts eshell-hosts-file 'eshell-host-names 511 (eshell-read-hosts eshell-hosts-file 'eshell-host-names
512 'eshell-host-timestamp))) 512 'eshell-host-timestamp)))
513 513
514(and (featurep 'xemacs)
515 (not (fboundp 'subst-char-in-string))
516 (defun subst-char-in-string (fromchar tochar string &optional inplace)
517 "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
518Unless optional argument INPLACE is non-nil, return a new string."
519 (let ((i (length string))
520 (newstr (if inplace string (copy-sequence string))))
521 (while (> i 0)
522 (setq i (1- i))
523 (if (eq (aref newstr i) fromchar)
524 (aset newstr i tochar)))
525 newstr)))
526
527(defsubst eshell-copy-environment () 514(defsubst eshell-copy-environment ()
528 "Return an unrelated copy of `process-environment'." 515 "Return an unrelated copy of `process-environment'."
529 (mapcar 'concat process-environment)) 516 (mapcar 'concat process-environment))
@@ -559,27 +546,6 @@ Unless optional argument INPLACE is non-nil, return a new string."
559 (substring string 0 sublen) 546 (substring string 0 sublen)
560 string))) 547 string)))
561 548
562(defvar ange-cache)
563
564;; Partial reimplementation of Emacs's builtin directory-files-and-attributes.
565;; id-format not implemented.
566(and (featurep 'xemacs)
567 (not (fboundp 'directory-files-and-attributes))
568 (defun directory-files-and-attributes (directory &optional full match nosort _id-format)
569 "Return a list of names of files and their attributes in DIRECTORY.
570There are three optional arguments:
571If FULL is non-nil, return absolute file names. Otherwise return names
572 that are relative to the specified directory.
573If MATCH is non-nil, mention only file names that match the regexp MATCH.
574If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
575 NOSORT is useful if you plan to sort the result yourself."
576 (let ((directory (expand-file-name directory)) ange-cache)
577 (mapcar
578 (function
579 (lambda (file)
580 (cons file (eshell-file-attributes (expand-file-name file directory)))))
581 (directory-files directory full match nosort)))))
582
583(defun eshell-directory-files-and-attributes (dir &optional full match nosort id-format) 549(defun eshell-directory-files-and-attributes (dir &optional full match nosort id-format)
584 "Make sure to use the handler for `directory-file-and-attributes'." 550 "Make sure to use the handler for `directory-file-and-attributes'."
585 (let* ((dir (expand-file-name dir))) 551 (let* ((dir (expand-file-name dir)))