Gentoo Archives: gentoo-dev

From: Mikael Hallendal <micke@×××××××××.net>
To: gentoo-dev@××××××××××.org
Subject: Re: [gentoo-dev] Emacs settings for ebuild scripts
Date: Sat, 10 Nov 2001 05:50:42
Message-Id: 1005396613.10442.4.camel@zoidberg
1 tis 2001-11-06 klockan 19.38 skrev Andreas Voegele:
2 > Hi!
3
4 Hi!
5
6 In Emacs21 I get an error when hitting TAB telling me I'm not in
7 shell-script-mode. You know what's causing that?
8
9 Regards,
10 Mikael Hallendal
11
12 > Ebuild writers may add the following Emacs Lisp code to their .emacs
13 > file. The code adds an ebuild mode which is based on the shell mode
14 > and sets the tabwidth to 4.
15 >
16 > (define-derived-mode ebuild-script-mode
17 > sh-mode "Ebuild-script"
18 > "Major mode for editing ebuild scripts.
19 > \\{ebuild-mode-map}"
20 > (setq tab-width 4))
21 >
22 > (setq auto-mode-alist
23 > (append
24 > '(("\\.ebuild$" . ebuild-script-mode))
25 > auto-mode-alist))
26 >
27 > I've tested this code with GNU Emacs. Can anyone check if the code
28 > works with XEmacs?
29 >
30 > There's a patch for the Gentoo Linux Developers HOWTO attached to this
31 > mail. The patch replaces the text "TODO: add stuff about emacs" with
32 > the above code.
33 >
34 > ----
35 >
36
37 > --- /mnt/gentoo/usr/portage/app-doc/gentoo-web/files/xml/gentoo-howto.xml Fri Oct 19 21:03:36 2001
38 > +++ gentoo-howto.xml Tue Nov 6 19:31:35 2001
39 > @@ -319,7 +319,20 @@
40 > set tabstop=4 shiftwidth=4 noexpandtab
41 > endif
42 > </pre>
43 > -<p>TODO: add stuff about emacs.</p></body>
44 > +<p>If you're using GNU Emacs, you can put the following code into your .emacs file.</p>
45 > +<pre>
46 > +(define-derived-mode ebuild-script-mode
47 > + sh-mode "Ebuild-script"
48 > + "Major mode for editing ebuild scripts.
49 > +\\{ebuild-mode-map}"
50 > + (setq tab-width 4))
51 > +
52 > +(setq auto-mode-alist
53 > + (append
54 > + '(("\\.ebuild$" . ebuild-script-mode))
55 > + auto-mode-alist))
56 > +</pre>
57 > +</body>
58 > </section>
59 >
60 > <section>
61 --
62 Mikael Hallendal http://micke.hallendal.net/
63 Stockholm, Sweden Cell: +46 (0)709 718 918

Replies

Subject Author
[gentoo-dev] Re: Emacs settings for ebuild scripts Andreas Voegele <voegelas@×××××××××××××××××.net>