1. Download source code
Go to http://mirrors.ustc.edu.cn/gnu/emacs /. Download emacs-24.2.tar.gz and decompress it to the/user/local/lib folder.
2. install third-party Libraries
sudo apt-get install libgtk2.0-devsudo apt-get install libxpm-devsudo apt-get install libjpeg62-devsudo apt-get install libgif-devsudo apt-get install libtiff4-dev
3. Compile and install
Terminal: Enter the unzipped Emacs folder.
./configure
No problem.
make
Error:
Error: Expected unqualified-ID before '('token
The reason is the declaration conflict in a header file.
sudo gedit /usr/local/include/jmorecfg.h
Change the code around line 1 to the following:
#ifdef HAVE_BOOLEAN#ifndef FALSE/* in case these macros already exist */#define FALSE0/* values of boolean */#endif#ifndef TRUE#define TRUE1#endif#elsetypedef enum {false=0, true=1} boolean;#endif
Make it again!
Last run
Make install
4. Configuration File
I found a configuration file on the Internet and changed it slightly.
; Tanky Woo's. emacs; date: 2011.11.6; blog: www.wutianqi.com; setnu. el startup; m-x setnu-mode; no linum. el is easy to use, so watch out for it ~~;; (Require 'setnu); (setnu-mode t); linum. el startup; m-x linum-mode; the number of automatically displayed lines (require 'linum) (setq linum-mode t) (Global-linum-mode 1 );; if you want to manually select the background color, you can use (set-cursor-color "white") (set-mouse-color "white") (set-foreground-color "white ") (set-Background-color "black"); color-theme.el; color; m-x color-theme-select (add-to-list 'Load-path "~ /Themes ") (require 'color-theme) (setq color-theme-is-Global t) (color-theme-Initialize) (color-theme-Tango );; display the column number (setq column-number-mode t) (setq line-number-mode t) in Mode-line; set the font to bitstream Vera sans Moni ;; font-size is 11, because the notebook 12-inch, so the font dare not get too big; YUM install bitstream-vera-sans-mono-fonts.noarch (set-default-font "bitstream Vera sans mono-11 ");; emacs and external programs can be pasted (setq X-select-enable-clipboard t ); E-line display time, in the following format (display-time-mode 1) (setq display-time-24hr-format t) (setq display-time-day-and-date t );; use y/N to represent Yes/No (fset 'Yes-or-no-p' y-or-n-P); to achieve full screen effect, shortcut: F6 (Global-set-Key [F6] 'my-fullscreen) (defun my-fullscreen () (interactive) (x-send-client-messagenil 0 nil "_ net_wm_state" 32' (2 "_ net_wm_state_fullscreen" 0); (defun my-maximized () (interactive) (x-send-client-messagenil 0 nil "_ Net_wm_state "32 '(2" _ net_wm_state_maximized_horz "0 )) (x-send-client-messagenil 0 nil "_ net_wm_state" 32 '(2 "_ net_wm_state_maximized_vert" 0); maximum window (my-maximized) When Emacs is started );; change the indentation level (setq-default C-Basic-offset 4); change the style (setq C-default-style "Linux" C-Basic-offset 4) (setq indent-Tabs-mode nil) (setq default-tab-width 4) (setq tab-width 4); In the title bar, you are prompted where you are currently. Don't know why ?;; (Setq frame-title-format "tankywoo @ % B"); remove the toolbar; (tool-bar-mode nil); remove the menu bar ;; (menu-bar-mode nil)