diff options
author | Glenn Morris <rgm@gnu.org> | 2010-11-06 18:56:09 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2010-11-06 18:56:09 -0700 |
commit | de3490e1f8a373dbb9137be41948705c4206c868 (patch) | |
tree | e5f68809711b556f00dd9c13d7ea572712e77f7e /lisp/eshell | |
parent | 3ba6b2ee6aa77f5a05dc91e8a46ac559f352fee7 (diff) | |
download | emacs-de3490e1f8a373dbb9137be41948705c4206c868.tar.gz |
Minor esh-util changes.
* lisp/eshell/esh-util.el (subst-char-in-string)
(directory-files-and-attributes): These compatibility definitions are
not needed on any version of Emacs since at least 21.4.
Diffstat (limited to 'lisp/eshell')
-rw-r--r-- | lisp/eshell/esh-util.el | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 01699d8ed85..17db2f71f9e 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -536,17 +536,18 @@ list." (eshell-read-hosts eshell-hosts-file 'eshell-host-names 'eshell-host-timestamp))) -(unless (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. +(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))) + (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'." @@ -586,8 +587,9 @@ Unless optional argument INPLACE is non-nil, return a new string." (substring string 0 sublen) string))) -(unless (fboundp 'directory-files-and-attributes) - (defun directory-files-and-attributes (directory &optional full match nosort id-format) +(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 @@ -599,7 +601,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable. (mapcar (function (lambda (file) - (cons file (eshell-file-attributes (expand-file-name file directory))))) + (cons file (eshell-file-attributes (expand-file-name file directory))))) (directory-files directory full match nosort))))) (defvar ange-cache) |