Skip to content
Newer
Older
100644 70 lines (49 sloc) 2.4 KB
728ad1a @jwiegley Added documentation files.
jwiegley authored
1 Here are some of the fun things that Eshell can do, for those too
2 impatient for manuals!
3
4 - First off, Eshell should work anywhere that Emacs does. Eshell uses
5 no external processes -- only Emacs Lisp functions. So if
6 `directory-files' returns a list of filenames on your VAX, then
7 Eshell's implementation of ls should too.
8
9 - Lisp functions can be called using either Lisp or Eshell syntax.
10 Take the `+' function, for example:
11
12 /tmp $ (+ 1 2)
13 3
14 /tmp $ + 1 2
15 3
16
17 In the first case, the Lisp expression is simply handed to the Lisp
18 interpretor. In the second case, the arguments are parsed by
19 Eshell, and converted to numbers because they look like numbers.
20 The argument list is then passed to `+'.
21
22 - Several things return lists as their result. Globbing and command
23 interpolation are good examples. This means you can pass these
24 lists to Lisp functions that can deal with lists.
25
26 For example, the `length' function, if passed a list, will return
27 the number of items in the list. And since a globbing pattern
28 always returns a list, here is a way to tell how many files match a
29 glob:
30
31 /tmp $ length *.el
32
33 Finding out the same information on UNIX requires two process
34 invocations:
35
36 /tmp $ ls -1 *.el | wc -l
37
38 This version can also be used with Eshell, but it's more complex,
39 and more expensive.
40
41 - Command interpolations result in lists as well. Each element of the
42 list represents one line of the command's output.
43
44 /tmp $ length ${egrep johnw /etc/passwd}
45
46 - To review all occurances of a regexp anywhere in the command outputs
47 of the current Eshell session, enter:
48
49 /tmp $ occur REGEXP
50
51 - Instead of "find . -print | xargs grep REGEXP", you can use Eshell's
52 recursive globbing syntax, which is taken from zsh:
53
54 /tmp $ grep REGEXP **/*(.) # grep all normal files
55
56 This command will also display the grep hits in a "*grep*" buffer,
57 allowing you to type C-x ` to visit the locations of the hits. The
58 "(.)" at the end of the glob pattern is an argument predicate, which
59 constrains the resulting list to only those entries for which
60 `file-regular-p' returns true.
61
62 - bash-style history references (!, C-r, C-p, etc).
63
64 - Supports 4nt's history reference style of typing the beginning of a
65 command, and then hitting up arrow to see all the commands beginning
66 with that text.
67
68 - There are a lot of other things, but I'm always so tired when I get
69 to this point.
Something went wrong with that request. Please try again.