blob: ba5810c542c0e8d144fd46937fdff86639b56dd9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
--- gentoo-syntax-1.6.el.orig 2007-06-23 08:51:26.000000000 +0200
+++ gentoo-syntax.el 2007-06-23 14:29:40.000000000 +0200
@@ -165,12 +380,13 @@
(defun ebuild-mode-tabify ()
;; tabify whitespace only at beginning of lines
(let ((tabify-regexp "^\t* [ \t]+"))
- (tabify (point-min) (point-max))))
+ (tabify (point-min) (point-max))))
+;;;###autoload
(define-derived-mode ebuild-mode shell-script-mode "Ebuild"
"Major mode for Portage .ebuild and .eclass files."
- (add-hook 'write-contents-hooks 'delete-trailing-whitespace t t)
- (add-hook 'write-contents-hooks 'ebuild-mode-tabify t t)
+ ;(add-hook 'write-contents-hooks 'delete-trailing-whitespace t t)
+ ;(add-hook 'write-contents-hooks 'ebuild-mode-tabify t t)
(setq tab-width 4)
(setq indent-tabs-mode t)
;; run user-defined hooks
@@ -209,16 +425,16 @@
(define-derived-mode eselect-mode shell-script-mode "Eselect"
"Major mode for .eselect files."
- (add-hook 'write-contents-hooks 'delete-trailing-whitespace t t)
- (add-hook 'write-contents-hooks 'ebuild-mode-tabify t t)
+ ;(add-hook 'write-contents-hooks 'delete-trailing-whitespace t t)
+ ;(add-hook 'write-contents-hooks 'ebuild-mode-tabify t t)
(setq tab-width 4)
(setq indent-tabs-mode t))
(defvar ebuild-commands-alist
(mapcar 'list
'("help" "setup" "fetch" "digest" "manifest" "unpack" "compile"
- "test" "preinst" "postinst" "install" "qmerge" "merge"
- "prerm" "postrm" "unmerge" "config" "package" "rpm" "clean")))
+ "test" "preinst" "postinst" "install" "qmerge" "merge"
+ "prerm" "postrm" "unmerge" "config" "package" "rpm" "clean")))
(defun ebuild-run-command (command)
"Run ebuild COMMAND, with output to a compilation buffer."
@@ -226,26 +442,29 @@
(list (completing-read
"Run ebuild command: " ebuild-commands-alist nil t)))
(or (assoc command ebuild-commands-alist)
- (error "Ebuild command \"%s\" not known" command))
+ (error "Ebuild command \"%s\" not known" command))
(let ((process-environment
(cons "NOCOLOR=true" process-environment))
;;(compilation-mode-hook
;; (lambda () (setq truncate-lines t)))
(compilation-buffer-name-function
(list 'lambda '(mode) (concat "*ebuild " command "*"))))
- (compile (format "ebuild %s %s" buffer-file-name command))))
+ (compile (format "ebuild %s %s" buffer-file-name command))))
(define-key ebuild-mode-map "\C-ce" 'ebuild-run-command)
(and (< emacs-major-version 22)
- ;; make TAB key work
- (defadvice sh-must-be-shell-mode
- (around ebuild-mode-sh-must-be-shell-mode activate)
- (or (memq major-mode '(ebuild-mode eselect-mode))
+ ;; make TAB key work
+ (defadvice sh-must-be-shell-mode
+ (around ebuild-mode-sh-must-be-shell-mode activate)
+ (or (memq major-mode '(ebuild-mode eselect-mode))
ad-do-it)))
+;;;###autoload
(add-to-list 'auto-mode-alist '("\\.ebuild\\'" . ebuild-mode))
+;;;###autoload
(add-to-list 'auto-mode-alist '("\\.eclass\\'" . ebuild-mode))
+;;;###autoload
(add-to-list 'auto-mode-alist '("\\.eselect\\'" . eselect-mode))
(add-to-list 'interpreter-mode-alist '("runscript" . sh-mode))
|