Skip to content

Commit fe476cd

Browse files
authored
Update .emacs
1 parent 18cd3af commit fe476cd

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

.emacs

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
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+
16
;; === Default encoding ===
27
(prefer-coding-system 'utf-8)
38

@@ -6,6 +11,20 @@
611
;; in the early init file.
712
(setq package-enable-at-startup nil)
813

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+
928
;; === Packages configurated by use-package ===
1029
;; https://github.com/jwiegley/use-package#installing-use-package
1130
;; This is only needed once, near the top of the file
@@ -21,18 +40,6 @@
2140
:ensure t
2241
:bind ("M-w" . clipetty-kill-ring-save))
2342

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-
3643
;; === Proxy ===
3744
;; Replace proxy.google.com with your own.
3845
;; (setq url-proxy-services '(
@@ -46,9 +53,9 @@
4653
;; https://github.com/tumashu/cnfonts#org8dffa7c
4754
;; M-X package-install RET cnfonts RET
4855
(require 'cnfonts)
49-
;; cnfonts 随着 Emacs 自动生效。
56+
;; Let cnfonts enabled.
5057
(cnfonts-enable)
51-
;; spacemacs mode-line 中的 Unicode 图标正确显示。
58+
;; Fix the Unicode icon in "spacemacs mode-line".
5259
(cnfonts-set-spacemacs-fallback-fonts)
5360

5461
;; === Markdown ===
@@ -57,13 +64,16 @@
5764
(add-to-list 'auto-mode-alist '("\\.html" . jekyll-html-mode))
5865

5966
;; === 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"))
6371
((eq system-type 'gnu/linux)
6472
(setq wdir "/home/wsl/workspace/org")
6573
(setq pdir "/home/wsl/workspace/publish"))
6674
)
75+
(message "Set workspace wdir as: %s" wdir)
76+
(message "Set workspace pdir as: %s" pdir)
6777

6878
;; === Org ===
6979
;; http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
@@ -202,7 +212,7 @@
202212
))
203213

204214
;; === Default directory and files ===
205-
(message "Set workspace dir as: %s" wdir)
215+
(message "Change working dir as: %s" wdir)
206216
(cd wdir)
207217
(find-file (concat (file-name-as-directory wdir) "todo.org"))
208218
(find-file (concat (file-name-as-directory wdir) "tmp.org"))

0 commit comments

Comments
 (0)