On emacs mailing lists I've seen people paste their directory hierarchy like so:
|-- .yas-make-grou开发者_StackOverflow社区ps
|-- collections
| |-- each
| `-- ...
|-- control structure
| |-- forin
| `-- ...
|-- definitions
| `-- ...
`-- general
`-- ...
where .yas-make-groups would be a file, and collections would be a directory, etc.
I'm guessing this is a naive question, but is there some elisp code that no one told me about that I can use for this, or some package that does this?
I don't think this is emacs or lisp, but the tree
command. Have a look at http://linux.die.net/man/1/tree
The package containing this is also named tree. A visit to Google should find you a package for your favorite OS.
///BR, Jens
The tree
command-line program's the right answer, but if you also use org-mode
(and you should!), check out org-fstree.
Untested, quick and dirty. Piggy backs on the shell tree
command
(defun tree (directory)
(interactive "D")
(save-excursion
(let ((b (get-buffer-create "*tree")))
(switch-to-buffer b)
(shell-command (concat "/usr/bin/tree " directory) b))))
精彩评论