X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/eada086196ccb005ded188ac2e58d41f3682a125..01fcc3a532872b29784a4d888ab9cc1aef0eed01:/lisp/eshell/em-ls.el diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 2dd92ba353..73ed617b87 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -1,6 +1,6 @@ ;;; em-ls.el --- implementation of ls in Lisp -;; Copyright (C) 1999-2012 Free Software Foundation, Inc. +;; Copyright (C) 1999-2013 Free Software Foundation, Inc. ;; Author: John Wiegley @@ -26,9 +26,8 @@ ;;; Code: -(eval-when-compile - (require 'cl-lib) - (require 'eshell)) +(eval-when-compile (require 'eshell)) +(require 'cl-lib) (require 'esh-util) (require 'esh-opt) @@ -328,6 +327,7 @@ instead." (defvar numeric-uid-gid) (defvar reverse-list) (defvar show-all) +(defvar show-almost-all) (defvar show-recursive) (defvar show-size) (defvar sort-method) @@ -337,13 +337,15 @@ instead." (defun eshell-do-ls (&rest args) "Implementation of \"ls\" in Lisp, passing ARGS." (funcall flush-func -1) - ;; process the command arguments, and begin listing files + ;; Process the command arguments, and begin listing files. (eshell-eval-using-options "ls" (if eshell-ls-initial-args (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 @@ -558,7 +560,15 @@ relative to that directory." ;; 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 + (cl-remove-if + (lambda (entry) + (member (caar entry) '("." ".."))) + 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)))