diff options
| author | Glenn Morris | 2010-11-06 18:56:09 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-11-06 18:56:09 -0700 |
| commit | de3490e1f8a373dbb9137be41948705c4206c868 (patch) | |
| tree | e5f68809711b556f00dd9c13d7ea572712e77f7e | |
| parent | 3ba6b2ee6aa77f5a05dc91e8a46ac559f352fee7 (diff) | |
| download | emacs-de3490e1f8a373dbb9137be41948705c4206c868.tar.gz emacs-de3490e1f8a373dbb9137be41948705c4206c868.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/eshell/esh-util.el | 28 |
2 files changed, 19 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66d402a53a0..0d1e07f7f5a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2010-11-07 Glenn Morris <rgm@gnu.org> | 1 | 2010-11-07 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * eshell/esh-util.el (subst-char-in-string) | ||
| 4 | (directory-files-and-attributes): These compatibility definitions are | ||
| 5 | not needed on any version of Emacs since at least 21.4. | ||
| 6 | |||
| 3 | * progmodes/verilog-mode.el (verilog-get-beg-of-line) | 7 | * progmodes/verilog-mode.el (verilog-get-beg-of-line) |
| 4 | (verilog-get-end-of-line): Remove. | 8 | (verilog-get-end-of-line): Remove. |
| 5 | (verilog-within-string, verilog-re-search-forward-substr) | 9 | (verilog-within-string, verilog-re-search-forward-substr) |
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." | |||
| 536 | (eshell-read-hosts eshell-hosts-file 'eshell-host-names | 536 | (eshell-read-hosts eshell-hosts-file 'eshell-host-names |
| 537 | 'eshell-host-timestamp))) | 537 | 'eshell-host-timestamp))) |
| 538 | 538 | ||
| 539 | (unless (fboundp 'subst-char-in-string) | 539 | (and (featurep 'xemacs) |
| 540 | (defun subst-char-in-string (fromchar tochar string &optional inplace) | 540 | (not (fboundp 'subst-char-in-string)) |
| 541 | "Replace FROMCHAR with TOCHAR in STRING each time it occurs. | 541 | (defun subst-char-in-string (fromchar tochar string &optional inplace) |
| 542 | "Replace FROMCHAR with TOCHAR in STRING each time it occurs. | ||
| 542 | Unless optional argument INPLACE is non-nil, return a new string." | 543 | Unless optional argument INPLACE is non-nil, return a new string." |
| 543 | (let ((i (length string)) | 544 | (let ((i (length string)) |
| 544 | (newstr (if inplace string (copy-sequence string)))) | 545 | (newstr (if inplace string (copy-sequence string)))) |
| 545 | (while (> i 0) | 546 | (while (> i 0) |
| 546 | (setq i (1- i)) | 547 | (setq i (1- i)) |
| 547 | (if (eq (aref newstr i) fromchar) | 548 | (if (eq (aref newstr i) fromchar) |
| 548 | (aset newstr i tochar))) | 549 | (aset newstr i tochar))) |
| 549 | newstr))) | 550 | newstr))) |
| 550 | 551 | ||
| 551 | (defsubst eshell-copy-environment () | 552 | (defsubst eshell-copy-environment () |
| 552 | "Return an unrelated copy of `process-environment'." | 553 | "Return an unrelated copy of `process-environment'." |
| @@ -586,8 +587,9 @@ Unless optional argument INPLACE is non-nil, return a new string." | |||
| 586 | (substring string 0 sublen) | 587 | (substring string 0 sublen) |
| 587 | string))) | 588 | string))) |
| 588 | 589 | ||
| 589 | (unless (fboundp 'directory-files-and-attributes) | 590 | (and (featurep 'xemacs) |
| 590 | (defun directory-files-and-attributes (directory &optional full match nosort id-format) | 591 | (not (fboundp 'directory-files-and-attributes)) |
| 592 | (defun directory-files-and-attributes (directory &optional full match nosort id-format) | ||
| 591 | "Return a list of names of files and their attributes in DIRECTORY. | 593 | "Return a list of names of files and their attributes in DIRECTORY. |
| 592 | There are three optional arguments: | 594 | There are three optional arguments: |
| 593 | If FULL is non-nil, return absolute file names. Otherwise return names | 595 | 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. | |||
| 599 | (mapcar | 601 | (mapcar |
| 600 | (function | 602 | (function |
| 601 | (lambda (file) | 603 | (lambda (file) |
| 602 | (cons file (eshell-file-attributes (expand-file-name file directory))))) | 604 | (cons file (eshell-file-attributes (expand-file-name file directory))))) |
| 603 | (directory-files directory full match nosort))))) | 605 | (directory-files directory full match nosort))))) |
| 604 | 606 | ||
| 605 | (defvar ange-cache) | 607 | (defvar ange-cache) |