--- a/em-ls.el 2012-10-27 16:58:13.256903342 +1300 +++ b/em-ls.el 2012-10-27 16:16:16.207204792 +1300 @@ -327,6 +327,7 @@ (defvar numeric-uid-gid) (defvar reverse-list) (defvar show-all) +(defvar show-almost-all) (defvar show-recursive) (defvar show-size) (defvar sort-method) @@ -342,7 +343,9 @@ (list eshell-ls-initial-args args) args) `((?a "all" nil show-all - "show all files in directory") + "do not ignore entries starting with .") + (?A "almost-all" nil show-almost-all + "do not list implied . and ..") (?c nil by-ctime sort-method "sort by last status change time") (?d "directory" nil dir-literal @@ -557,7 +560,17 @@ ;; later when we are going to ;; display user and group names. (if numeric-uid-gid 'integer 'string)))) - (when (and (not show-all) eshell-ls-exclude-regexp) + (when (and show-almost-all + (not show-all)) + (setq entries + (remove-if + (lambda (entry) + (let ((filename (caar entry))) + (or (string= filename ".") + (string= filename "..")))) + entries))) + (when (and (not show-all) + eshell-ls-exclude-regexp) (while (and entries (string-match eshell-ls-exclude-regexp (caar entries))) (setq entries (cdr entries)))