aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell/esh-module.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/eshell/esh-module.el')
-rw-r--r--lisp/eshell/esh-module.el53
1 files changed, 27 insertions, 26 deletions
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el
index 4c8ffceef78..dcbf77364f4 100644
--- a/lisp/eshell/esh-module.el
+++ b/lisp/eshell/esh-module.el
@@ -1,6 +1,6 @@
1;;; esh-module.el --- Eshell modules 1;;; esh-module.el --- Eshell modules
2 2
3;; Copyright (C) 1999, 2000 Free Software Foundation 3;; Copyright (C) 1999, 2000, 2004 Free Software Foundation
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Keywords: processes 6;; Keywords: processes
@@ -41,32 +41,33 @@ customizing the variable `eshell-modules-list'."
41 41
42(defun eshell-load-defgroups (&optional directory) 42(defun eshell-load-defgroups (&optional directory)
43 "Load `defgroup' statements from Eshell's module files." 43 "Load `defgroup' statements from Eshell's module files."
44 (with-current-buffer 44 (let ((vc-handled-backends nil)) ; avoid VC fucking things up
45 (find-file-noselect (expand-file-name "esh-groups.el" directory)) 45 (with-current-buffer
46 (erase-buffer) 46 (find-file-noselect (expand-file-name "esh-groups.el" directory))
47 (insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n") 47 (erase-buffer)
48 (let ((files (directory-files (or directory 48 (insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n")
49 (car command-line-args-left)) 49 (let ((files (directory-files (or directory
50 nil "\\`em-.*\\.el\\'"))) 50 (car command-line-args-left))
51 (while files 51 nil "\\`em-.*\\.el\\'")))
52 (message "Loading defgroup from `%s'" (car files)) 52 (while files
53 (let (defgroup) 53 (message "Loading defgroup from `%s'" (car files))
54 (catch 'handled 54 (let (defgroup)
55 (with-current-buffer (find-file-noselect (car files)) 55 (catch 'handled
56 (goto-char (point-min)) 56 (with-current-buffer (find-file-noselect (car files))
57 (while t 57 (goto-char (point-min))
58 (forward-sexp) 58 (while t
59 (if (eobp) (throw 'handled t))
60 (backward-sexp)
61 (let ((begin (point))
62 (defg (looking-at "(defgroup")))
63 (forward-sexp) 59 (forward-sexp)
64 (if defg 60 (if (eobp) (throw 'handled t))
65 (setq defgroup (buffer-substring begin (point)))))))) 61 (backward-sexp)
66 (if defgroup 62 (let ((begin (point))
67 (insert defgroup "\n\n"))) 63 (defg (looking-at "(defgroup")))
68 (setq files (cdr files)))) 64 (forward-sexp)
69 (save-buffer))) 65 (if defg
66 (setq defgroup (buffer-substring begin (point))))))))
67 (if defgroup
68 (insert defgroup "\n\n")))
69 (setq files (cdr files))))
70 (save-buffer))))
70 71
71;; load the defgroup's for the standard extension modules, so that 72;; load the defgroup's for the standard extension modules, so that
72;; documentation can be provided when the user customize's 73;; documentation can be provided when the user customize's