Commit 4184766e authored by Glenn Morris's avatar Glenn Morris
Browse files

No need for cl when compiling.

Require eshell, for eshell-defgroup.
(eshell-load-defgroups): Remove.
Require esh-groups rather than loading it.
parent 59f36859
;;; esh-module.el --- Eshell modules
;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
;; 2008 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
;; Keywords: processes
......@@ -25,10 +25,7 @@
(provide 'esh-module)
(eval-when-compile
(require 'cl)
(require 'esh-util))
(require 'eshell)
(require 'esh-util)
(defgroup eshell-module nil
......@@ -38,63 +35,10 @@ customizing the variable `eshell-modules-list'."
:tag "Extension modules"
:group 'eshell)
(eval-and-compile
(defun eshell-load-defgroups (&optional directory)
"Load `defgroup' statements from Eshell's module files."
(let ((vc-handled-backends nil)) ; avoid VC fucking things up
(with-current-buffer
(find-file-noselect (expand-file-name "esh-groups.el" directory))
(erase-buffer)
(insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n")
(let ((files (directory-files (or directory
(car command-line-args-left))
nil "\\`em-.*\\.el\\'")))
(while files
(message "Loading defgroup from `%s'" (car files))
(let (defgroup)
(catch 'handled
(with-current-buffer (find-file-noselect (car files))
(goto-char (point-min))
(while t
(forward-sexp)
(if (eobp) (throw 'handled t))
(backward-sexp)
(let ((begin (point))
(defg (looking-at "(defgroup")))
(forward-sexp)
(if defg
(setq defgroup (buffer-substring begin (point))))))))
(if defgroup
(insert defgroup "\n\n")))
(setq files (cdr files))))
;; Don't make backups, to avoid prompting the user if there are
;; excess backup versions.
(save-buffer 0)))))
;; load the defgroup's for the standard extension modules, so that
;; documentation can be provided when the user customize's
;; `eshell-modules-list'.
(eval-when-compile
(when (and (boundp 'byte-compile-current-file)
byte-compile-current-file
(or
(equal (file-name-nondirectory byte-compile-current-file)
"esh-module.el")
;; When eshell file names are expanded from a wildcard
;; or by reading the Eshell directory, e.g. when they
;; say "make recompile" in the lisp directory, Emacs on
;; MS-DOS sees a truncated name "esh-modu.el" instead of
;; "esh-module.el".
(and (fboundp 'msdos-long-file-names)
(null (msdos-long-file-names))
(equal (file-name-nondirectory byte-compile-current-file)
"esh-modu.el"))))
(let* ((directory (file-name-directory byte-compile-current-file))
(elc-file (expand-file-name "esh-groups.elc" directory)))
(eshell-load-defgroups directory)
(if (file-exists-p elc-file) (delete-file elc-file)))))
(load "esh-groups" t t)
(require 'esh-groups)
;;; User Variables:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment