(defgroup eshell-util nil
"This is general utility code, meant for use by Eshell itself."
:tag "General utilities"
(defgroup eshell-util nil
"This is general utility code, meant for use by Eshell itself."
:tag "General utilities"
(defun eshell-sublist (l &optional n m)
"Return from LIST the N to M elements.
If N or M is nil, it means the end of the list."
(defun eshell-sublist (l &optional n m)
"Return from LIST the N to M elements.
If N or M is nil, it means the end of the list."
(defun eshell-read-hosts (file result-var timestamp-var)
"Read the contents of /etc/passwd for user names."
(defun eshell-read-hosts (file result-var timestamp-var)
"Read the contents of /etc/passwd for user names."
(defmacro eshell-with-file-modes (modes &rest forms)
"Evaluate, with file-modes set to MODES, the given FORMS."
(defmacro eshell-with-file-modes (modes &rest forms)
"Evaluate, with file-modes set to MODES, the given FORMS."
- `(let ((modes (default-file-modes)))
- (set-default-file-modes ,modes)
- (unwind-protect
- (progn ,@forms)
- (set-default-file-modes modes))))
+ (declare (obsolete with-file-modes "24.5"))
+ `(with-file-modes ,modes ,@forms))
(defsubst eshell-make-private-directory (dir &optional parents)
"Make DIR with file-modes set to `eshell-private-directory-modes'."
(defsubst eshell-make-private-directory (dir &optional parents)
"Make DIR with file-modes set to `eshell-private-directory-modes'."
(defsubst eshell-substring (string sublen)
"Return the beginning of STRING, up to SUBLEN bytes."
(defsubst eshell-substring (string sublen)
"Return the beginning of STRING, up to SUBLEN bytes."
"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
"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
(cons file (eshell-file-attributes (expand-file-name file directory)))))
(directory-files directory full match nosort)))))
(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)))
(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)))