2013-09-12 20:15:53 +00:00
|
|
|
;;; em-ls.el --- implementation of ls in Lisp -*- lexical-binding:t -*-
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2016-01-01 09:16:19 +00:00
|
|
|
;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2000-10-16 12:27:09 +00:00
|
|
|
;; Author: John Wiegley <johnw@gnu.org>
|
|
|
|
|
2000-06-23 05:24:10 +00:00
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 03:36:21 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2000-06-23 05:24:10 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:36:21 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2008-05-06 03:36:21 +00:00
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2007-12-05 07:03:18 +00:00
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; Most of the command switches recognized by GNU's ls utility are
|
|
|
|
;; supported ([(fileutils)ls invocation]).
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2007-12-05 07:03:18 +00:00
|
|
|
;;; Code:
|
|
|
|
|
2013-02-08 15:47:07 +00:00
|
|
|
(require 'cl-lib)
|
2007-12-05 07:03:18 +00:00
|
|
|
(require 'esh-util)
|
|
|
|
(require 'esh-opt)
|
2013-05-23 07:55:52 +00:00
|
|
|
(eval-when-compile (require 'eshell))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2008-05-21 03:51:08 +00:00
|
|
|
;;;###autoload
|
Replace eshell-defgroup with plain defgroup
Borrowing a trick from vc-sccs.el, wrap the defgroup in a progn
so that the whole thing ends up in the generated autoload file,
esh-groups.el.
* em-alias.el, em-banner.el, em-basic.el, em-cmpl.el, em-dirs.el:
* em-glob.el, em-hist.el, em-ls.el, em-pred.el, em-prompt.el:
* em-rebind.el, em-script.el, em-smart.el, em-term.el, em-unix.el:
* em-xtra.el: Replace eshell-defgroup with (progn (defgroup.
* eshell.el (eshell-defgroup): Remove alias.
2012-06-27 07:08:06 +00:00
|
|
|
(progn
|
|
|
|
(defgroup eshell-ls nil
|
2000-06-23 05:24:10 +00:00
|
|
|
"This module implements the \"ls\" utility fully in Lisp. If it is
|
|
|
|
passed any unrecognized command switches, it will revert to the
|
|
|
|
operating system's version. This version of \"ls\" uses text
|
|
|
|
properties to colorize its output based on the setting of
|
|
|
|
`eshell-ls-use-colors'."
|
|
|
|
:tag "Implementation of `ls' in Lisp"
|
Replace eshell-defgroup with plain defgroup
Borrowing a trick from vc-sccs.el, wrap the defgroup in a progn
so that the whole thing ends up in the generated autoload file,
esh-groups.el.
* em-alias.el, em-banner.el, em-basic.el, em-cmpl.el, em-dirs.el:
* em-glob.el, em-hist.el, em-ls.el, em-pred.el, em-prompt.el:
* em-rebind.el, em-script.el, em-smart.el, em-term.el, em-unix.el:
* em-xtra.el: Replace eshell-defgroup with (progn (defgroup.
* eshell.el (eshell-defgroup): Remove alias.
2012-06-27 07:08:06 +00:00
|
|
|
:group 'eshell-module))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
;;; User Variables:
|
|
|
|
|
2011-06-27 21:47:39 +00:00
|
|
|
(defcustom eshell-ls-date-format "%Y-%m-%d"
|
|
|
|
"How to display time information in `eshell-ls-file'.
|
|
|
|
This is passed to `format-time-string' as a format string.
|
2015-09-17 23:08:20 +00:00
|
|
|
To display the date using the current locale, use \"%b \ %e\"."
|
Add missing :version tags to new defgroups and defcustoms
* window.el (window-sides-slots):
* tool-bar.el (tool-bar-position):
* term/xterm.el (xterm-extra-capabilities):
* ses.el (ses-self-reference-early-detection):
* progmodes/verilog-mode.el (verilog-auto-declare-nettype)
(verilog-auto-wire-type)
(verilog-auto-delete-trailing-whitespace)
(verilog-auto-reset-blocking-in-non, verilog-auto-inst-sort)
(verilog-auto-tieoff-declaration):
* progmodes/sql.el (sql-login-hook, sql-ansi-statement-starters)
(sql-oracle-statement-starters, sql-oracle-scan-on):
* progmodes/prolog.el (prolog-align-comments-flag)
(prolog-indent-mline-comments-flag, prolog-object-end-to-0-flag)
(prolog-left-indent-regexp, prolog-paren-indent-p)
(prolog-paren-indent, prolog-parse-mode, prolog-keywords)
(prolog-types, prolog-mode-specificators)
(prolog-determinism-specificators, prolog-directives)
(prolog-electric-newline-flag, prolog-hungry-delete-key-flag)
(prolog-electric-dot-flag)
(prolog-electric-dot-full-predicate-template)
(prolog-electric-underscore-flag, prolog-electric-tab-flag)
(prolog-electric-if-then-else-flag, prolog-electric-colon-flag)
(prolog-electric-dash-flag, prolog-old-sicstus-keys-flag)
(prolog-program-switches, prolog-prompt-regexp)
(prolog-debug-on-string, prolog-debug-off-string)
(prolog-trace-on-string, prolog-trace-off-string)
(prolog-zip-on-string, prolog-zip-off-string)
(prolog-use-standard-consult-compile-method-flag)
(prolog-use-prolog-tokenizer-flag, prolog-imenu-flag)
(prolog-imenu-max-lines, prolog-info-predicate-index)
(prolog-underscore-wordchar-flag, prolog-use-sicstus-sd)
(prolog-char-quote-workaround):
* progmodes/cc-vars.el (c-defun-tactic):
* net/tramp.el (tramp-encoding-command-interactive)
(tramp-local-end-of-line):
* net/soap-client.el (soap-client):
* net/netrc.el (netrc-file):
* net/gnutls.el (gnutls):
* minibuffer.el (completion-category-overrides)
(completion-cycle-threshold)
(completion-pcm-complete-word-inserts-delimiters):
* man.el (Man-name-local-regexp):
* mail/feedmail.el (feedmail-display-full-frame):
* international/characters.el (glyphless-char-display-control):
* eshell/em-ls.el (eshell-ls-date-format):
* emacs-lisp/cl-indent.el (lisp-lambda-list-keyword-alignment)
(lisp-lambda-list-keyword-parameter-indentation)
(lisp-lambda-list-keyword-parameter-alignment):
* doc-view.el (doc-view-image-width, doc-view-unoconv-program):
* dired-x.el (dired-omit-verbose):
* cus-theme.el (custom-theme-allow-multiple-selections):
* calc/calc.el (calc-highlight-selections-with-faces)
(calc-lu-field-reference, calc-lu-power-reference)
(calc-note-threshold):
* battery.el (battery-mode-line-limit):
* arc-mode.el (archive-7z-extract, archive-7z-expunge)
(archive-7z-update):
* allout.el (allout-prefixed-keybindings)
(allout-unprefixed-keybindings)
(allout-inhibit-auto-fill-on-headline)
(allout-flattened-numbering-abbreviation):
* allout-widgets.el (allout-widgets-auto-activation)
(allout-widgets-icons-dark-subdir)
(allout-widgets-icons-light-subdir, allout-widgets-icon-types)
(allout-widgets-theme-dark-background)
(allout-widgets-theme-light-background)
(allout-widgets-item-image-properties-emacs)
(allout-widgets-item-image-properties-xemacs)
(allout-widgets-run-unit-tests-on-load)
(allout-widgets-time-decoration-activity)
(allout-widgets-hook-error-post-time)
(allout-widgets-track-decoration):
* gnus/sieve-manage.el (sieve-manage-default-stream):
* gnus/shr.el (shr):
* gnus/nnir.el (nnir-ignored-newsgroups, nnir-summary-line-format)
(nnir-retrieve-headers-override-function)
(nnir-imap-default-search-key, nnir-notmuch-program)
(nnir-notmuch-additional-switches, nnir-notmuch-remove-prefix)
(nnir-method-default-engines):
* gnus/message.el (message-cite-reply-position):
* gnus/gssapi.el (gssapi-program):
* gnus/gravatar.el (gravatar):
* gnus/gnus-sum.el (gnus-refer-thread-use-nnir):
* gnus/gnus-registry.el (gnus-registry-unfollowed-addresses)
(gnus-registry-max-pruned-entries):
* gnus/gnus-picon.el (gnus-picon-inhibit-top-level-domains):
* gnus/gnus-int.el (gnus-after-set-mark-hook)
(gnus-before-update-mark-hook):
* gnus/gnus-async.el (gnus-async-post-fetch-function):
* gnus/auth-source.el (auth-source-cache-expiry):
Add missing :version tags to new defcustoms and defgroups.
2012-02-11 22:13:29 +00:00
|
|
|
:version "24.1"
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'string)
|
2011-06-27 21:47:39 +00:00
|
|
|
|
2000-10-29 05:18:48 +00:00
|
|
|
(defcustom eshell-ls-initial-args nil
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"If non-nil, this list of args is included before any call to `ls'.
|
2000-10-29 05:18:48 +00:00
|
|
|
This is useful for enabling human-readable format (-h), for example."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type '(repeat :tag "Arguments" string))
|
2000-10-29 05:18:48 +00:00
|
|
|
|
2001-10-17 02:00:00 +00:00
|
|
|
(defcustom eshell-ls-dired-initial-args nil
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"If non-nil, args is included before any call to `ls' in Dired.
|
2001-10-17 02:00:00 +00:00
|
|
|
This is useful for enabling human-readable format (-h), for example."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type '(repeat :tag "Arguments" string))
|
2001-10-17 02:00:00 +00:00
|
|
|
|
2000-06-23 05:24:10 +00:00
|
|
|
(defcustom eshell-ls-use-in-dired nil
|
2013-09-19 02:28:20 +00:00
|
|
|
"If non-nil, use `eshell-ls' to read directories in Dired.
|
|
|
|
Changing this without using customize has no effect."
|
2000-06-23 05:24:10 +00:00
|
|
|
:set (lambda (symbol value)
|
|
|
|
(if value
|
2013-09-19 20:51:33 +00:00
|
|
|
(advice-add 'insert-directory :around
|
|
|
|
#'eshell-ls--insert-directory)
|
|
|
|
(advice-remove 'insert-directory
|
|
|
|
#'eshell-ls--insert-directory))
|
|
|
|
(set symbol value))
|
2000-06-23 05:24:10 +00:00
|
|
|
:type 'boolean
|
2013-09-19 20:51:33 +00:00
|
|
|
:require 'em-ls)
|
|
|
|
(add-hook 'eshell-ls-unload-hook
|
|
|
|
(lambda () (advice-remove 'insert-directory
|
|
|
|
#'eshell-ls--insert-directory)))
|
|
|
|
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defcustom eshell-ls-default-blocksize 1024
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"The default blocksize to use when display file sizes with -s."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'integer)
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2000-10-29 05:18:48 +00:00
|
|
|
(defcustom eshell-ls-exclude-regexp nil
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"Unless -a is specified, files matching this regexp will not be shown."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type '(choice regexp (const nil)))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2000-10-29 05:18:48 +00:00
|
|
|
(defcustom eshell-ls-exclude-hidden t
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"Unless -a is specified, files beginning with . will not be shown.
|
2000-10-29 05:18:48 +00:00
|
|
|
Using this boolean, instead of `eshell-ls-exclude-regexp', is both
|
|
|
|
faster and conserves more memory."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'boolean)
|
2000-10-29 05:18:48 +00:00
|
|
|
|
2000-06-23 05:24:10 +00:00
|
|
|
(defcustom eshell-ls-use-colors t
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"If non-nil, use colors in file listings."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'boolean)
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-directory
|
2001-12-31 20:44:44 +00:00
|
|
|
'((((class color) (background light)) (:foreground "Blue" :weight bold))
|
|
|
|
(((class color) (background dark)) (:foreground "SkyBlue" :weight bold))
|
|
|
|
(t (:weight bold)))
|
2013-10-30 06:29:22 +00:00
|
|
|
"The face used for highlighting directories.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-symlink
|
2001-12-31 20:44:44 +00:00
|
|
|
'((((class color) (background light)) (:foreground "Dark Cyan" :weight bold))
|
|
|
|
(((class color) (background dark)) (:foreground "Cyan" :weight bold)))
|
2013-10-30 06:29:22 +00:00
|
|
|
"The face used for highlighting symbolic links.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-executable
|
2001-12-31 20:44:44 +00:00
|
|
|
'((((class color) (background light)) (:foreground "ForestGreen" :weight bold))
|
|
|
|
(((class color) (background dark)) (:foreground "Green" :weight bold)))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting executables (not directories, though).")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-readonly
|
2000-06-23 05:24:10 +00:00
|
|
|
'((((class color) (background light)) (:foreground "Brown"))
|
|
|
|
(((class color) (background dark)) (:foreground "Pink")))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting read-only files.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-unreadable
|
2000-06-23 05:24:10 +00:00
|
|
|
'((((class color) (background light)) (:foreground "Grey30"))
|
|
|
|
(((class color) (background dark)) (:foreground "DarkGrey")))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting unreadable files.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-special
|
2001-12-31 20:44:44 +00:00
|
|
|
'((((class color) (background light)) (:foreground "Magenta" :weight bold))
|
|
|
|
(((class color) (background dark)) (:foreground "Magenta" :weight bold)))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting non-regular files.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-missing
|
2001-12-31 20:44:44 +00:00
|
|
|
'((((class color) (background light)) (:foreground "Red" :weight bold))
|
|
|
|
(((class color) (background dark)) (:foreground "Red" :weight bold)))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting non-existent file names.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defcustom eshell-ls-archive-regexp
|
|
|
|
(concat "\\.\\(t\\(a[rz]\\|gz\\)\\|arj\\|lzh\\|"
|
2010-09-25 21:42:48 +00:00
|
|
|
"zip\\|[zZ]\\|gz\\|bz2\\|xz\\|deb\\|rpm\\)\\'")
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"A regular expression that matches names of file archives.
|
2000-06-23 05:24:10 +00:00
|
|
|
This typically includes both traditional archives and compressed
|
|
|
|
files."
|
2010-09-25 21:42:48 +00:00
|
|
|
:version "24.1" ; added xz
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'regexp)
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-archive
|
2001-12-31 20:44:44 +00:00
|
|
|
'((((class color) (background light)) (:foreground "Orchid" :weight bold))
|
|
|
|
(((class color) (background dark)) (:foreground "Orchid" :weight bold)))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting archived and compressed file names.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defcustom eshell-ls-backup-regexp
|
|
|
|
"\\(\\`\\.?#\\|\\(\\.bak\\|~\\)\\'\\)"
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"A regular expression that matches names of backup files."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'regexp)
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-backup
|
2000-06-23 05:24:10 +00:00
|
|
|
'((((class color) (background light)) (:foreground "OrangeRed"))
|
|
|
|
(((class color) (background dark)) (:foreground "LightSalmon")))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting backup file names.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defcustom eshell-ls-product-regexp
|
2002-12-07 19:05:03 +00:00
|
|
|
"\\.\\(elc\\|o\\(bj\\)?\\|a\\|lib\\|res\\)\\'"
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"A regular expression that matches names of product files.
|
2000-06-23 05:24:10 +00:00
|
|
|
Products are files that get generated from a source file, and hence
|
|
|
|
ought to be recreatable if they are deleted."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'regexp)
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-product
|
2000-06-23 05:24:10 +00:00
|
|
|
'((((class color) (background light)) (:foreground "OrangeRed"))
|
|
|
|
(((class color) (background dark)) (:foreground "LightSalmon")))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting files that are build products.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defcustom eshell-ls-clutter-regexp
|
|
|
|
"\\(^texput\\.log\\|^core\\)\\'"
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"A regular expression that matches names of junk files.
|
2000-06-23 05:24:10 +00:00
|
|
|
These are mainly files that get created for various reasons, but don't
|
|
|
|
really need to stick around for very long."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type 'regexp)
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
(defface eshell-ls-clutter
|
2001-12-31 20:44:44 +00:00
|
|
|
'((((class color) (background light)) (:foreground "OrangeRed" :weight bold))
|
|
|
|
(((class color) (background dark)) (:foreground "OrangeRed" :weight bold)))
|
2013-09-19 20:51:33 +00:00
|
|
|
"The face used for highlighting junk file names.")
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defsubst eshell-ls-filetype-p (attrs type)
|
|
|
|
"Test whether ATTRS specifies a directory."
|
|
|
|
(if (nth 8 attrs)
|
|
|
|
(eq (aref (nth 8 attrs) 0) type)))
|
|
|
|
|
|
|
|
(defmacro eshell-ls-applicable (attrs index func file)
|
2010-02-09 01:58:57 +00:00
|
|
|
"Test whether, for ATTRS, the user can do what corresponds to INDEX.
|
|
|
|
ATTRS is a string of file modes. See `file-attributes'.
|
|
|
|
If we cannot determine the answer using ATTRS (e.g., if we need
|
|
|
|
to know what group the user is in), compute the return value by
|
|
|
|
calling FUNC with FILE as an argument."
|
|
|
|
`(let ((owner (nth 2 ,attrs))
|
|
|
|
(modes (nth 8 ,attrs)))
|
|
|
|
(cond ((cond ((numberp owner)
|
|
|
|
(= owner (user-uid)))
|
|
|
|
((stringp owner)
|
|
|
|
(or (string-equal owner (user-login-name))
|
|
|
|
(member owner (eshell-current-ange-uids)))))
|
|
|
|
;; The user owns this file.
|
|
|
|
(not (eq (aref modes ,index) ?-)))
|
|
|
|
((eq (aref modes (+ ,index 3))
|
|
|
|
(aref modes (+ ,index 6)))
|
|
|
|
;; If the "group" and "other" fields give identical
|
|
|
|
;; results, use that.
|
|
|
|
(not (eq (aref modes (+ ,index 3)) ?-)))
|
|
|
|
(t
|
|
|
|
;; Otherwise call FUNC.
|
|
|
|
(,(eval func) ,file)))))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defcustom eshell-ls-highlight-alist nil
|
Cosmetic doc fixes for eshell.
* eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el:
* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el:
* eshell/em-hist.el, eshell/em-ls.el, eshell/em-pred.el:
* eshell/em-prompt.el, eshell/em-rebind.el, eshell/em-script.el:
* eshell/em-smart.el, eshell/em-term.el, eshell/em-unix.el:
* eshell/esh-cmd.el, eshell/esh-ext.el, eshell/esh-io.el:
* eshell/esh-mode.el, eshell/esh-proc.el, eshell/esh-test.el:
* eshell/esh-util.el, eshell/esh-var.el:
Remove leading `*' from docs of faces and defcustoms.
2010-09-25 21:51:55 +00:00
|
|
|
"This alist correlates test functions to color.
|
2000-06-23 05:24:10 +00:00
|
|
|
The format of the members of this alist is
|
|
|
|
|
|
|
|
(TEST-SEXP . FACE)
|
|
|
|
|
|
|
|
If TEST-SEXP evals to non-nil, that face will be used to highlight the
|
|
|
|
name of the file. The first match wins. `file' and `attrs' are in
|
|
|
|
scope during the evaluation of TEST-SEXP."
|
2013-09-19 20:51:33 +00:00
|
|
|
:type '(repeat (cons function face)))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Cleanup Eshell to rely less on dynamic scoping.
* lisp/eshell/esh-opt.el (eshell-eval-using-options): Don't bind usage-msg,
last-value, and ext-command here. Bind `args' closer to `body'.
(temp-args, last-value, usage-msg, ext-command, args): Don't defvar.
(eshell--args): Declare new dynamic var.
(eshell-do-opt): Add argument `args'. Bind our own usage-msg,
last-value, and ext-command. Pass `args' to `body'.
(eshell-process-args): Bind eshell--args.
(eshell-set-option): Use eshell--args.
* lisp/eshell/eshell.el (eshell): Use derived-mode-p.
* lisp/eshell/esh-var.el (eshell-parse-variable): Use backquote.
(eshell-parse-variable-ref): Remove unused vars `end' and `err'.
(eshell-glob-function): Declare.
* lisp/eshell/esh-util.el: Require cl-lib.
(eshell-read-hosts-file): Avoid add-to-list.
* lisp/eshell/esh-cmd.el (eshell-parse-lisp-argument): Remove unused var
`err'.
* lisp/eshell/em-unix.el (compilation-scroll-output, locate-history-list):
Declare.
(eshell/diff): Remove unused var `err'.
* lisp/eshell/em-rebind.el (eshell-delete-backward-char): Remove unused arg
`killflag'.
* lisp/eshell/em-pred.el (eshell-parse-modifiers): Remove unused var `err'.
* lisp/eshell/em-ls.el (eshell-ls-highlight-alist): Move defvars before
first use.
* lisp/eshell/em-glob.el (eshell-glob-matches, message-shown):
Move declaration before first use.
* lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Use backquotes.
* autorevert.el (auto-revert-notify-handler): Use `cl-dolist' since we
rely on cl-return.
2013-09-12 05:20:07 +00:00
|
|
|
(defvar block-size)
|
|
|
|
(defvar dereference-links)
|
|
|
|
(defvar dir-literal)
|
|
|
|
(defvar error-func)
|
|
|
|
(defvar flush-func)
|
|
|
|
(defvar human-readable)
|
|
|
|
(defvar ignore-pattern)
|
|
|
|
(defvar insert-func)
|
|
|
|
(defvar listing-style)
|
|
|
|
(defvar numeric-uid-gid)
|
|
|
|
(defvar reverse-list)
|
|
|
|
(defvar show-all)
|
|
|
|
(defvar show-almost-all)
|
|
|
|
(defvar show-recursive)
|
|
|
|
(defvar show-size)
|
|
|
|
(defvar sort-method)
|
|
|
|
(defvar ange-cache)
|
|
|
|
(defvar dired-flag)
|
|
|
|
|
2000-06-23 05:24:10 +00:00
|
|
|
;;; Functions:
|
|
|
|
|
2013-09-19 20:51:33 +00:00
|
|
|
(defun eshell-ls--insert-directory
|
|
|
|
(orig-fun file switches &optional wildcard full-directory-p)
|
2000-06-23 05:24:10 +00:00
|
|
|
"Insert directory listing for FILE, formatted according to SWITCHES.
|
|
|
|
Leaves point after the inserted text.
|
|
|
|
SWITCHES may be a string of options, or a list of strings.
|
|
|
|
Optional third arg WILDCARD means treat FILE as shell wildcard.
|
|
|
|
Optional fourth arg FULL-DIRECTORY-P means file is a directory and
|
|
|
|
switches do not contain `d', so that a full listing is expected.
|
|
|
|
|
|
|
|
This version of the function uses `eshell/ls'. If any of the switches
|
|
|
|
passed are not recognized, the operating system's version will be used
|
|
|
|
instead."
|
2013-09-19 20:51:33 +00:00
|
|
|
(if (not eshell-ls-use-in-dired)
|
|
|
|
(funcall orig-fun file switches wildcard full-directory-p)
|
|
|
|
(let ((handler (find-file-name-handler file 'insert-directory)))
|
|
|
|
(if handler
|
|
|
|
(funcall handler 'insert-directory file switches
|
|
|
|
wildcard full-directory-p)
|
|
|
|
(if (stringp switches)
|
|
|
|
(setq switches (split-string switches)))
|
|
|
|
(let (eshell-current-handles
|
|
|
|
eshell-current-subjob-p
|
|
|
|
font-lock-mode)
|
|
|
|
;; use the fancy highlighting in `eshell-ls' rather than font-lock
|
|
|
|
(when (and eshell-ls-use-colors
|
|
|
|
(featurep 'font-lock))
|
|
|
|
(font-lock-mode -1)
|
|
|
|
(setq font-lock-defaults nil)
|
|
|
|
(if (boundp 'font-lock-buffers)
|
|
|
|
(set 'font-lock-buffers
|
|
|
|
(delq (current-buffer)
|
|
|
|
(symbol-value 'font-lock-buffers)))))
|
|
|
|
(let ((insert-func 'insert)
|
|
|
|
(error-func 'insert)
|
|
|
|
(flush-func 'ignore)
|
|
|
|
eshell-ls-dired-initial-args)
|
|
|
|
(eshell-do-ls (append switches (list file)))))))))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
|
|
|
(defsubst eshell/ls (&rest args)
|
|
|
|
"An alias version of `eshell-do-ls'."
|
|
|
|
(let ((insert-func 'eshell-buffered-print)
|
|
|
|
(error-func 'eshell-error)
|
|
|
|
(flush-func 'eshell-flush))
|
2012-07-16 11:42:01 +00:00
|
|
|
(apply 'eshell-do-ls args)))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
Set the property `eshell-no-numeric-conversions' on the following
functions (which all deal with filesystem entities, and never Lisp
numerical values): eshell/cd, eshell/pushd, eshell/popd, eshell/ls,
eshell/source, eshell/., eshell/man, eshell/rm, eshell/mkdir,
eshell/rmdir, eshell/mv, eshell/cp, eshell/ln, eshell/cat,
eshell/make, eshell/diff, eshell/locate, eshell/occur, eshell/which,
eshell/addpath.
2001-05-10 03:47:24 +00:00
|
|
|
(put 'eshell/ls 'eshell-no-numeric-conversions t)
|
|
|
|
|
2013-05-23 07:55:52 +00:00
|
|
|
(declare-function eshell-glob-regexp "em-glob" (pattern))
|
|
|
|
|
2000-06-23 05:24:10 +00:00
|
|
|
(defun eshell-do-ls (&rest args)
|
|
|
|
"Implementation of \"ls\" in Lisp, passing ARGS."
|
|
|
|
(funcall flush-func -1)
|
2013-02-08 15:07:03 +00:00
|
|
|
;; Process the command arguments, and begin listing files.
|
2000-06-23 05:24:10 +00:00
|
|
|
(eshell-eval-using-options
|
2000-10-29 05:18:48 +00:00
|
|
|
"ls" (if eshell-ls-initial-args
|
|
|
|
(list eshell-ls-initial-args args)
|
|
|
|
args)
|
2002-08-10 00:20:09 +00:00
|
|
|
`((?a "all" nil show-all
|
2013-02-08 15:07:03 +00:00
|
|
|
"do not ignore entries starting with .")
|
|
|
|
(?A "almost-all" nil show-almost-all
|
|
|
|
"do not list implied . and ..")
|
2000-06-23 05:24:10 +00:00
|
|
|
(?c nil by-ctime sort-method
|
2005-11-01 07:07:05 +00:00
|
|
|
"sort by last status change time")
|
2000-06-23 05:24:10 +00:00
|
|
|
(?d "directory" nil dir-literal
|
|
|
|
"list directory entries instead of contents")
|
|
|
|
(?k "kilobytes" 1024 block-size
|
2002-08-10 00:20:09 +00:00
|
|
|
"using 1024 as the block size")
|
2000-06-23 05:24:10 +00:00
|
|
|
(?h "human-readable" 1024 human-readable
|
|
|
|
"print sizes in human readable format")
|
2002-08-10 00:20:09 +00:00
|
|
|
(?H "si" 1000 human-readable
|
|
|
|
"likewise, but use powers of 1000 not 1024")
|
2000-06-23 05:24:10 +00:00
|
|
|
(?I "ignore" t ignore-pattern
|
|
|
|
"do not list implied entries matching pattern")
|
|
|
|
(?l nil long-listing listing-style
|
|
|
|
"use a long listing format")
|
|
|
|
(?n "numeric-uid-gid" nil numeric-uid-gid
|
|
|
|
"list numeric UIDs and GIDs instead of names")
|
|
|
|
(?r "reverse" nil reverse-list
|
|
|
|
"reverse order while sorting")
|
|
|
|
(?s "size" nil show-size
|
|
|
|
"print size of each file, in blocks")
|
|
|
|
(?t nil by-mtime sort-method
|
|
|
|
"sort by modification time")
|
|
|
|
(?u nil by-atime sort-method
|
|
|
|
"sort by last access time")
|
2002-08-10 00:18:18 +00:00
|
|
|
(?x nil by-lines listing-style
|
|
|
|
"list entries by lines instead of by columns")
|
2002-08-10 00:20:09 +00:00
|
|
|
(?C nil by-columns listing-style
|
|
|
|
"list entries by columns")
|
2009-03-21 14:03:06 +00:00
|
|
|
(?L "dereference" nil dereference-links
|
2002-08-10 00:20:09 +00:00
|
|
|
"list entries pointed to by symbolic links")
|
|
|
|
(?R "recursive" nil show-recursive
|
|
|
|
"list subdirectories recursively")
|
|
|
|
(?S nil by-size sort-method
|
|
|
|
"sort by file size")
|
|
|
|
(?U nil unsorted sort-method
|
|
|
|
"do not sort; list entries in directory order")
|
2000-06-23 05:24:10 +00:00
|
|
|
(?X nil by-extension sort-method
|
|
|
|
"sort alphabetically by entry extension")
|
|
|
|
(?1 nil single-column listing-style
|
|
|
|
"list one file per line")
|
2005-11-01 07:07:05 +00:00
|
|
|
(nil "dired" nil dired-flag
|
|
|
|
"Here for compatibility with GNU ls.")
|
2000-06-23 05:24:10 +00:00
|
|
|
(nil "help" nil nil
|
2002-08-10 00:20:09 +00:00
|
|
|
"show this usage display")
|
2000-06-23 05:24:10 +00:00
|
|
|
:external "ls"
|
|
|
|
:usage "[OPTION]... [FILE]...
|
|
|
|
List information about the FILEs (the current directory by default).
|
2002-08-10 00:20:09 +00:00
|
|
|
Sort entries alphabetically across.")
|
2000-06-23 05:24:10 +00:00
|
|
|
;; setup some defaults, based on what the user selected
|
|
|
|
(unless block-size
|
|
|
|
(setq block-size eshell-ls-default-blocksize))
|
|
|
|
(unless listing-style
|
|
|
|
(setq listing-style 'by-columns))
|
|
|
|
(unless args
|
|
|
|
(setq args (list ".")))
|
2000-10-13 09:02:39 +00:00
|
|
|
(let ((eshell-ls-exclude-regexp eshell-ls-exclude-regexp) ange-cache)
|
2002-08-10 00:20:09 +00:00
|
|
|
(when ignore-pattern
|
2000-06-23 05:24:10 +00:00
|
|
|
(unless (eshell-using-module 'eshell-glob)
|
|
|
|
(error (concat "-I option requires that `eshell-glob'"
|
|
|
|
" be a member of `eshell-modules-list'")))
|
|
|
|
(set-text-properties 0 (length ignore-pattern) nil ignore-pattern)
|
2000-10-29 05:18:48 +00:00
|
|
|
(setq eshell-ls-exclude-regexp
|
|
|
|
(if eshell-ls-exclude-regexp
|
2000-06-23 05:24:10 +00:00
|
|
|
(concat "\\(" eshell-ls-exclude-regexp "\\|"
|
2000-10-29 05:18:48 +00:00
|
|
|
(eshell-glob-regexp ignore-pattern) "\\)")
|
|
|
|
(eshell-glob-regexp ignore-pattern))))
|
2000-06-23 05:24:10 +00:00
|
|
|
;; list the files!
|
|
|
|
(eshell-ls-entries
|
2010-02-07 06:23:10 +00:00
|
|
|
(mapcar (lambda (arg)
|
|
|
|
(cons (if (and (eshell-under-windows-p)
|
|
|
|
(file-name-absolute-p arg))
|
|
|
|
(expand-file-name arg)
|
|
|
|
arg)
|
|
|
|
(eshell-file-attributes
|
|
|
|
arg (if numeric-uid-gid 'integer 'string))))
|
2000-10-29 05:18:48 +00:00
|
|
|
args)
|
2000-06-23 05:24:10 +00:00
|
|
|
t (expand-file-name default-directory)))
|
|
|
|
(funcall flush-func)))
|
|
|
|
|
|
|
|
(defsubst eshell-ls-printable-size (filesize &optional by-blocksize)
|
|
|
|
"Return a printable FILESIZE."
|
|
|
|
(eshell-printable-size filesize human-readable
|
|
|
|
(and by-blocksize block-size)
|
|
|
|
eshell-ls-use-colors))
|
|
|
|
|
|
|
|
(defsubst eshell-ls-size-string (attrs size-width)
|
|
|
|
"Return the size string for ATTRS length, using SIZE-WIDTH."
|
|
|
|
(let* ((str (eshell-ls-printable-size (nth 7 attrs) t))
|
|
|
|
(len (length str)))
|
|
|
|
(if (< len size-width)
|
|
|
|
(concat (make-string (- size-width len) ? ) str)
|
|
|
|
str)))
|
|
|
|
|
|
|
|
(defun eshell-ls-annotate (fileinfo)
|
|
|
|
"Given a FILEINFO object, return a resolved, decorated FILEINFO.
|
|
|
|
This means resolving any symbolic links, determining what face the
|
|
|
|
name should be displayed as, etc. Think of it as cooking a FILEINFO."
|
|
|
|
(if (not (and (stringp (cadr fileinfo))
|
|
|
|
(or dereference-links
|
|
|
|
(eq listing-style 'long-listing))))
|
|
|
|
(setcar fileinfo (eshell-ls-decorated-name fileinfo))
|
|
|
|
(let (dir attr)
|
|
|
|
(unless (file-name-absolute-p (cadr fileinfo))
|
|
|
|
(setq dir (file-truename
|
|
|
|
(file-name-directory
|
|
|
|
(expand-file-name (car fileinfo))))))
|
|
|
|
(setq attr
|
2000-10-13 09:02:39 +00:00
|
|
|
(eshell-file-attributes
|
2000-06-23 05:24:10 +00:00
|
|
|
(let ((target (if dir
|
|
|
|
(expand-file-name (cadr fileinfo) dir)
|
|
|
|
(cadr fileinfo))))
|
|
|
|
(if dereference-links
|
|
|
|
(file-truename target)
|
|
|
|
target))))
|
|
|
|
(if (or dereference-links
|
|
|
|
(string-match "^\\.\\.?$" (car fileinfo)))
|
|
|
|
(progn
|
|
|
|
(setcdr fileinfo attr)
|
|
|
|
(setcar fileinfo (eshell-ls-decorated-name fileinfo)))
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 23:13:41 +00:00
|
|
|
(cl-assert (eq listing-style 'long-listing))
|
2000-06-23 05:24:10 +00:00
|
|
|
(setcar fileinfo
|
|
|
|
(concat (eshell-ls-decorated-name fileinfo) " -> "
|
|
|
|
(eshell-ls-decorated-name
|
|
|
|
(cons (cadr fileinfo) attr)))))))
|
|
|
|
fileinfo)
|
|
|
|
|
|
|
|
(defun eshell-ls-file (fileinfo &optional size-width copy-fileinfo)
|
|
|
|
"Output FILE in long format.
|
|
|
|
FILE may be a string, or a cons cell whose car is the filename and
|
|
|
|
whose cdr is the list of file attributes."
|
|
|
|
(if (not (cdr fileinfo))
|
|
|
|
(funcall error-func (format "%s: No such file or directory\n"
|
|
|
|
(car fileinfo)))
|
|
|
|
(setq fileinfo
|
|
|
|
(eshell-ls-annotate (if copy-fileinfo
|
|
|
|
(cons (car fileinfo)
|
|
|
|
(cdr fileinfo))
|
|
|
|
fileinfo)))
|
|
|
|
(let ((file (car fileinfo))
|
|
|
|
(attrs (cdr fileinfo)))
|
|
|
|
(if (not (eq listing-style 'long-listing))
|
|
|
|
(if show-size
|
|
|
|
(funcall insert-func (eshell-ls-size-string attrs size-width)
|
|
|
|
" " file "\n")
|
|
|
|
(funcall insert-func file "\n"))
|
|
|
|
(let ((line
|
|
|
|
(concat
|
|
|
|
(if show-size
|
|
|
|
(concat (eshell-ls-size-string attrs size-width) " "))
|
|
|
|
(format
|
2009-03-21 14:03:06 +00:00
|
|
|
(if numeric-uid-gid
|
|
|
|
"%s%4d %-8s %-8s "
|
|
|
|
"%s%4d %-14s %-8s ")
|
2000-06-23 05:24:10 +00:00
|
|
|
(or (nth 8 attrs) "??????????")
|
|
|
|
(or (nth 1 attrs) 0)
|
2000-10-13 09:02:39 +00:00
|
|
|
(or (let ((user (nth 2 attrs)))
|
2009-03-21 14:03:06 +00:00
|
|
|
(and (stringp user)
|
|
|
|
(eshell-substring user 14)))
|
2000-06-23 05:24:10 +00:00
|
|
|
(nth 2 attrs)
|
|
|
|
"")
|
2000-10-13 09:02:39 +00:00
|
|
|
(or (let ((group (nth 3 attrs)))
|
2009-03-21 14:03:06 +00:00
|
|
|
(and (stringp group)
|
|
|
|
(eshell-substring group 8)))
|
2000-06-23 05:24:10 +00:00
|
|
|
(nth 3 attrs)
|
|
|
|
""))
|
|
|
|
(let* ((str (eshell-ls-printable-size (nth 7 attrs)))
|
|
|
|
(len (length str)))
|
2009-03-21 13:01:20 +00:00
|
|
|
;; Let file sizes shorter than 9 align neatly.
|
|
|
|
(if (< len (or size-width 8))
|
|
|
|
(concat (make-string (- (or size-width 8) len) ? ) str)
|
2000-06-23 05:24:10 +00:00
|
|
|
str))
|
|
|
|
" " (format-time-string
|
2002-08-10 00:20:09 +00:00
|
|
|
(concat
|
2011-06-27 21:47:39 +00:00
|
|
|
eshell-ls-date-format " "
|
Simplify use of current-time and friends.
* doc/misc/org.texi (Dynamic blocks):
* lisp/allout-widgets.el (allout-widgets-hook-error-handler):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/icalendar.el (icalendar--convert-float-to-ical):
* lisp/calendar/timeclock.el (timeclock-in, timeclock-when-to-leave)
(timeclock-last-period, timeclock-day-base):
* lisp/eshell/em-ls.el (eshell-ls-file):
* lisp/eshell/esh-util.el (eshell-parse-ange-ls):
* lisp/generic-x.el (named-database-print-serial):
* lisp/net/newst-backend.el (newsticker--get-news-by-url-callback)
(newsticker-get-news, newsticker--sentinel-work)
(newsticker--image-get, newsticker--image-sentinel):
* lisp/net/tramp-sh.el (tramp-get-remote-touch):
* lisp/progmodes/opascal.el (opascal-debug-log):
* lisp/textmodes/remember.el (remember-mail-date)
(remember-store-in-files):
* lisp/vc/vc-annotate.el (vc-annotate-display-autoscale)
(vc-default-annotate-current-time):
* lisp/vc/vc-bzr.el (vc-bzr-shelve-snapshot):
* lisp/vc/vc-cvs.el (vc-cvs-annotate-current-time):
* lisp/vc/vc-rcs.el (vc-rcs-annotate-current-time):
* lisp/url/url-util.el (url-get-normalized-date):
* lisp/erc/erc-backend.el (TOPIC):
* lisp/gnus/gnus-delay.el (gnus-delay-article):
* lisp/gnus/gnus-sum.el (gnus-summary-read-document):
* lisp/gnus/gnus-util.el (gnus-seconds-today, gnus-seconds-month):
* lisp/gnus/message.el (message-make-expires-date):
* lisp/org/org-archive.el (org-archive-subtree)
(org-archive-to-archive-sibling):
* lisp/org/org-clock.el (org-resolve-clocks, org-clock-get-sum-start)
(org-clock-special-range):
* lisp/org/org-timer.el (org-timer-seconds):
* lisp/org/org.el (org-read-date-analyze, org-get-cursor-date):
* lisp/org/ox-html.el (org-html-format-spec):
* lisp/org/ox-icalendar.el (org-icalendar--vtodo):
Omit unnecessary call to current-time.
* lisp/calendar/time-date.el (time-to-seconds) [!float-time]:
* lisp/calendar/timeclock.el (timeclock-time-to-date):
* lisp/vc/vc-annotate.el (vc-annotate-convert-time):
Use current time if arg is nil, to be compatible with float-time.
(time-date--day-in-year): New function, with most of the guts of
the old time-to-day-in-year.
(time-to-day-in-year): Use it.
(time-to-days): Use it, to avoid decoding the same time stamp twice.
* lisp/calendar/timeclock.el (timeclock-update-mode-line):
* lisp/cedet/srecode/args.el (srecode-semantic-handle-:time):
* lisp/gnus/gnus-util.el (gnus-seconds-year):
* lisp/org/org.el (org-get-cursor-date):
Don't call current-time twice to get the current time stamp,
as this can lead to inconsistent results.
* lisp/completion.el (cmpl-hours-since-origin):
* lisp/erc/erc.el (erc-emacs-time-to-erc-time):
* lisp/ido.el (ido-time-stamp):
* lisp/vc/vc-annotate.el (vc-annotate-convert-time):
Simplify by using float-time.
* lisp/completion.el (save-completions-to-file):
* lisp/url/url-cache.el (url-cache-prune-cache):
Rename local var to avoid confusion.
* lisp/gnus/gnus-util.el (gnus-float-time):
* lisp/net/rcirc.el (rcirc-float-time):
* lisp/org/org-compat.el (org-float-time):
Simplify to an alias because time-to-seconds now behaves like float-time
with respect to nil arg.
* lisp/subr.el (progress-reporter-do-update):
Don't call float-time unless needed.
* lisp/erc/erc.el (erc-current-time): Simplify by using erc-emacs-time-to-erc-time.
* lisp/org/org-clock.el (org-clock-get-table-data): Omit unnecessary, lossy
conversion from floating point to Emacs time and back.
(org-resolve-clocks): Prefer two-argument floor.
2014-10-29 01:42:51 +00:00
|
|
|
(if (= (nth 5 (decode-time))
|
2002-08-10 00:20:09 +00:00
|
|
|
(nth 5 (decode-time
|
|
|
|
(nth (cond
|
|
|
|
((eq sort-method 'by-atime) 4)
|
|
|
|
((eq sort-method 'by-ctime) 6)
|
|
|
|
(t 5)) attrs))))
|
|
|
|
"%H:%M"
|
|
|
|
" %Y")) (nth (cond
|
|
|
|
((eq sort-method 'by-atime) 4)
|
|
|
|
((eq sort-method 'by-ctime) 6)
|
|
|
|
(t 5)) attrs)) " ")))
|
2000-06-23 05:24:10 +00:00
|
|
|
(funcall insert-func line file "\n"))))))
|
|
|
|
|
|
|
|
(defun eshell-ls-dir (dirinfo &optional insert-name root-dir size-width)
|
|
|
|
"Output the entries in DIRINFO.
|
|
|
|
If INSERT-NAME is non-nil, the name of DIRINFO will be output. If
|
|
|
|
ROOT-DIR is also non-nil, and a directory name, DIRINFO will be output
|
|
|
|
relative to that directory."
|
|
|
|
(let ((dir (car dirinfo)))
|
|
|
|
(if (not (cdr dirinfo))
|
|
|
|
(funcall error-func (format "%s: No such file or directory\n" dir))
|
|
|
|
(if dir-literal
|
|
|
|
(eshell-ls-file dirinfo size-width)
|
|
|
|
(if insert-name
|
|
|
|
(funcall insert-func
|
|
|
|
(eshell-ls-decorated-name
|
|
|
|
(cons (concat
|
|
|
|
(if root-dir
|
|
|
|
(file-relative-name dir root-dir)
|
|
|
|
(expand-file-name dir)))
|
|
|
|
(cdr dirinfo))) ":\n"))
|
2000-10-29 05:18:48 +00:00
|
|
|
(let ((entries (eshell-directory-files-and-attributes
|
2013-05-23 04:48:40 +00:00
|
|
|
dir nil (and (not (or show-all show-almost-all))
|
2002-08-10 00:20:09 +00:00
|
|
|
eshell-ls-exclude-hidden
|
2009-03-21 14:03:06 +00:00
|
|
|
"\\`[^.]") t
|
|
|
|
;; Asking for UID and GID as
|
|
|
|
;; strings saves another syscall
|
|
|
|
;; later when we are going to
|
|
|
|
;; display user and group names.
|
|
|
|
(if numeric-uid-gid 'integer 'string))))
|
2013-02-08 15:07:03 +00:00
|
|
|
(when (and show-almost-all
|
|
|
|
(not show-all))
|
|
|
|
(setq entries
|
2013-02-08 15:47:07 +00:00
|
|
|
(cl-remove-if
|
2013-02-08 15:07:03 +00:00
|
|
|
(lambda (entry)
|
2013-05-23 04:48:40 +00:00
|
|
|
(member (car entry) '("." "..")))
|
2013-02-08 15:07:03 +00:00
|
|
|
entries)))
|
2013-05-23 04:48:40 +00:00
|
|
|
(when (and (not (or show-all show-almost-all))
|
2013-02-08 15:07:03 +00:00
|
|
|
eshell-ls-exclude-regexp)
|
2000-10-29 05:18:48 +00:00
|
|
|
(while (and entries (string-match eshell-ls-exclude-regexp
|
|
|
|
(caar entries)))
|
2000-06-23 05:24:10 +00:00
|
|
|
(setq entries (cdr entries)))
|
|
|
|
(let ((e entries))
|
|
|
|
(while (cdr e)
|
|
|
|
(if (string-match eshell-ls-exclude-regexp (car (cadr e)))
|
|
|
|
(setcdr e (cddr e))
|
|
|
|
(setq e (cdr e))))))
|
|
|
|
(when (or (eq listing-style 'long-listing) show-size)
|
|
|
|
(let ((total 0.0))
|
|
|
|
(setq size-width 0)
|
Make eshell-for obsolete (replaced by dolist)
* eshell/esh-util.el (eshell-for): Make it obsolete.
* eshell/em-alias.el (eshell/alias, eshell-alias-completions):
* eshell/em-dirs.el (eshell-save-some-last-dir):
* eshell/em-hist.el (eshell-save-some-history, eshell-hist-parse-modifier):
* eshell/em-ls.el (eshell-ls-dir, eshell-ls-files, eshell-ls-entries):
* eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
* eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval, eshell/which):
* eshell/esh-ext.el (eshell-find-interpreter):
* eshell/esh-mode.el (eshell-mode):
* eshell/esh-module.el (eshell-unload-extension-modules):
* eshell/esh-proc.el (eshell-process-interact):
* eshell/esh-test.el (eshell-test):
* eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
* eshell/esh-var.el (eshell/env, eshell-environment-variables)
(eshell-variables-list):
* eshell/eshell.el (eshell-unload-all-modules):
Replace eshell-for with dolist.
2011-03-05 03:53:41 +00:00
|
|
|
(dolist (e entries)
|
2000-06-23 05:24:10 +00:00
|
|
|
(if (nth 7 (cdr e))
|
|
|
|
(setq total (+ total (nth 7 (cdr e)))
|
|
|
|
size-width
|
|
|
|
(max size-width
|
|
|
|
(length (eshell-ls-printable-size
|
2009-03-21 13:01:20 +00:00
|
|
|
(nth 7 (cdr e))
|
|
|
|
(not
|
|
|
|
;; If we are under -l, count length
|
|
|
|
;; of sizes in bytes, not in blocks.
|
|
|
|
(eq listing-style 'long-listing))))))))
|
2000-06-23 05:24:10 +00:00
|
|
|
(funcall insert-func "total "
|
|
|
|
(eshell-ls-printable-size total t) "\n")))
|
|
|
|
(let ((default-directory (expand-file-name dir)))
|
|
|
|
(if show-recursive
|
|
|
|
(eshell-ls-entries
|
|
|
|
(let ((e entries) (good-entries (list t)))
|
|
|
|
(while e
|
|
|
|
(unless (let ((len (length (caar e))))
|
|
|
|
(and (eq (aref (caar e) 0) ?.)
|
|
|
|
(or (= len 1)
|
|
|
|
(and (= len 2)
|
|
|
|
(eq (aref (caar e) 1) ?.)))))
|
|
|
|
(nconc good-entries (list (car e))))
|
|
|
|
(setq e (cdr e)))
|
|
|
|
(cdr good-entries))
|
|
|
|
nil root-dir)
|
|
|
|
(eshell-ls-files (eshell-ls-sort-entries entries)
|
|
|
|
size-width))))))))
|
|
|
|
|
|
|
|
(defsubst eshell-ls-compare-entries (l r inx func)
|
|
|
|
"Compare the time of two files, L and R, the attribute indexed by INX."
|
|
|
|
(let ((lt (nth inx (cdr l)))
|
|
|
|
(rt (nth inx (cdr r))))
|
|
|
|
(if (equal lt rt)
|
|
|
|
(string-lessp (directory-file-name (car l))
|
|
|
|
(directory-file-name (car r)))
|
|
|
|
(funcall func rt lt))))
|
|
|
|
|
|
|
|
(defun eshell-ls-sort-entries (entries)
|
|
|
|
"Sort the given ENTRIES, which may be files, directories or both.
|
|
|
|
In Eshell's implementation of ls, ENTRIES is always reversed."
|
|
|
|
(if (eq sort-method 'unsorted)
|
|
|
|
(nreverse entries)
|
|
|
|
(sort entries
|
|
|
|
(function
|
|
|
|
(lambda (l r)
|
|
|
|
(let ((result
|
|
|
|
(cond
|
|
|
|
((eq sort-method 'by-atime)
|
2010-11-10 03:57:32 +00:00
|
|
|
(eshell-ls-compare-entries l r 4 'time-less-p))
|
2000-06-23 05:24:10 +00:00
|
|
|
((eq sort-method 'by-mtime)
|
2010-11-10 03:57:32 +00:00
|
|
|
(eshell-ls-compare-entries l r 5 'time-less-p))
|
2000-06-23 05:24:10 +00:00
|
|
|
((eq sort-method 'by-ctime)
|
2010-11-10 03:57:32 +00:00
|
|
|
(eshell-ls-compare-entries l r 6 'time-less-p))
|
2002-08-10 00:20:09 +00:00
|
|
|
((eq sort-method 'by-size)
|
|
|
|
(eshell-ls-compare-entries l r 7 '<))
|
2000-06-23 05:24:10 +00:00
|
|
|
((eq sort-method 'by-extension)
|
|
|
|
(let ((lx (file-name-extension
|
|
|
|
(directory-file-name (car l))))
|
|
|
|
(rx (file-name-extension
|
|
|
|
(directory-file-name (car r)))))
|
|
|
|
(cond
|
|
|
|
((or (and (not lx) (not rx))
|
|
|
|
(equal lx rx))
|
|
|
|
(string-lessp (directory-file-name (car l))
|
|
|
|
(directory-file-name (car r))))
|
|
|
|
((not lx) t)
|
|
|
|
((not rx) nil)
|
|
|
|
(t
|
|
|
|
(string-lessp lx rx)))))
|
2002-08-10 00:18:18 +00:00
|
|
|
(t
|
2002-08-10 00:20:09 +00:00
|
|
|
(string-lessp (directory-file-name (car l))
|
|
|
|
(directory-file-name (car r)))))))
|
2000-06-23 05:24:10 +00:00
|
|
|
(if reverse-list
|
|
|
|
(not result)
|
|
|
|
result)))))))
|
|
|
|
|
|
|
|
(defun eshell-ls-files (files &optional size-width copy-fileinfo)
|
|
|
|
"Output a list of FILES.
|
|
|
|
Each member of FILES is either a string or a cons cell of the form
|
|
|
|
\(FILE . ATTRS)."
|
2008-08-15 06:55:43 +00:00
|
|
|
;; Mimic behavior of coreutils ls, which lists a single file per
|
|
|
|
;; line when output is not a tty. Exceptions: if -x was supplied,
|
|
|
|
;; or if we are the _last_ command in a pipeline.
|
|
|
|
;; FIXME Not really the same since not testing output destination.
|
|
|
|
(if (or (and eshell-in-pipeline-p
|
|
|
|
(not (eq eshell-in-pipeline-p 'last))
|
|
|
|
(not (eq listing-style 'by-lines)))
|
|
|
|
(memq listing-style '(long-listing single-column)))
|
Make eshell-for obsolete (replaced by dolist)
* eshell/esh-util.el (eshell-for): Make it obsolete.
* eshell/em-alias.el (eshell/alias, eshell-alias-completions):
* eshell/em-dirs.el (eshell-save-some-last-dir):
* eshell/em-hist.el (eshell-save-some-history, eshell-hist-parse-modifier):
* eshell/em-ls.el (eshell-ls-dir, eshell-ls-files, eshell-ls-entries):
* eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
* eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval, eshell/which):
* eshell/esh-ext.el (eshell-find-interpreter):
* eshell/esh-mode.el (eshell-mode):
* eshell/esh-module.el (eshell-unload-extension-modules):
* eshell/esh-proc.el (eshell-process-interact):
* eshell/esh-test.el (eshell-test):
* eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
* eshell/esh-var.el (eshell/env, eshell-environment-variables)
(eshell-variables-list):
* eshell/eshell.el (eshell-unload-all-modules):
Replace eshell-for with dolist.
2011-03-05 03:53:41 +00:00
|
|
|
(dolist (file files)
|
2000-06-23 05:24:10 +00:00
|
|
|
(if file
|
|
|
|
(eshell-ls-file file size-width copy-fileinfo)))
|
|
|
|
(let ((f files)
|
|
|
|
last-f
|
|
|
|
display-files
|
|
|
|
ignore)
|
|
|
|
(while f
|
|
|
|
(if (cdar f)
|
|
|
|
(setq last-f f
|
|
|
|
f (cdr f))
|
|
|
|
(unless ignore
|
|
|
|
(funcall error-func
|
|
|
|
(format "%s: No such file or directory\n" (caar f))))
|
|
|
|
(if (eq f files)
|
|
|
|
(setq files (cdr files)
|
|
|
|
f files)
|
|
|
|
(if (not (cdr f))
|
|
|
|
(progn
|
|
|
|
(setcdr last-f nil)
|
|
|
|
(setq f nil))
|
|
|
|
(setcar f (cadr f))
|
|
|
|
(setcdr f (cddr f))))))
|
|
|
|
(if (not show-size)
|
|
|
|
(setq display-files (mapcar 'eshell-ls-annotate files))
|
Make eshell-for obsolete (replaced by dolist)
* eshell/esh-util.el (eshell-for): Make it obsolete.
* eshell/em-alias.el (eshell/alias, eshell-alias-completions):
* eshell/em-dirs.el (eshell-save-some-last-dir):
* eshell/em-hist.el (eshell-save-some-history, eshell-hist-parse-modifier):
* eshell/em-ls.el (eshell-ls-dir, eshell-ls-files, eshell-ls-entries):
* eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
* eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval, eshell/which):
* eshell/esh-ext.el (eshell-find-interpreter):
* eshell/esh-mode.el (eshell-mode):
* eshell/esh-module.el (eshell-unload-extension-modules):
* eshell/esh-proc.el (eshell-process-interact):
* eshell/esh-test.el (eshell-test):
* eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
* eshell/esh-var.el (eshell/env, eshell-environment-variables)
(eshell-variables-list):
* eshell/eshell.el (eshell-unload-all-modules):
Replace eshell-for with dolist.
2011-03-05 03:53:41 +00:00
|
|
|
(dolist (file files)
|
2000-06-23 05:24:10 +00:00
|
|
|
(let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t))
|
|
|
|
(len (length str)))
|
|
|
|
(if (< len size-width)
|
|
|
|
(setq str (concat (make-string (- size-width len) ? ) str)))
|
|
|
|
(setq file (eshell-ls-annotate file)
|
|
|
|
display-files (cons (cons (concat str " " (car file))
|
|
|
|
(cdr file))
|
|
|
|
display-files))))
|
|
|
|
(setq display-files (nreverse display-files)))
|
|
|
|
(let* ((col-vals
|
|
|
|
(if (eq listing-style 'by-columns)
|
|
|
|
(eshell-ls-find-column-lengths display-files)
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 23:13:41 +00:00
|
|
|
(cl-assert (eq listing-style 'by-lines))
|
2000-06-23 05:24:10 +00:00
|
|
|
(eshell-ls-find-column-widths display-files)))
|
|
|
|
(col-widths (car col-vals))
|
|
|
|
(display-files (cdr col-vals))
|
|
|
|
(columns (length col-widths))
|
|
|
|
(col-index 1)
|
|
|
|
need-return)
|
Make eshell-for obsolete (replaced by dolist)
* eshell/esh-util.el (eshell-for): Make it obsolete.
* eshell/em-alias.el (eshell/alias, eshell-alias-completions):
* eshell/em-dirs.el (eshell-save-some-last-dir):
* eshell/em-hist.el (eshell-save-some-history, eshell-hist-parse-modifier):
* eshell/em-ls.el (eshell-ls-dir, eshell-ls-files, eshell-ls-entries):
* eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
* eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval, eshell/which):
* eshell/esh-ext.el (eshell-find-interpreter):
* eshell/esh-mode.el (eshell-mode):
* eshell/esh-module.el (eshell-unload-extension-modules):
* eshell/esh-proc.el (eshell-process-interact):
* eshell/esh-test.el (eshell-test):
* eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
* eshell/esh-var.el (eshell/env, eshell-environment-variables)
(eshell-variables-list):
* eshell/eshell.el (eshell-unload-all-modules):
Replace eshell-for with dolist.
2011-03-05 03:53:41 +00:00
|
|
|
(dolist (file display-files)
|
2000-06-23 05:24:10 +00:00
|
|
|
(let ((name
|
|
|
|
(if (car file)
|
|
|
|
(if show-size
|
|
|
|
(concat (substring (car file) 0 size-width)
|
|
|
|
(eshell-ls-decorated-name
|
|
|
|
(cons (substring (car file) size-width)
|
|
|
|
(cdr file))))
|
|
|
|
(eshell-ls-decorated-name file))
|
|
|
|
"")))
|
|
|
|
(if (< col-index columns)
|
|
|
|
(setq need-return
|
|
|
|
(concat need-return name
|
|
|
|
(make-string
|
|
|
|
(max 0 (- (aref col-widths
|
|
|
|
(1- col-index))
|
|
|
|
(length name))) ? ))
|
|
|
|
col-index (1+ col-index))
|
|
|
|
(funcall insert-func need-return name "\n")
|
|
|
|
(setq col-index 1 need-return nil))))
|
|
|
|
(if need-return
|
|
|
|
(funcall insert-func need-return "\n"))))))
|
|
|
|
|
|
|
|
(defun eshell-ls-entries (entries &optional separate root-dir)
|
2010-02-07 06:23:10 +00:00
|
|
|
"Output PATH's directory ENTRIES.
|
2000-06-23 05:24:10 +00:00
|
|
|
Each member of ENTRIES may either be a string or a cons cell, the car
|
|
|
|
of which is the file name, and the cdr of which is the list of
|
|
|
|
attributes.
|
|
|
|
If SEPARATE is non-nil, directories name will be entirely separated
|
|
|
|
from the filenames. This is the normal behavior, except when doing a
|
|
|
|
recursive listing.
|
|
|
|
ROOT-DIR, if non-nil, specifies the root directory of the listing, to
|
|
|
|
which non-absolute directory names will be made relative if ever they
|
|
|
|
need to be printed."
|
|
|
|
(let (dirs files show-names need-return (size-width 0))
|
Make eshell-for obsolete (replaced by dolist)
* eshell/esh-util.el (eshell-for): Make it obsolete.
* eshell/em-alias.el (eshell/alias, eshell-alias-completions):
* eshell/em-dirs.el (eshell-save-some-last-dir):
* eshell/em-hist.el (eshell-save-some-history, eshell-hist-parse-modifier):
* eshell/em-ls.el (eshell-ls-dir, eshell-ls-files, eshell-ls-entries):
* eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
* eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval, eshell/which):
* eshell/esh-ext.el (eshell-find-interpreter):
* eshell/esh-mode.el (eshell-mode):
* eshell/esh-module.el (eshell-unload-extension-modules):
* eshell/esh-proc.el (eshell-process-interact):
* eshell/esh-test.el (eshell-test):
* eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
* eshell/esh-var.el (eshell/env, eshell-environment-variables)
(eshell-variables-list):
* eshell/eshell.el (eshell-unload-all-modules):
Replace eshell-for with dolist.
2011-03-05 03:53:41 +00:00
|
|
|
(dolist (entry entries)
|
2000-06-23 05:24:10 +00:00
|
|
|
(if (and (not dir-literal)
|
|
|
|
(or (eshell-ls-filetype-p (cdr entry) ?d)
|
|
|
|
(and (eshell-ls-filetype-p (cdr entry) ?l)
|
|
|
|
(file-directory-p (car entry)))))
|
|
|
|
(progn
|
|
|
|
(unless separate
|
|
|
|
(setq files (cons entry files)
|
|
|
|
size-width
|
|
|
|
(if show-size
|
|
|
|
(max size-width
|
|
|
|
(length (eshell-ls-printable-size
|
|
|
|
(nth 7 (cdr entry)) t))))))
|
|
|
|
(setq dirs (cons entry dirs)))
|
|
|
|
(setq files (cons entry files)
|
|
|
|
size-width
|
|
|
|
(if show-size
|
|
|
|
(max size-width
|
|
|
|
(length (eshell-ls-printable-size
|
|
|
|
(nth 7 (cdr entry)) t)))))))
|
|
|
|
(when files
|
|
|
|
(eshell-ls-files (eshell-ls-sort-entries files)
|
|
|
|
size-width show-recursive)
|
|
|
|
(setq need-return t))
|
|
|
|
(setq show-names (or show-recursive
|
|
|
|
(> (+ (length files) (length dirs)) 1)))
|
Make eshell-for obsolete (replaced by dolist)
* eshell/esh-util.el (eshell-for): Make it obsolete.
* eshell/em-alias.el (eshell/alias, eshell-alias-completions):
* eshell/em-dirs.el (eshell-save-some-last-dir):
* eshell/em-hist.el (eshell-save-some-history, eshell-hist-parse-modifier):
* eshell/em-ls.el (eshell-ls-dir, eshell-ls-files, eshell-ls-entries):
* eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
* eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval, eshell/which):
* eshell/esh-ext.el (eshell-find-interpreter):
* eshell/esh-mode.el (eshell-mode):
* eshell/esh-module.el (eshell-unload-extension-modules):
* eshell/esh-proc.el (eshell-process-interact):
* eshell/esh-test.el (eshell-test):
* eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
* eshell/esh-var.el (eshell/env, eshell-environment-variables)
(eshell-variables-list):
* eshell/eshell.el (eshell-unload-all-modules):
Replace eshell-for with dolist.
2011-03-05 03:53:41 +00:00
|
|
|
(dolist (dir (eshell-ls-sort-entries dirs))
|
2000-06-23 05:24:10 +00:00
|
|
|
(if (and need-return (not dir-literal))
|
|
|
|
(funcall insert-func "\n"))
|
|
|
|
(eshell-ls-dir dir show-names
|
2000-10-29 05:18:48 +00:00
|
|
|
(unless (file-name-absolute-p (car dir)) root-dir)
|
|
|
|
size-width)
|
2000-06-23 05:24:10 +00:00
|
|
|
(setq need-return t))))
|
|
|
|
|
|
|
|
(defun eshell-ls-find-column-widths (files)
|
|
|
|
"Find the best fitting column widths for FILES.
|
|
|
|
It will be returned as a vector, whose length is the number of columns
|
|
|
|
to use, and each member of which is the width of that column
|
|
|
|
\(including spacing)."
|
|
|
|
(let* ((numcols 0)
|
|
|
|
(width 0)
|
|
|
|
(widths
|
|
|
|
(mapcar
|
|
|
|
(function
|
|
|
|
(lambda (file)
|
|
|
|
(+ 2 (length (car file)))))
|
|
|
|
files))
|
|
|
|
;; must account for the added space...
|
|
|
|
(max-width (+ (window-width) 2))
|
|
|
|
(best-width 0)
|
|
|
|
col-widths)
|
|
|
|
|
|
|
|
;; determine the largest number of columns in the first row
|
|
|
|
(let ((w widths))
|
|
|
|
(while (and w (< width max-width))
|
|
|
|
(setq width (+ width (car w))
|
|
|
|
numcols (1+ numcols)
|
|
|
|
w (cdr w))))
|
|
|
|
|
|
|
|
;; refine it based on the following rows
|
|
|
|
(while (> numcols 0)
|
|
|
|
(let ((i 0)
|
|
|
|
(colw (make-vector numcols 0))
|
|
|
|
(w widths))
|
|
|
|
(while w
|
|
|
|
(if (= i numcols)
|
|
|
|
(setq i 0))
|
|
|
|
(aset colw i (max (aref colw i) (car w)))
|
|
|
|
(setq w (cdr w) i (1+ i)))
|
|
|
|
(setq i 0 width 0)
|
|
|
|
(while (< i numcols)
|
|
|
|
(setq width (+ width (aref colw i))
|
|
|
|
i (1+ i)))
|
|
|
|
(if (and (< width max-width)
|
|
|
|
(> width best-width))
|
|
|
|
(setq col-widths colw
|
|
|
|
best-width width)))
|
|
|
|
(setq numcols (1- numcols)))
|
|
|
|
|
|
|
|
(cons (or col-widths (vector max-width)) files)))
|
|
|
|
|
|
|
|
(defun eshell-ls-find-column-lengths (files)
|
|
|
|
"Find the best fitting column lengths for FILES.
|
|
|
|
It will be returned as a vector, whose length is the number of columns
|
|
|
|
to use, and each member of which is the width of that column
|
|
|
|
\(including spacing)."
|
|
|
|
(let* ((numcols 1)
|
|
|
|
(width 0)
|
|
|
|
(widths
|
|
|
|
(mapcar
|
|
|
|
(function
|
|
|
|
(lambda (file)
|
|
|
|
(+ 2 (length (car file)))))
|
|
|
|
files))
|
|
|
|
(max-width (+ (window-width) 2))
|
|
|
|
col-widths
|
|
|
|
colw)
|
|
|
|
|
|
|
|
;; refine it based on the following rows
|
|
|
|
(while numcols
|
|
|
|
(let* ((rows (ceiling (/ (length widths)
|
|
|
|
(float numcols))))
|
|
|
|
(w widths)
|
|
|
|
(len (* rows numcols))
|
|
|
|
(index 0)
|
|
|
|
(i 0))
|
|
|
|
(setq width 0)
|
|
|
|
(unless (or (= rows 0)
|
|
|
|
(<= (/ (length widths) (float rows))
|
|
|
|
(float (1- numcols))))
|
|
|
|
(setq colw (make-vector numcols 0))
|
|
|
|
(while (> len 0)
|
|
|
|
(if (= i numcols)
|
|
|
|
(setq i 0 index (1+ index)))
|
|
|
|
(aset colw i
|
|
|
|
(max (aref colw i)
|
|
|
|
(or (nth (+ (* i rows) index) w) 0)))
|
|
|
|
(setq len (1- len) i (1+ i)))
|
|
|
|
(setq i 0)
|
|
|
|
(while (< i numcols)
|
|
|
|
(setq width (+ width (aref colw i))
|
|
|
|
i (1+ i))))
|
|
|
|
(if (>= width max-width)
|
|
|
|
(setq numcols nil)
|
|
|
|
(if colw
|
|
|
|
(setq col-widths colw))
|
|
|
|
(if (>= numcols (length widths))
|
|
|
|
(setq numcols nil)
|
|
|
|
(setq numcols (1+ numcols))))))
|
|
|
|
|
|
|
|
(if (not col-widths)
|
|
|
|
(cons (vector max-width) files)
|
|
|
|
(setq numcols (length col-widths))
|
|
|
|
(let* ((rows (ceiling (/ (length widths)
|
|
|
|
(float numcols))))
|
|
|
|
(len (* rows numcols))
|
|
|
|
(newfiles (make-list len nil))
|
|
|
|
(index 0)
|
|
|
|
(i 0)
|
|
|
|
(j 0))
|
|
|
|
(while (< j len)
|
|
|
|
(if (= i numcols)
|
|
|
|
(setq i 0 index (1+ index)))
|
|
|
|
(setcar (nthcdr j newfiles)
|
|
|
|
(nth (+ (* i rows) index) files))
|
|
|
|
(setq j (1+ j) i (1+ i)))
|
|
|
|
(cons col-widths newfiles)))))
|
|
|
|
|
|
|
|
(defun eshell-ls-decorated-name (file)
|
2005-07-21 10:03:50 +00:00
|
|
|
"Return FILE, possibly decorated."
|
2002-08-10 00:20:09 +00:00
|
|
|
(if eshell-ls-use-colors
|
|
|
|
(let ((face
|
|
|
|
(cond
|
|
|
|
((not (cdr file))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-missing)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((stringp (cadr file))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-symlink)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((eq (cadr file) t)
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-directory)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((not (eshell-ls-filetype-p (cdr file) ?-))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-special)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((and (/= (user-uid) 0) ; root can execute anything
|
|
|
|
(eshell-ls-applicable (cdr file) 3
|
|
|
|
'file-executable-p (car file)))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-executable)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((not (eshell-ls-applicable (cdr file) 1
|
|
|
|
'file-readable-p (car file)))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-unreadable)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((string-match eshell-ls-archive-regexp (car file))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-archive)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((string-match eshell-ls-backup-regexp (car file))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-backup)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((string-match eshell-ls-product-regexp (car file))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-product)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((string-match eshell-ls-clutter-regexp (car file))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-clutter)
|
2002-08-10 00:20:09 +00:00
|
|
|
|
|
|
|
((not (eshell-ls-applicable (cdr file) 2
|
|
|
|
'file-writable-p (car file)))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431
Remove "-face" suffix from eshell faces
2005-06-17 Miles Bader <miles@gnu.org>
* lisp/eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
Remove "-face" suffix from face names.
(eshell-test-ok-face, eshell-test-failed-face):
New backward-compatibility aliases for renamed faces.
(eshell-run-test): Use renamed eshell-test faces.
* lisp/eshell/em-prompt.el (eshell-prompt):
Remove "-face" suffix from face name.
(eshell-prompt-face): New backward-compatibility alias for renamed face.
(eshell-emit-prompt): Use renamed eshell-prompt face.
* lisp/eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
(eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
(eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
(eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
Remove "-face" suffix from face names.
(eshell-ls-directory-face, eshell-ls-symlink-face)
(eshell-ls-executable-face, eshell-ls-readonly-face)
(eshell-ls-unreadable-face, eshell-ls-special-face)
(eshell-ls-missing-face, eshell-ls-archive-face)
(eshell-ls-backup-face, eshell-ls-product-face)
(eshell-ls-clutter-face):
New backward-compatibility aliases for renamed faces.
(eshell-ls-decorated-name): Use renamed eshell-ls faces.
2005-06-17 05:27:55 +00:00
|
|
|
'eshell-ls-readonly)
|
2002-08-10 00:20:09 +00:00
|
|
|
(eshell-ls-highlight-alist
|
|
|
|
(let ((tests eshell-ls-highlight-alist)
|
|
|
|
value)
|
|
|
|
(while tests
|
|
|
|
(if (funcall (caar tests) (car file) (cdr file))
|
|
|
|
(setq value (cdar tests) tests nil)
|
|
|
|
(setq tests (cdr tests))))
|
|
|
|
value)))))
|
|
|
|
(if face
|
|
|
|
(add-text-properties 0 (length (car file))
|
2013-12-17 15:15:00 +00:00
|
|
|
(list 'font-lock-face face)
|
2002-08-10 00:20:09 +00:00
|
|
|
(car file)))))
|
|
|
|
(car file))
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2007-12-05 07:03:18 +00:00
|
|
|
(provide 'em-ls)
|
2000-06-23 05:24:10 +00:00
|
|
|
|
2008-05-21 03:51:08 +00:00
|
|
|
;; Local Variables:
|
|
|
|
;; generated-autoload-file: "esh-groups.el"
|
|
|
|
;; End:
|
|
|
|
|
2000-06-23 05:24:10 +00:00
|
|
|
;;; em-ls.el ends here
|