win10 中安装/配置emacs 26.1

1. 下载emacs 26.1

http://ftp.gnu.org/gnu/emacs/windows/emacs-26/

i686和x86_64有什么区别?

代表intel系列的cpu
386 几乎适用于所有的 x86 平台,不论是旧的 pentum 或者是新的 pentum-IV 与 K7 系列的 CPU等等,都可以正常的工作!那个 i 指的是 Intel 兼容的 CPU 的意思,至于 386 不用说,就是 CPU 的等级啦!
i586 就是 586 等级的计算机,那是哪些呢?包括 pentum 第一代 MMX CPU, AMD 的 K5, K6 系列 CPU ( socket 7 插脚 ) 等等的 CPU 都算是这个等级;
i686 在 pentun II 以后的 Intel 系列 CPU ,及 K7 以后等级的 CPU 都属于这个 686 等级!
而x86_64就是64位的x(代表不确定。可以是3、4、5、6、)86,是个统称,如果是i686_64也是属于x86_64的。

2. 创建文件夹 解压emacs

我的是将 emacs压缩包解压在 D:\Emacs\Emacs_26 目录中

3. 添加注册表

右击桌面 我的电脑 > 属性 > 高经系统设置 > 高级 > 环境变量 > 用户变量 > 编辑
添加

变量
HOME D:\Emacs\Emacs_26
PATH D:\Emacs\Emacs_26

详细操作图1-图2所示
win10 中安装/配置emacs 26.1
图1 环境变量设置win10 中安装/配置emacs 26.1
图2 环境变量设置

4. 运行 addpm.exe 文件创建快捷图标

文件的位置在emacs 的bin文件夹中 D:\Emacs\Emacs_26\bin\addpm.exe

win10 中安装/配置emacs 26.1
图3 emacs 快捷图标

5. 运行runemacs.exe 创建emacs 配置文件

依次点击 Options > Highlight Matching Parentheses > Save Options
然后emacs 在根目录下 会自己创建一个 .emacs 配置文件
在界面的最底部会有提示

win10 中安装/配置emacs 26.1
图4 创建.emacs 文件

win10 中安装/配置emacs 26.1
图5 创建.emacs 文件

6. 对emacs进行配置

用notepad++ 打开 D:\Emacs\Emacs_26.emacs
将以下代码贴入.emacs 中并保存,再次打开emacs 就可以方便的使用啦


(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
   ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
 '(column-number-mode t)
 '(current-language-environment "Chinese-GBK")
 '(custom-enabled-themes nil)
 '(display-time-mode t)
 '(package-selected-packages (quote (auctex)))
 '(transient-mark-mode nil)
 '(uniquify-buffer-name-style nil nil (uniquify)))
(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 "微软雅黑" :foundry "outline" :slant normal :weight normal :height 181 :width normal)))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 启动最大化窗口设置 - START
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun w32-restore-frame ()
"Restore a minimized frame"
(interactive)
(w32-send-sys-command 61728))
(defun w32-maximize-frame ()
"Maximize the current frame"
(interactive)
(w32-send-sys-command 61488))
;;; Maximum Windows Frame
(w32-maximize-frame)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 启动最大化窗口设置 - END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 ;;显示日期
(setq display-time-day-and-date t)
(display-time)
;;显示当前所在的行号和列号
(column-number-mode t)
 

;在标题栏提示你目前所在位置.
(setq frame-title-format '("[email protected]"system-name": %b %+%+ %f"))
 
;;org-mode 设置 
;; 中文换行问题
(add-hook 'org-mode-hook (lambda () (setq truncate-lines nil)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;       在emacs  org mode 中使用外部程序打开文件;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 
(add-hook 'org-mode-hook
      '(lambda ()
         (setq org-file-apps
           '((auto-mode . emacs)
             ("\\.mm\\'" . default)
             ("\\.x?html?\\'" . default)
             ("\\.docx\\'" . default)
             ("\\.pdf\\'" . default   )      ))))