设为首页 收藏本站
查看: 620|回复: 0

[经验分享] CentOS6U5 64位系统编译安装最新版本的Emacs编辑器

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-3-9 08:30:51 | 显示全部楼层 |阅读模式
通过yum的安装方式,安装的版本比较旧(好像是21版本,没有亲自确认)。小白喜欢用最新版的Emacs,所以就准备编译安装。

环境准备,
操作系统:CentOS6U5 64bit
软件环境:Basic环境"Development Tools"环境

以下为安装步骤:

1.安装EPEL源
1
rpm -ivh http://mirrors.ustc.edu.cn/fedor ... ease-6-8.noarch.rpm



2. 下载Emacs最新版本,这里使用的最新版本为24.5
3. 安装Emacs的依赖包
1
2
3
# yum install -y ncurses-devel
----------以下为非必须----------
# yum install -y libpng-devel libjpeg-devel libtiff-devel



4. 编译安装Emacs
1
2
3
4
5
6
7
# cd /usr/local/src/
# tar -xf emacs-24.5.tar.gz
# cd emacs-24.5
# ./configure
# make
# src/emacs -Q ; 测试make后的Emacs是否可用,非必须
# make install



5. 准备配置文件
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# cat ~/.emacs
(global-set-key "\C-h" 'backward-delete-char-untabify)
(global-set-key "\d" 'delete-char)

;; disable the startup info
(setq inhibit-startup-message t)

(setq-default tab-width 4)

(setq fill-column 70)

  ;; Display settings
  (display-time-mode t)
  (column-number-mode t)

  ;; 高亮显示选中块
  (transient-mark-mode t)

  ;; 支持外部复制粘贴
  (setq x-select-enable-clipboard t)

  ;; Show the patern parentheses
  ;; 显示括号匹配
  (show-paren-mode t)
  (setq show-paren-style 'parentheses)

  ;; multi windows settings
  ;;(require 'window-numbering)
  ;;(window-numbering-mode 1)
  ;; Time settings
  ;; 设置显示底边栏(时间,行列号),字体
  ;; (setq display-time-day-and-date t)
  (display-time-mode 1)
  (setq display-time-24hr-format t)
  (setq display-time-use-mail-icon t) ;; 邮件设置图标
  (setq frame-title-format "LavenLiu@%b")
  ;; GDB设置,多窗口GDB
  (setq gdb-many-windows t)

  ;; Syntax highlight
  (global-font-lock-mode t)

  ;; y|n represents yes|no
  ;; 设置用'y'或'n'代替'yes'或'no'
  (fset 'yes-or-no-p 'y-or-n-p)

  ;;;; yasnippet setting
  (add-to-list 'load-path "~/.emacs.d/elpa/yasnippet")
  (require 'yasnippet)
  (yas/global-mode 1)
  ;; stop auto save
  (setq auto-save-default nil)
  (setq make-backup-files nil)


  ;; turn on ruler
  ;;(ruler-mode 1)

  ;;这两句是我的全局配置,避免出现多语言混乱。
  ;; Encoding style
  (set-buffer-file-coding-system 'utf-8)
  (set default-buffer-file-coding-system 'utf-8)
  (set-terminal-coding-system 'utf-8)
  (set-language-environment 'UTF-8)
  (set-locale-environment "UTF-8")
  ;;
  (custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(ansi-color-faces-vector
  [default default default italic underline success warning error])
  '(ansi-color-names-vector
  ["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"])
  '(auto-image-file-mode t)
  '(auto-save-default nil)
  '(c-label-minimum-indentation 4)
  '(column-number-mode t)
  '(compile-command "gcc -g -o")
  '(current-language-environment "UTF-8")
  '(custom-enabled-themes (quote (light-blue)))
  '(display-time-mode t)
  '(ede-auto-add-method (quote always))
  '(emms-lyrics-coding-system (quote gb2312))
  '(emms-lyrics-display-buffer t)
  '(emms-lyrics-display-on-minibuffer t)
  '(emms-player-list
  (quote
      (emms-player-mpg321 emms-player-ogg123 emms-player-mplayer)))
  '(global-semantic-highlight-edits-mode t)
  '(global-semantic-highlight-func-mode t)
  '(global-semantic-idle-completions-mode t nil (semantic/idle))
  '(image-animate-loop t)
  '(jde-jdk-registry (quote (("1.7.0_75" . "/usr/lib/jdk1.7.0_75"))))
  '(make-backup-files nil)
  '(mew-addrbook-file "~/Mail/Addrbook")
  '(mew-mail-domain "163.com")
  '(mew-name "xxxxxxxx")
  '(mew-smtp-server "smtp.163.com")
  '(mew-use-auto-alias t)
  '(mew-user "xxxxxxxx")
  '(org-agenda-files (quote ("~/Desktop/iGTD/iGTD.org")))
  '(org-completion-use-ido t)
  '(org-modules
  (quote
      (org-bbdb org-bibtex org-ctags org-docview org-gnus org-info org-irc org-mhe org-rmail org-w3m org-eshell org-mew org-toc)))
  '(org-startup-with-inline-images t)
  '(org-use-fast-todo-selection t)
  '(package-archives
  (quote
      (("gnu" . "http://elpa.gnu.org/packages/")
      ("melpa" . "http://melpa.org/packages/"))))
  '(safe-local-variable-values (quote ((TeX-master . t))))
  '(semantic-default-submodes
  (quote
      (global-semantic-decoration-mode global-semantic-idle-completions-mode global-semantic-idle-scheduler-mode global-semanticdb-minor-mode global-semantic-idle-summary-mode global-semantic-mru-bookmark-mode)))
  '(semantic-idle-scheduler-idle-time 3)
  '(send-mail-function (quote smtpmail-send-it))
  '(show-paren-mode t)
  '(smtpmail-smtp-server "smtp.163.com")
  '(smtpmail-smtp-service 25)
  '(vc-annotate-color-map
  (quote
      ((20 . "#ab4642")
      (50 . "#dc9656")
      (80 . "#f7ca88")
      (110 . "#a1b56c")
      (140 . "#86c1b9")
      (170 . "#7cafc2")
      (200 . "#ba8baf")
      (230 . "#a16046")
      (260 . "#181818")
      (290 . "#282828")
      (320 . "#383838")
      (350 . "#585858"))))
  '(vc-annotate-very-old-color "#585858"))
  (custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(default ((t (:family #("新宋体" 0 3 (charset chinese-gbk)) :foundry "outline" :slant normal :weight normal :height 120 :width normal)))))

  ;; E-Mail settings
  (add-to-list 'load-path
             (expand-file-name "~/.emacs.d/elpa/mew-20140901.1737/"))
  (autoload 'mew "mew" nil t)
  (autoload 'mew-send "mew" nil t)

  (if (boundp 'read-mail-command)
      (setq read-mail-command 'mew))

  (autoload 'mew-user-agent-compose "mew" nil t)
  (if (boundp 'mail-user-agent)
      (setq mail-user-agent 'mew-user-agent))
  (if (fboundp 'define-mail-user-agent)
      (define-mail-user-agent
      'mew-user-agent
      'mew-user-agent-compose
      'mew-draft-send-message
      'mew-draft-kill
      'mew-send-hook))
  ;; Highlight the selected region
  (transient-mark-mode t)

  ;; 设置光标和指针颜色
  (set-cursor-color "red")
  (set-mouse-color "goldenrod")

  ;; 设置选中区域的颜色
  (set-face-background 'region "yellow")

  ;; Add a blank line at the end of the file
  ;; 在文件末尾添加一空白行
  (setq require-final-newline t)
  (setq track-eol t)

  (add-to-list 'load-path "~/.emacs.d/elpa/pde/lisp")
  (load "pde-load")
  ;; ditaa block for org mode
  (org-babel-do-load-languages
  'org-babel-load-languages
  '((ditaa . t) ; this line activates ditaa
  (plantuml . t)
  (awk . t)
  (python . t)
  (perl . t)
  (ruby . t)
  (R . t)
  (sh . t)
  (gnuplot . t)
  (org . t)
  (java . t)
  (emacs-lisp . t)
  (calc . t)
  (sql . t)
  (dot . t)
  ))
  (setq org-ditta-jar-path (expand-file-name "~/.emacs.d/elpa/contrib/scripts/ditta.jar"))
  (setq org-plantuml-jar-path (expand-file-name "~/.emacs.d/elpa/contrib/scripts/plantuml.jar"))
  ;; org mode do not prompt me
  (setq org-confirm-babel-evaluate nil)
  (setq org-src-fontify-natively t)

  ;; ===============================================
  ;; my own functions
  (defun gtd ()
  (interactive)
  (find-file "~/Desktop/iGTD/iGTD.org")
  )

  ;; my own shortcuts
  (global-set-key "\C-cx" 'gtd)
  (global-set-key (kbd "M-g") 'goto-line)
  (global-set-key "\C-\\" 'set-mark-command)

  (defun read-only-if-symlink ()
  (if (file-symlink-p buffer-file-name)
      ((progn )
       (setq buffer-read-only t)
       (message "File is a symlink"))))
  (add-hook 'find-file-hook 'read-only-if-symlink)

  (add-hook 'local-write-file-hooks 'update-writestamps)

  (defun update-writestamps ()
  "Find writestamps and replace them with the current time."
  (save-excursion
      (save-restriction
      (save-match-data
        (widen)
        (goto-char (point-min))
        (while (search-forward "WRITESTAMP((" nil t)
          (let ((start (point)))
            (search-forward "))")
            (delete-region start (- (point) 2))
            (goto-char start)
            (insert-date))))))
  nil)

  ;;; 自动补全设置
  (add-to-list 'load-path "~/.emacs.d/elpa/auto-complete")
  (require 'auto-complete)

  ;;; Python的编程环境配置
  (add-to-list 'load-path "~/.emacs.d/elpa/python-environment")
  (add-to-list 'load-path "~/.emacs.d/elpa/jedi")
  (add-to-list 'load-path "~/.emacs.d/elpa/jedi-core")
  (add-to-list 'load-path "~/.emacs.d/elpa/virtualenv")
  (add-to-list 'load-path "~/.emacs.d/elpa/ctable")
  (add-to-list 'load-path "~/.emacs.d/elpa/concurrent")
  (add-to-list 'load-path "~/.emacs.d/elpa/deferred")
  (add-to-list 'load-path "~/.emacs.d/elpa/epc")
  (add-to-list 'load-path "~/.emacs.d/elpa/popup")
  (require 'popup)
  (require 'ctable)
  (require 'concurrent)
  (require 'epc)
  (add-hook 'python-mode-hook 'jedi:setup)
  (autoload 'jedi:setup "jedi" nil t)
  (setq jedi:complete-on-dot t)
  (require 'cedet)
  (global-ede-mode 1)

  ;; My Own settings
  ;; easy keys for split windows
  (global-set-key (kbd "M-3") 'delete-other-windows) ; [Alt+] unsplit all
  (global-set-key (kbd "M-4") 'split-window-below)
  (global-set-key (kbd "M-$") 'split-window-right)
  (global-set-key (kbd "M-RET") 'other-window) ; [Alt+Return] move cursor to next pane
  (global-set-key (kbd "M-0") 'delete-window)  ; remove current pane



6. 把.emacs.d目录放置到当前用户的家目录
7. 安装与Python相关的依赖包jedi
1
2
3
4
yum install python-pip
pip install ecdsa
pip install epc
pip install jedi



以上几个步骤,已经完成Emacs的安装及Python编程环境的配置,接下来Enjoy!


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-188284-1-1.html 上篇帖子: SVN配置,WWW同步,添加注释才能提交 下篇帖子: linux视频处理驱动通道的详解 编辑器
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表