Mercurial > emacs
comparison lisp/eshell/em-basic.el @ 87064:ce46e8bcbccd
Require individual files if needed when compiling, rather than
esh-maint. Collect any require statements. Move provide statement to
end. Move any commentary to start.
(print-func): No need to define for compiler.
| author | Glenn Morris <rgm@gnu.org> |
|---|---|
| date | Wed, 05 Dec 2007 07:00:23 +0000 |
| parents | a1e8300d3c55 |
| children | 107ccd98fa12 53108e6cea98 |
comparison
equal
deleted
inserted
replaced
| 87063:fbd20b5beb80 | 87064:ce46e8bcbccd |
|---|---|
| 20 ;; You should have received a copy of the GNU General Public License | 20 ;; You should have received a copy of the GNU General Public License |
| 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
| 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 23 ;; Boston, MA 02110-1301, USA. | 23 ;; Boston, MA 02110-1301, USA. |
| 24 | 24 |
| 25 (provide 'em-basic) | |
| 26 | |
| 27 (eval-when-compile (require 'esh-maint)) | |
| 28 | |
| 29 (defgroup eshell-basic nil | |
| 30 "The \"basic\" code provides a set of convenience functions which | |
| 31 are traditionally considered shell builtins. Since all of the | |
| 32 functionality provided by them is accessible through Lisp, they are | |
| 33 not really builtins at all, but offer a command-oriented way to do the | |
| 34 same thing." | |
| 35 :tag "Basic shell commands" | |
| 36 :group 'eshell-module) | |
| 37 | |
| 38 ;;; Commentary: | 25 ;;; Commentary: |
| 39 | 26 |
| 40 ;; There are very few basic Eshell commands -- so-called builtins. | 27 ;; There are very few basic Eshell commands -- so-called builtins. |
| 41 ;; They are: echo, umask, and version. | 28 ;; They are: echo, umask, and version. |
| 42 ;; | 29 ;; |
| 46 ;; optional whether this is done in a Lisp-friendly fashion (so that | 33 ;; optional whether this is done in a Lisp-friendly fashion (so that |
| 47 ;; the value of echo is useful to a Lisp command using the result of | 34 ;; the value of echo is useful to a Lisp command using the result of |
| 48 ;; echo as an argument), or whether it should try to act like a normal | 35 ;; echo as an argument), or whether it should try to act like a normal |
| 49 ;; shell echo, and always result in a flat string being returned. | 36 ;; shell echo, and always result in a flat string being returned. |
| 50 | 37 |
| 51 (defcustom eshell-plain-echo-behavior nil | |
| 52 "*If non-nil, `echo' tries to behave like an ordinary shell echo. | |
| 53 This comes at some detriment to Lisp functionality. However, the Lisp | |
| 54 equivalent of `echo' can always be achieved by using `identity'." | |
| 55 :type 'boolean | |
| 56 :group 'eshell-basic) | |
| 57 | |
| 58 ;;; | |
| 59 ;; An example of the difference is the following: | 38 ;; An example of the difference is the following: |
| 60 ;; | 39 ;; |
| 61 ;; echo Hello world | 40 ;; echo Hello world |
| 62 ;; | 41 ;; |
| 63 ;; If `eshell-plain-echo-behavior' is non-nil, this will yield the | 42 ;; If `eshell-plain-echo-behavior' is non-nil, this will yield the |
| 81 ;; dependent module, including the date when those modules were last | 60 ;; dependent module, including the date when those modules were last |
| 82 ;; modified. | 61 ;; modified. |
| 83 | 62 |
| 84 ;;; Code: | 63 ;;; Code: |
| 85 | 64 |
| 65 (eval-when-compile | |
| 66 (require 'esh-util)) | |
| 67 | |
| 86 (require 'esh-opt) | 68 (require 'esh-opt) |
| 69 | |
| 70 (defgroup eshell-basic nil | |
| 71 "The \"basic\" code provides a set of convenience functions which | |
| 72 are traditionally considered shell builtins. Since all of the | |
| 73 functionality provided by them is accessible through Lisp, they are | |
| 74 not really builtins at all, but offer a command-oriented way to do the | |
| 75 same thing." | |
| 76 :tag "Basic shell commands" | |
| 77 :group 'eshell-module) | |
| 78 | |
| 79 (defcustom eshell-plain-echo-behavior nil | |
| 80 "*If non-nil, `echo' tries to behave like an ordinary shell echo. | |
| 81 This comes at some detriment to Lisp functionality. However, the Lisp | |
| 82 equivalent of `echo' can always be achieved by using `identity'." | |
| 83 :type 'boolean | |
| 84 :group 'eshell-basic) | |
| 87 | 85 |
| 88 ;;; Functions: | 86 ;;; Functions: |
| 89 | 87 |
| 90 (defun eshell-echo (args &optional output-newline) | 88 (defun eshell-echo (args &optional output-newline) |
| 91 "Implementation code for a Lisp version of `echo'. | 89 "Implementation code for a Lisp version of `echo'. |
| 178 (error "setting umask symbolically is not yet implemented")) | 176 (error "setting umask symbolically is not yet implemented")) |
| 179 (eshell-print | 177 (eshell-print |
| 180 "Warning: umask changed for all new files created by Emacs.\n")) | 178 "Warning: umask changed for all new files created by Emacs.\n")) |
| 181 nil)) | 179 nil)) |
| 182 | 180 |
| 183 (eval-when-compile | 181 (provide 'em-basic) |
| 184 (defvar print-func)) | |
| 185 | 182 |
| 186 ;;; arch-tag: 385a31b1-cb95-46f0-9829-9d352ee77db8 | 183 ;;; arch-tag: 385a31b1-cb95-46f0-9829-9d352ee77db8 |
| 187 ;;; em-basic.el ends here | 184 ;;; em-basic.el ends here |
