|
| 1 | +;; === Debug .emacs === |
| 2 | +;; Turn it on: (setq debug-on-error t) |
| 3 | +;; Turn it off: (setq debug-on-error nil) |
| 4 | +(setq debug-on-error nil) |
| 5 | + |
1 | 6 | ;; === Default encoding ===
|
2 | 7 | (prefer-coding-system 'utf-8)
|
3 | 8 |
|
|
6 | 11 | ;; in the early init file.
|
7 | 12 | (setq package-enable-at-startup nil)
|
8 | 13 |
|
| 14 | +;; === Packages === |
| 15 | +;; Add the following three lines to enable package install. |
| 16 | +;; then M-x package-install RET ox-gfm RET |
| 17 | +;; http://orgmode.org/manual/Installation.html#Installation |
| 18 | +;; If emacs report errors indicating some packages are not found, |
| 19 | +;; try to find them by M-x list-packages and then install. |
| 20 | +(require 'package) |
| 21 | +(setq package-archives '( |
| 22 | + ("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/") |
| 23 | + ("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/"))) |
| 24 | +(package-initialize) |
| 25 | + |
| 26 | +(require 'ox-gfm) |
| 27 | + |
9 | 28 | ;; === Packages configurated by use-package ===
|
10 | 29 | ;; https://github.com/jwiegley/use-package#installing-use-package
|
11 | 30 | ;; This is only needed once, near the top of the file
|
|
21 | 40 | :ensure t
|
22 | 41 | :bind ("M-w" . clipetty-kill-ring-save))
|
23 | 42 |
|
24 |
| -;; === Packages === |
25 |
| -;; Add the following three lines to enable package install. |
26 |
| -;; then M-x package-install RET ox-gfm RET |
27 |
| -;; http://orgmode.org/manual/Installation.html#Installation |
28 |
| -(require 'package) |
29 |
| -(setq package-archives '( |
30 |
| - ("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/") |
31 |
| - ("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/"))) |
32 |
| -(package-initialize) |
33 |
| - |
34 |
| -(require 'ox-gfm) |
35 |
| - |
36 | 43 | ;; === Proxy ===
|
37 | 44 | ;; Replace proxy.google.com with your own.
|
38 | 45 | ;; (setq url-proxy-services '(
|
|
46 | 53 | ;; https://github.com/tumashu/cnfonts#org8dffa7c
|
47 | 54 | ;; M-X package-install RET cnfonts RET
|
48 | 55 | (require 'cnfonts)
|
49 |
| -;; 让 cnfonts 随着 Emacs 自动生效。 |
| 56 | +;; Let cnfonts enabled. |
50 | 57 | (cnfonts-enable)
|
51 |
| -;; 让 spacemacs mode-line 中的 Unicode 图标正确显示。 |
| 58 | +;; Fix the Unicode icon in "spacemacs mode-line". |
52 | 59 | (cnfonts-set-spacemacs-fallback-fonts)
|
53 | 60 |
|
54 | 61 | ;; === Markdown ===
|
|
57 | 64 | (add-to-list 'auto-mode-alist '("\\.html" . jekyll-html-mode))
|
58 | 65 |
|
59 | 66 | ;; === Working directory ===
|
60 |
| -(cond ((eq system-type 'widows) |
61 |
| - (setq wdir "d:/Workspace/org") |
62 |
| - (setq pdir "d:/Workspace/publish")) |
| 67 | +;; https://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html |
| 68 | +(cond ((eq system-type 'windows-nt) |
| 69 | + (setq wdir "D:\\Workspace\\org") |
| 70 | + (setq pdir "D:\\Workspace\\publish")) |
63 | 71 | ((eq system-type 'gnu/linux)
|
64 | 72 | (setq wdir "/home/wsl/workspace/org")
|
65 | 73 | (setq pdir "/home/wsl/workspace/publish"))
|
66 | 74 | )
|
| 75 | +(message "Set workspace wdir as: %s" wdir) |
| 76 | +(message "Set workspace pdir as: %s" pdir) |
67 | 77 |
|
68 | 78 | ;; === Org ===
|
69 | 79 | ;; http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
|
|
202 | 212 | ))
|
203 | 213 |
|
204 | 214 | ;; === Default directory and files ===
|
205 |
| -(message "Set workspace dir as: %s" wdir) |
| 215 | +(message "Change working dir as: %s" wdir) |
206 | 216 | (cd wdir)
|
207 | 217 | (find-file (concat (file-name-as-directory wdir) "todo.org"))
|
208 | 218 | (find-file (concat (file-name-as-directory wdir) "tmp.org"))
|
|
0 commit comments