[Emacs]linux下编译安装emacs23 cvs
系统: ubuntu 7.10
我现在2台机上在用这个版本,一台机是gnome, 另一台机是KDE,KDE上的emacs-gtk可以直接用scim输入了,但gnome据说是某session-daemon程序的问题导致不能激活外部输入法,我现在的解决方法是开一个terminal, 在terminal下用emacs -nw启动,这样就能用外部输入法输入中文了
编辑~/.Xresources
编辑~/.emacs文件(最新版在我的 wiki)
配置文件都是从网上直接copy来的,把一些不用的注释了
我现在2台机上在用这个版本,一台机是gnome, 另一台机是KDE,KDE上的emacs-gtk可以直接用scim输入了,但gnome据说是某session-daemon程序的问题导致不能激活外部输入法,我现在的解决方法是开一个terminal, 在terminal下用emacs -nw启动,这样就能用外部输入法输入中文了
Checkout源代码
sudo apt
-
get install ssh cvs
export CVS_RSH = " ssh "
cvs - z3 - d:pserver:[email protected]: / cvsroot / emacs co - r emacs - unicode - 2 emacs
export CVS_RSH = " ssh "
cvs - z3 - d:pserver:[email protected]: / cvsroot / emacs co - r emacs - unicode - 2 emacs
安装依赖包
sudo apt
-
get install texinfo libgpmg1
-
dev libungif4
-
dev libpng12
-
dev libgd2
-
xpm
-
dev libtiff4
-
dev libjpeg62
-
dev librsvg2
-
dev libgtk2.0
-
dev
注意:上面有几个图形库不是必须的;我的机器本来就装了很多开发库,所以上面的库估计也是不全的
编译安装
.
/
configure
--
prefix
=/
usr
--
enable
-
font
-
backend
--
with
-
gtk
--
with
-
xft
--
with
-
freetype
&&
make bootstrap
&&
make info
&&
sudo make install
配置
编辑~/.Xresources
Xft
.
antialias
:
1
# 可以尝试把hinting关了对比效果,有些显示器上不开反而更好看
Xft . hinting : 1
Xft . hintstyle : hintfull
Xft . rgba : rgb
Emacs . FontBackend : xft
Emacs.Geometry: 100x32+4+4
执行xrdb ~/.Xresources例配置生效
# 可以尝试把hinting关了对比效果,有些显示器上不开反而更好看
Xft . hinting : 1
Xft . hintstyle : hintfull
Xft . rgba : rgb
Emacs . FontBackend : xft
Emacs.Geometry: 100x32+4+4
编辑~/.emacs文件(最新版在我的 wiki)
;;设置个人信息
;;
(setq user - full - name " Jarod Liu " )
(setq user - mail - address " liuyuanzhi(at)gmail.com " )
;;添加自定义loadpath
;;
( if (fboundp ' normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir "/home/jarod/.myemacs/")
(default-directory my-lisp-dir))
(setq load-path (cons my-lisp-dir load-path))
(normal-top-level-add-subdirs-to-load-path)))
;;设置字体
;;
(set-default-font "Monospace-14")
(set-fontset-font (frame-parameter nil ' font)
' unicode ' ( " Microsoft YaHei " . " unicode-bmp " ))
(set - fontset - font (frame - parameter nil ' font)
' han ' ("Microsoft YaHei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil ' font)
' symbol ' ( " Microsoft YaHei " . " unicode-bmp " ))
(set - fontset - font (frame - parameter nil ' font)
' cjk - misc ' ("Microsoft YaHei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil ' font)
' bopomofo ' ( " Microsoft YaHei " . " unicode-bmp " ))
;; For my language code setting (UTF - 8 )
;;
(setq current - language - environment " UTF-8 " )
(setq default - input - method " chinese-py " )
(setq locale - coding - system ' utf-8)
(set-terminal-coding-system ' utf - 8 )
(set - keyboard - coding - system ' utf-8)
(set-selection-coding-system ' utf - 8 )
(prefer - coding - system ' utf-8)
;;启动服务器(for emacsclient)
;;
(server-start)
;;自定义按键
;;
(global-set-key [f1] ' shell);F1进入Shell
;(global - set - key (kbd " C-SPC " ) ' nil);用win+space为set-mark键,留出ctrl+space热键作为输入法
;(global-set-key (kbd "S-SPC") ' set - mark - command)
;;使用习惯配制
;;
(setq default - major - mode ' text-mode);一打开就起用 text 模式。
(global-font-lock-mode t);语法高亮
(auto-image-file-mode t);打开图片显示功能
(fset ' yes - or - no - p ' y-or-n-p);以 y/n代表 yes/no
(setq default-fill-column 80);默认显示 xx列就换行
(column-number-mode t);显示列号
(show-paren-mode t);显示括号匹配
(setq show-paren-style ' parentheses);括号匹配时显示另外一边的括号,而不是跳到另一个括号
;(display - time - mode 1 );显示时间,格式如下
;(setq display - time - 24hr - format t)
;(setq display - time - day - and - date t)
(tool - bar - mode nil);去掉工具栏
(scroll - bar - mode nil);去掉滚动条,可以使用鼠标滚轮
(setq scroll - margin 3 scroll - conservatively 10000 );防止页面滚动时跳动, scroll - margin 3 可以在靠近屏幕边沿3行时就开始滚动
(mouse - avoidance - mode ' animate);光标靠近鼠标指针时,让鼠标指针自动让开
(setq mouse-yank-at-point t);支持中键粘贴
(transient-mark-mode t);高亮显示要拷贝的区域
(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq interprogram-paste-function ' x - cut - buffer - or - selection - value) ;
(setq frame - title - format " %b " );在标题栏提示buffer名
(setq - default make - backup - files nil);不要生成临时文件
(setq visible - bell t);关闭烦人的出错时的提示声
(setq inhibit - startup - message t);关闭起动时的那个“开机画面”
(setq kill - ring - max 64 );undo number
;; 缩进
(setq default - tab - width 4 );; 设置tab为4个空格的宽度
(setq tab - width 4 )
(global - set - key " \C-m " ' newline-and-indent)
(global-set-key "\C-j" ' newline);; 交换这两个按键。因为大多数情况下,回车后是要缩进的。
;; mode alist
(mapcar
(function (lambda (setting)
(setq auto - mode - alist
(cons setting auto - mode - alist))))
' (("\\.xml$". sgml-mode)
("\\\.bash" . sh-mode)
("\\.rdf$". sgml-mode)
("\\.session" . emacs-lisp-mode)
("\\.l$" . c-mode)
("\\.css$" . css-mode)
("\\.cfm$" . html-mode)
("gnus" . emacs-lisp-mode)
("\\.idl$" . idl-mode)
("\\.rb$" . ruby-mode)
("\\.rhtml$" . html-mode)))
;; tabbar
;;
(require ' tabbar) ; http :// liuyuanzhi . googlepages . com / tabbar . el
(tabbar - mode)
;(global - set - key (kbd "" ) ' tabbar-backward-group)
;(global-set-key (kbd "") ' tabbar - forward - group)
(global - set - key (kbd " C-` " ) ' tabbar-backward) ;切换TAB的快捷键
(global-set-key (kbd "C-<tab>") ' tabbar - forward)
;(set - face - attribute ' tabbar-default-face nil :family "Tahoma") ;设置tabbar字体
;; color-theme
;;
(require ' color - theme) ;http :// liuyuanzhi . googlepages . com / color - theme . el
(color - theme - gnome2)
;; ruby
;; based on http :// www . rubygarden . org / Ruby / page / show / InstallingEmacsExtensions
;;
( require ' ruby-mode) ;安装ubuntu中的ruby-elisp包
(autoload ' ruby - mode " ruby-mode " " Ruby editing mode. " t)
(modify - coding - system - alist ' file "\\.rb$" ' utf - 8 )
(modify - coding - system - alist ' file "\\.rhtml$" ' utf - 8 )
(autoload ' run-ruby "inf-ruby"
"Run an inferior Ruby process")
(autoload ' inf - ruby - keys " inf-ruby "
" Set local key defs for inf-ruby in ruby-mode " )
(add - hook ' ruby-mode-hook
' (lambda ()
(inf - ruby - keys )))
;; If you have Emacs 19 . 2x or older , use rubydb2x
(autoload ' rubydb "rubydb3x" "Ruby debugger" t)
;;
(setq user - full - name " Jarod Liu " )
(setq user - mail - address " liuyuanzhi(at)gmail.com " )
;;添加自定义loadpath
;;
( if (fboundp ' normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir "/home/jarod/.myemacs/")
(default-directory my-lisp-dir))
(setq load-path (cons my-lisp-dir load-path))
(normal-top-level-add-subdirs-to-load-path)))
;;设置字体
;;
(set-default-font "Monospace-14")
(set-fontset-font (frame-parameter nil ' font)
' unicode ' ( " Microsoft YaHei " . " unicode-bmp " ))
(set - fontset - font (frame - parameter nil ' font)
' han ' ("Microsoft YaHei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil ' font)
' symbol ' ( " Microsoft YaHei " . " unicode-bmp " ))
(set - fontset - font (frame - parameter nil ' font)
' cjk - misc ' ("Microsoft YaHei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil ' font)
' bopomofo ' ( " Microsoft YaHei " . " unicode-bmp " ))
;; For my language code setting (UTF - 8 )
;;
(setq current - language - environment " UTF-8 " )
(setq default - input - method " chinese-py " )
(setq locale - coding - system ' utf-8)
(set-terminal-coding-system ' utf - 8 )
(set - keyboard - coding - system ' utf-8)
(set-selection-coding-system ' utf - 8 )
(prefer - coding - system ' utf-8)
;;启动服务器(for emacsclient)
;;
(server-start)
;;自定义按键
;;
(global-set-key [f1] ' shell);F1进入Shell
;(global - set - key (kbd " C-SPC " ) ' nil);用win+space为set-mark键,留出ctrl+space热键作为输入法
;(global-set-key (kbd "S-SPC") ' set - mark - command)
;;使用习惯配制
;;
(setq default - major - mode ' text-mode);一打开就起用 text 模式。
(global-font-lock-mode t);语法高亮
(auto-image-file-mode t);打开图片显示功能
(fset ' yes - or - no - p ' y-or-n-p);以 y/n代表 yes/no
(setq default-fill-column 80);默认显示 xx列就换行
(column-number-mode t);显示列号
(show-paren-mode t);显示括号匹配
(setq show-paren-style ' parentheses);括号匹配时显示另外一边的括号,而不是跳到另一个括号
;(display - time - mode 1 );显示时间,格式如下
;(setq display - time - 24hr - format t)
;(setq display - time - day - and - date t)
(tool - bar - mode nil);去掉工具栏
(scroll - bar - mode nil);去掉滚动条,可以使用鼠标滚轮
(setq scroll - margin 3 scroll - conservatively 10000 );防止页面滚动时跳动, scroll - margin 3 可以在靠近屏幕边沿3行时就开始滚动
(mouse - avoidance - mode ' animate);光标靠近鼠标指针时,让鼠标指针自动让开
(setq mouse-yank-at-point t);支持中键粘贴
(transient-mark-mode t);高亮显示要拷贝的区域
(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq interprogram-paste-function ' x - cut - buffer - or - selection - value) ;
(setq frame - title - format " %b " );在标题栏提示buffer名
(setq - default make - backup - files nil);不要生成临时文件
(setq visible - bell t);关闭烦人的出错时的提示声
(setq inhibit - startup - message t);关闭起动时的那个“开机画面”
(setq kill - ring - max 64 );undo number
;; 缩进
(setq default - tab - width 4 );; 设置tab为4个空格的宽度
(setq tab - width 4 )
(global - set - key " \C-m " ' newline-and-indent)
(global-set-key "\C-j" ' newline);; 交换这两个按键。因为大多数情况下,回车后是要缩进的。
;; mode alist
(mapcar
(function (lambda (setting)
(setq auto - mode - alist
(cons setting auto - mode - alist))))
' (("\\.xml$". sgml-mode)
("\\\.bash" . sh-mode)
("\\.rdf$". sgml-mode)
("\\.session" . emacs-lisp-mode)
("\\.l$" . c-mode)
("\\.css$" . css-mode)
("\\.cfm$" . html-mode)
("gnus" . emacs-lisp-mode)
("\\.idl$" . idl-mode)
("\\.rb$" . ruby-mode)
("\\.rhtml$" . html-mode)))
;; tabbar
;;
(require ' tabbar) ; http :// liuyuanzhi . googlepages . com / tabbar . el
(tabbar - mode)
;(global - set - key (kbd "" ) ' tabbar-backward-group)
;(global-set-key (kbd "") ' tabbar - forward - group)
(global - set - key (kbd " C-` " ) ' tabbar-backward) ;切换TAB的快捷键
(global-set-key (kbd "C-<tab>") ' tabbar - forward)
;(set - face - attribute ' tabbar-default-face nil :family "Tahoma") ;设置tabbar字体
;; color-theme
;;
(require ' color - theme) ;http :// liuyuanzhi . googlepages . com / color - theme . el
(color - theme - gnome2)
;; ruby
;; based on http :// www . rubygarden . org / Ruby / page / show / InstallingEmacsExtensions
;;
( require ' ruby-mode) ;安装ubuntu中的ruby-elisp包
(autoload ' ruby - mode " ruby-mode " " Ruby editing mode. " t)
(modify - coding - system - alist ' file "\\.rb$" ' utf - 8 )
(modify - coding - system - alist ' file "\\.rhtml$" ' utf - 8 )
(autoload ' run-ruby "inf-ruby"
"Run an inferior Ruby process")
(autoload ' inf - ruby - keys " inf-ruby "
" Set local key defs for inf-ruby in ruby-mode " )
(add - hook ' ruby-mode-hook
' (lambda ()
(inf - ruby - keys )))
;; If you have Emacs 19 . 2x or older , use rubydb2x
(autoload ' rubydb "rubydb3x" "Ruby debugger" t)
配置文件都是从网上直接copy来的,把一些不用的注释了