aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-05-21 03:49:48 +0000
committerGlenn Morris2008-05-21 03:49:48 +0000
commit4184766e50186ef7630c30d5154f190caa720d01 (patch)
tree665912b787141bde298db224aac9f9ffaec7ed1f
parent59f3685985af13a64a7e390c13962f2b074c36eb (diff)
downloademacs-4184766e50186ef7630c30d5154f190caa720d01.tar.gz
emacs-4184766e50186ef7630c30d5154f190caa720d01.zip
No need for cl when compiling.
Require eshell, for eshell-defgroup. (eshell-load-defgroups): Remove. Require esh-groups rather than loading it.
-rw-r--r--lisp/eshell/esh-module.el64
1 files changed, 4 insertions, 60 deletions
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el
index 805f38dda4e..dd5244752c6 100644
--- a/lisp/eshell/esh-module.el
+++ b/lisp/eshell/esh-module.el
@@ -1,7 +1,7 @@
1;;; esh-module.el --- Eshell modules 1;;; esh-module.el --- Eshell modules
2 2
3;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 3;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
4;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 4;; 2008 Free Software Foundation, Inc.
5 5
6;; Author: John Wiegley <johnw@gnu.org> 6;; Author: John Wiegley <johnw@gnu.org>
7;; Keywords: processes 7;; Keywords: processes
@@ -25,10 +25,7 @@
25 25
26(provide 'esh-module) 26(provide 'esh-module)
27 27
28(eval-when-compile 28(require 'eshell)
29 (require 'cl)
30 (require 'esh-util))
31
32(require 'esh-util) 29(require 'esh-util)
33 30
34(defgroup eshell-module nil 31(defgroup eshell-module nil
@@ -38,63 +35,10 @@ customizing the variable `eshell-modules-list'."
38 :tag "Extension modules" 35 :tag "Extension modules"
39 :group 'eshell) 36 :group 'eshell)
40 37
41(eval-and-compile
42(defun eshell-load-defgroups (&optional directory)
43 "Load `defgroup' statements from Eshell's module files."
44 (let ((vc-handled-backends nil)) ; avoid VC fucking things up
45 (with-current-buffer
46 (find-file-noselect (expand-file-name "esh-groups.el" directory))
47 (erase-buffer)
48 (insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n")
49 (let ((files (directory-files (or directory
50 (car command-line-args-left))
51 nil "\\`em-.*\\.el\\'")))
52 (while files
53 (message "Loading defgroup from `%s'" (car files))
54 (let (defgroup)
55 (catch 'handled
56 (with-current-buffer (find-file-noselect (car files))
57 (goto-char (point-min))
58 (while t
59 (forward-sexp)
60 (if (eobp) (throw 'handled t))
61 (backward-sexp)
62 (let ((begin (point))
63 (defg (looking-at "(defgroup")))
64 (forward-sexp)
65 (if defg
66 (setq defgroup (buffer-substring begin (point))))))))
67 (if defgroup
68 (insert defgroup "\n\n")))
69 (setq files (cdr files))))
70 ;; Don't make backups, to avoid prompting the user if there are
71 ;; excess backup versions.
72 (save-buffer 0)))))
73
74;; load the defgroup's for the standard extension modules, so that 38;; load the defgroup's for the standard extension modules, so that
75;; documentation can be provided when the user customize's 39;; documentation can be provided when the user customize's
76;; `eshell-modules-list'. 40;; `eshell-modules-list'.
77(eval-when-compile 41(require 'esh-groups)
78 (when (and (boundp 'byte-compile-current-file)
79 byte-compile-current-file
80 (or
81 (equal (file-name-nondirectory byte-compile-current-file)
82 "esh-module.el")
83 ;; When eshell file names are expanded from a wildcard
84 ;; or by reading the Eshell directory, e.g. when they
85 ;; say "make recompile" in the lisp directory, Emacs on
86 ;; MS-DOS sees a truncated name "esh-modu.el" instead of
87 ;; "esh-module.el".
88 (and (fboundp 'msdos-long-file-names)
89 (null (msdos-long-file-names))
90 (equal (file-name-nondirectory byte-compile-current-file)
91 "esh-modu.el"))))
92 (let* ((directory (file-name-directory byte-compile-current-file))
93 (elc-file (expand-file-name "esh-groups.elc" directory)))
94 (eshell-load-defgroups directory)
95 (if (file-exists-p elc-file) (delete-file elc-file)))))
96
97(load "esh-groups" t t)
98 42
99;;; User Variables: 43;;; User Variables:
100 44