Typo
[linux_from_scratch_hints.git] / OLD / emacs.txt
blobb4a02911c6fe0f3848c2ffa51407fef514b87432
1 TITLE:          GNU Emacs 2
2 LFS-VERSION:    All
3 AUTHOR:         Andreas Klauer <andykl@epost.de>
5 SYNOPSIS:
6         Downloading and Installing GNU Emacs 2
8 HINT:
11 I.   What it is
12 ---------------
14 All information you need can be found at the GNU Emacs page:
15 http://www.gnu.org/software/emacs/emacs.html
17 There is also a FAQ available:
18 http://www.gnu.org/software/emacs/emacs-faq.text
20 Here is a quote:
21 --------------------------------------------------------------------------------
22 Emacs is the extensible, customizable, self-documenting real-time display
23 editor. If this seems to be a bit of a mouthful, an easier explanation is Emacs
24 is a text editor and more. At its core is an interpreter for Emacs Lisp
25 (``elisp'', for short), a dialect of the Lisp programming language with
26 extensions to support text editing.
28 Some of the features of GNU Emacs include:
29  o Content sensitive major modes for a wide variety of file types, from plain
30    text to source code to HTML files.
31  o Complete online documentation, including a tutorial for new users.
32  o Highly extensible through the Emacs Lisp language.
33  o Support for many languages and their scripts, including all the European
34    ``Latin'' scripts, Russian, Greek, Japanese, Chinese, Korean, Thai,
35    Vietnamese, Lao, Ethiopian, and some Indian scripts. (Sorry, Mayan
36    hieroglyphs are not supported.)
37  o A large number of extensions which add other functionality. The GNU Emacs
38    distribution includes many extensions; many others are available
39    separately -- even a web browser.
40 --------------------------------------------------------------------------------
42 Please note that this hint doesn't cover the extensions, just because there are
43 far too many of them - Emacs is an operating system that comes with an editor
44 included ;o)
46 If you want any extensions, visit the GNU Emacs page.
49 II.  Where to get & What to get
50 -------------------------------
52 You can get all these files on ftp.gnu.org or on one of its mirrors
53 (visit http://www.gnu.org/order/ftp.html for a complete mirror list)
55 Required: emacs-20.7.tar.gz (around 15 Megabytes)
56           ftp://ftp.gnu.org/pub/gnu/emacs/emacs-20.7.tar.gz
58 Note: If there is a newer version available, take the newer version -
59       if this hint does no longer work with a newer version, please send me
60       an E-Mail, so that I can update it: andykl@epost.de
62 Description: This package contains the Emacs editor ;o)
63              It comes with a very good README and INSTALL - File, which should
64              make this hint unneccessary; but the old emacs hint wasn't good
65              enough to help a newbie out.
68 Optional: leim-20.7.tar.gz (around 3.3 Megabytes)              [requires X11]
69           ftp://ftp.gnu.org/pub/gnu/emacs/leim-20.7.tar.gz
71 Note: The package should have the same version number as the emacs package.
73 Description: LEIM stands for Libraries of Emacs Input Methods.
74              This package supports Chinese & Japanese and other input methods.
75              You should read the INSTALL file that comes with the emacs package
76              and the README that is included in this package if you are
77              interested in it.
80 Optional: intlfonts-1.2.tar.gz (around 25 Megabytes)           [requires X11]
82 Note: This package can be installed after the installation of Emacs.
84 Description: It contains a whole bunch of X11 fonts - Chinese, Japanese, but
85              also European (Greek etc.) and other fonts.
86              Get it if you plan to use Emacs in X11 and want support for those
87              languages. Otherwise, Emacs will print hollow boxes if there is
88              a font missing.
91 III. How to install it
92 ----------------------
94 I unpacked my sources in /usr/src and was root all the time during the
95 installation. You can put the sources somewhere else and don't need to be root
96 when installing, just as you like.
97 But please don't forget: When I'm talking of /usr/src, I mean the directory
98                          where your sources are located.
99                          If you encounter weird problems without being root,
100                          switching to root may help - I don't know exactly
101                          where root privileges are required and where not.
103 1. Unpack the emacs tarball:
105    > cd /usr/src
106    > tar xvfz /usr/src/emacs-20.7.tar.gz
108    This will create a directory /usr/src/emacs-20.7/ and put the emacs sources
109    in it.
111    You probably should read /usr/src/emacs-20.7/README and
112    /usr/src/emacs-20.7/INSTALL now.
115 2. If you decided to download LEIM, unpack it:
117    > cd /usr/src
118    > tar xvfz /usr/src/leim-20.7.tar.gz
120    The LEIM package will create a directory /usr/src/emacs-20.7/leim.
121    It will be automatically included in the Emacs installation.
124 3. Run the Emacs configure script
126    > cd /usr/src/emacs-20.7
128    Please read the configure help first:
129    > ./configure --help
131    This gives you a list of all possible options.
132    Please choose the options that fit your needs.
134    [ Optimization note:
135        If you want gcc to be run with any optimization flags,
136        you should run
137        > export CFLAGS='-yourflags'
138        now.
139        I used: (may not work on your system)
140        > export CFLAGS='-O2 -march=i686'
141    ]
143    I used the following command (may not work on your system):
144    > ./configure i686-unknown-linux-gnu --prefix=/usr --with-gcc --with-x
146    This will install Emacs in /usr/* and not in /usr/local/* and also use GCC
147    and enable the Emacs X11 interface.
149    I also specified my host type: i686-unknown-linux-gnu
150    Information on available host types can be found in:
151    /usr/src/emacs-20.7/etc/MACHINES
153    If unsure, just use the following:
154    > ./configure --prefix=/usr
156    Emacs will then be installed in your /usr directory.
158 [3b. This part is hard for newbies :o( ]
160    The installation instructions that come with the emacs package now recommend
161    to look at /usr/src/emacs-20.7/lisp/paths.el.
163    The file contains paths to various external programs (sendmail p.e.).
164    If those are not correct and you want emacs to be able to use them, you
165    should modify the file site-init.el (not the paths.el file).
167    For further information read /usr/src/emacs-20.7/INSTALL
169    In most cases (especially on your LFS system), the paths in paths.el should
170    be correct - it looks for the binaries in the /usr/bin and /usr/local/bin
171    directories and checks all 'usual' locations.
173    It is quite safe not to look at paths.el, unless you've installed programs
174    like sendmail in unusual locations.
177 [ Note: There are a few more steps you could do if you want, such as adding
178         special termcap entries and so on.
179         I didn't need any of those, so I just say that the normal user won't
180         need them; but you may take a look at the INSTALL file if interested ]
182 4. Compile Emacs
184    Now this should be quite easy:
186    > cd /usr/src/emacs-20.7
187    > make
189    If the configure - script ran without errors, the make shouldn't produce any,
190    too.
192    If make exits with an error message, it may be due to some optimization flags
193    that you may have added in Part 3. Then try to remove them and run configure
194    and make again.
196    If that doesn't solve the problem, send it to the lfs-apps mailing list to
197    get help.
199    The compilation took 10 Minutes on my PII-233.
202 5. Install Emacs
204    Just run:
206    > make install
208    This installs Emacs in the directories you specified in the configure call
209    (Default: /usr/local/..., with --prefix=/usr in /usr/... and so on)
211    prefix/bin now contains:
213      emacs, etags, ctags, b2m, emacs-client, rcs-checkin
214      (Sorry, I'm too lazy to describe them, go to www.gnu.org, there's the
215       manual, FAQ, just everything)
217    prefix/share/emacs/VERSION/ contains the emacs lisp library and other emacs
218    files.
220    There also should be manpages installed - read the INSTALL file for further
221    information.
223    If 'make install' was successful, you can delete the sources if you want to:
224    > rm -R /usr/src/emacs-20.7
227 For the people who decided not to install the intlfonts:
229   Congratulations, you've done it!
230   If this hint helped you out, I'd be glad if you'd send a short note to
231   andykl@epost.de, so that I know that this work had some use ;o)
234 For all others:
236 6. Install intlfonts
238    You'll have to unpack the intlfonts package first.
240    > cd /usr/src
241    > tar xvfz intlfonts-1.2.tar.gz
243    This will create the /usr/src/intlfonts-1.2/ directory.
244    Go into this directory and run the configure script:
245    [If you used a --prefix= parameter when installing emacs,
246     you probably should use the same prefix option here!]
248    Note: You may also want to take a look on ./configure --help first;
249          Type1/TTF Fonts are not installed by default - if your X
250          supports those, you may want to install them, too.
252    > cd /usr/src/intlfonts-1.2
253    > ./configure
255    The fonts will be installed in the prefix directory you specified
256    (Default: /usr/local): /prefix/share/emacs/fonts.
258    To do this, you need to run:
260    > make install
262    Now, the X server needs to know about the new fonts.
264    This is done by adding /prefix/share/emacs/fonts to the known font paths.
266    I did it by adding FontPath "/usr/share/emacs/fonts/" to my XF86Config file.
267    But this depends on how you configured your X. You may want to add
268    xset +fp /usr/share/emacs/fonts/ in some .xinitrc Files instead.
270 --------------------------------------------------------------------------------
272 Congratulations, you now have a running emacs.
274 Manuals, FAQs, How-to-Configure and similar stuff can be found at:
275 http://www.gnu.org/software/emacs.
277 I hope this hint helped you a little :)
279 Andreas Klauer
280 Also known as:  menaures@UNItopia.de
281 E-Mail: andykl@epost.de
283 If you manage to get the Emacs Webbrowser running and you speak german,
284 visit www.unitopia.de ;o)