changed concating file and dirs into expand-file-name, and other minor improvements
This commit is contained in:
parent
efa4fd373e
commit
2a73871d40
|
|
@ -9,6 +9,10 @@ This configuration works best on a GNU/Linux Platform, other platforms are untes
|
||||||
Obviously, a full Emacs distribution needs to be installed.
|
Obviously, a full Emacs distribution needs to be installed.
|
||||||
Other external dependencies is (usually) specified in their configuration.
|
Other external dependencies is (usually) specified in their configuration.
|
||||||
|
|
||||||
|
*** Mail
|
||||||
|
For RMail to work, a mail syncer like mbsync needs to be installed.
|
||||||
|
And for emacs RMail to be able to read mbsync maildir format, GNU Mailutils is also needed to be installed
|
||||||
|
|
||||||
*** Language Servers
|
*** Language Servers
|
||||||
For Language servers to work, the language servers needs to be installed separately, for example, in Fedora Linux, the required language servers can be installed by running the command below
|
For Language servers to work, the language servers needs to be installed separately, for example, in Fedora Linux, the required language servers can be installed by running the command below
|
||||||
|
|
||||||
|
|
|
||||||
7
gnus.el
7
gnus.el
|
|
@ -22,8 +22,8 @@
|
||||||
;; as the writer has no access to actual news servers,
|
;; as the writer has no access to actual news servers,
|
||||||
;; and so gnus is used as a mail reader instead of UUCP news
|
;; and so gnus is used as a mail reader instead of UUCP news
|
||||||
(require 'imap)
|
(require 'imap)
|
||||||
(setq gnus-select-method `
|
(setq gnus-select-method
|
||||||
(nnimap ,(cdr (assoc 'name main-mail-server))
|
`(nnimap ,(cdr (assoc 'name main-mail-server))
|
||||||
(nnimap-address ,(cdr (assoc 'imap-url main-mail-server)))
|
(nnimap-address ,(cdr (assoc 'imap-url main-mail-server)))
|
||||||
(nnimap-server-port ,(cdr (assoc 'imap-port main-mail-server)))
|
(nnimap-server-port ,(cdr (assoc 'imap-port main-mail-server)))
|
||||||
(nnimap-stream ,(cdr (assoc 'imap-stream main-mail-server)))
|
(nnimap-stream ,(cdr (assoc 'imap-stream main-mail-server)))
|
||||||
|
|
@ -31,8 +31,7 @@
|
||||||
gnus-secondary-select-methods
|
gnus-secondary-select-methods
|
||||||
`((nnmaildir "local"
|
`((nnmaildir "local"
|
||||||
(directory
|
(directory
|
||||||
,(concat (safe-getenv "HOME" user-home-dir-path)
|
,(expand-file-name ".local/mails/disroot/" (safe-getenv "HOME" user-home-path))))))
|
||||||
"/.local/mails/disroot/")))))
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Demon
|
;; Demon
|
||||||
|
|
|
||||||
2
init.el
2
init.el
|
|
@ -18,5 +18,5 @@
|
||||||
(let ((config-file-pattern "\\.org$"))
|
(let ((config-file-pattern "\\.org$"))
|
||||||
(mapc #'org-babel-load-file
|
(mapc #'org-babel-load-file
|
||||||
(directory-files
|
(directory-files
|
||||||
(concat user-emacs-config-directory "/init.org.d")
|
(expand-file-name "init.org.d" user-emacs-config-directory)
|
||||||
t config-file-pattern)))
|
t config-file-pattern)))
|
||||||
|
|
|
||||||
|
|
@ -13,21 +13,21 @@ Functions needed at the start of the configuration
|
||||||
set the directory for emacs and it's apps to put stuff.
|
set the directory for emacs and it's apps to put stuff.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq user-emacs-directory
|
(setq user-emacs-directory
|
||||||
(concat (safe-getenv "XDG_DATA_HOME" "~/.local/share") "/emacs"))
|
(expand-file-name "emacs" (safe-getenv "XDG_DATA_HOME" "~/.local/share")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Custom File
|
* Custom File
|
||||||
This emacs feature is currently not used since a way to integrate this feature into this kind of configuration.
|
This emacs feature is currently not used since a way to integrate this feature into this kind of configuration.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq custom-file (concat user-emacs-directory "/custom.el"))
|
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Personal File
|
* Personal File
|
||||||
This file stores variables containing personal information, and is not distributed.
|
This file stores variables containing personal information, and is not distributed.
|
||||||
A sample of this file though is included in this config to be used
|
A sample of this file though is included in this config to be used
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(let ((personal-file-path (concat user-emacs-config-directory "/personal.org"))
|
(let ((personal-file-path (expand-file-name "personal.org" user-emacs-config-directory))
|
||||||
(sample-personal-file-path (concat user-emacs-config-directory "/personal-sample.org")))
|
(sample-personal-file-path (expand-file-name "/personal-sample.org" user-emacs-config-directory )))
|
||||||
|
|
||||||
;; load main personal file if it exists
|
;; load main personal file if it exists
|
||||||
(if (file-exists-p personal-file-path)
|
(if (file-exists-p personal-file-path)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ this speeds up emacs startup
|
||||||
|
|
||||||
** Set Package Directory
|
** Set Package Directory
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq package-user-dir (concat (safe-getenv "XDG_DATA_HOME" "~/.local/share") "/emacs/packages"))
|
(setq package-user-dir (expand-file-name "emacs/packages" (safe-getenv "XDG_DATA_HOME" "~/.local/share")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Add package sources
|
** Add package sources
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ Make header and document title fonts bigger for better visibility.
|
||||||
:custom
|
:custom
|
||||||
(org-hide-emphasis-markers nil)
|
(org-hide-emphasis-markers nil)
|
||||||
(org-agenda-files
|
(org-agenda-files
|
||||||
`(,(concat (safe-getenv "HOME" user-home-path) "/shared/org")))
|
`(,(expand-file-name "shared/org" (safe-getenv "HOME" user-home-path))))
|
||||||
|
|
||||||
:config
|
:config
|
||||||
;; font setup
|
;; font setup
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ this file/section configures the UI settings
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(scroll-bar-mode 1)
|
(scroll-bar-mode -1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Maximize
|
* Maximize
|
||||||
|
|
@ -19,7 +19,24 @@ this file/section configures the UI settings
|
||||||
;; (add-hook 'window-setup-hook 'toggle-frame-maximized t)
|
;; (add-hook 'window-setup-hook 'toggle-frame-maximized t)
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
* Window Size
|
||||||
|
Set the default window size when making a new frame
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun set-window-size ()
|
||||||
|
(add-to-list 'default-frame-alist '(width . 80))
|
||||||
|
(add-to-list 'default-frame-alist '(height . 40))
|
||||||
|
(add-to-list 'initial-frame-alist '(width . 80))
|
||||||
|
(add-to-list 'initial-frame-alist '(height . 40)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
run the function at startup of a frame
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(when (display-graphic-p)
|
||||||
|
(set-window-size))
|
||||||
|
(add-hook 'before-make-frame-hook 'set-window-size)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Fringes
|
* Fringes
|
||||||
Fringes are the small gap at the side of emacs.
|
Fringes are the small gap at the side of emacs.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,13 @@ Tree-sitter Syntax Highlighting website]]
|
||||||
:after tree-sitter)
|
:after tree-sitter)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
* Imenu-list
|
||||||
|
Imenu, the tool to get function names in source codes in emacs, displayed and constantly updated in a separate buffer
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package imenu-list
|
||||||
|
:commands (imenu-list-minor-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Neotree
|
* Neotree
|
||||||
Tree-based explorer for Emacs
|
Tree-based explorer for Emacs
|
||||||
|
|
||||||
|
|
@ -30,10 +37,11 @@ Tree-based explorer for Emacs
|
||||||
:hook (neotree-mode . (lambda ()
|
:hook (neotree-mode . (lambda ()
|
||||||
(setq mode-line-format nil)
|
(setq mode-line-format nil)
|
||||||
(redraw-display)))
|
(redraw-display)))
|
||||||
:config
|
:custom
|
||||||
(setq neo-theme 'arrows)
|
(neotheme 'arrows)
|
||||||
(setq neo-window-fixed-size nil)
|
(neo-window-fixed-size t)
|
||||||
(setq neo-smart-open t)
|
(neo-smart-open t)
|
||||||
|
(neo-window-width 22)
|
||||||
|
|
||||||
:bind
|
:bind
|
||||||
("M-0" . neotree-toggle))
|
("M-0" . neotree-toggle))
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ machine smtp.example.com login jamie@example.com password verysecurepass port 58
|
||||||
* Gnus Config
|
* Gnus Config
|
||||||
Tell gnus to read ~gnus.el~ from the config dir.
|
Tell gnus to read ~gnus.el~ from the config dir.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq gnus-init-file (concat user-emacs-config-directory "/gnus.el"))
|
(setq gnus-init-file (expand-file-name "gnus.el" user-emacs-config-directory))
|
||||||
|
; (setq gnus-init-file "/home/iang/.config/emacs/gnus.el")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
other configuration on gnus is on the ~gnus.el~ file.
|
other configuration on gnus is on the ~gnus.el~ file.
|
||||||
|
|
@ -39,11 +40,11 @@ And those external programs are;
|
||||||
** Configuration
|
** Configuration
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq rmail-primary-inbox-list
|
(setq rmail-primary-inbox-list
|
||||||
`( ,(concat "maildir://" (concat (safe-getenv "HOME" user-home-path) "/.local/mails/disroot/INBOX"))
|
`( ,(concat "maildir://" (expand-file-name ".local/mails/disroot/INBOX" (safe-getenv "HOME" user-home-path)))
|
||||||
"/var/spool/mail/iang")
|
"/var/spool/mail/iang")
|
||||||
rmail-preserve-inbox 1
|
rmail-preserve-inbox 1
|
||||||
rmail-mime-prefer-html nil
|
rmail-mime-prefer-html nil
|
||||||
rmail-file-name (concat user-emacs-directory "/mails/inbox"))
|
rmail-file-name (expand-file-name "mails/inbox" user-emacs-directory))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* SMTP Mail Config
|
* SMTP Mail Config
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,7 @@
|
||||||
(company-mode))
|
(company-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
* Built-in Modes
|
* Built-in Modes
|
||||||
|
|
||||||
|
|
||||||
** hook default settings to configured language modes
|
** hook default settings to configured language modes
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(let ((langs '("sh" "c++" "mhtml" "java" "js" "python" "latex")))
|
(let ((langs '("sh" "c++" "mhtml" "java" "js" "python" "latex")))
|
||||||
|
|
@ -26,12 +23,12 @@
|
||||||
|
|
||||||
** add LSP server program names to eglot's configuration
|
** add LSP server program names to eglot's configuration
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(let ((server-programs '((c++-mode . ("clangd"))
|
(let ((server-programs '((c++-mode . ("clangd" "--stdio"))
|
||||||
(mhtml-mode . ("html-language-server"))
|
(mhtml-mode . ("html-language-server" "--stdio"))
|
||||||
(java-mode . ("jdtls"))
|
(java-mode . ("jdtls" "--stdio"))
|
||||||
(js-mode . ("typescript-language-server"))
|
(js-mode . ("typescript-language-server" "--stdio"))
|
||||||
(python-mode . ("pyright"))
|
(python-mode . ("pyright-langserver" "--stdio"))
|
||||||
(latex-mode . ("texlab")))))
|
(latex-mode . ("texlab" "--stdio")))))
|
||||||
(setq eglot-server-programs (append server-programs eglot-server-programs)))
|
(setq eglot-server-programs (append server-programs eglot-server-programs)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -67,3 +64,13 @@
|
||||||
:init
|
:init
|
||||||
(setq markdown-command "multimarkdown"))
|
(setq markdown-command "multimarkdown"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Python Pyenv
|
||||||
|
python venv manager
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package pyvenv
|
||||||
|
:commands (pyvenv-mode pyvenv-activate pyvenv-workon pyvenv-exec-shell pyvenv-virtual-env)
|
||||||
|
:hook (python-mode . pyvenv-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ Elfeed is a emacs package for reading RSS Web News.
|
||||||
elfeed
|
elfeed
|
||||||
elfeed-update
|
elfeed-update
|
||||||
:custom
|
:custom
|
||||||
(elfeed-db-directory (concat user-emacs-directory "/elfeed")
|
(elfeed-db-directory (expand-file-name "elfeed" user-emacs-directory)
|
||||||
"location for elfeed to put it's database")
|
"location for elfeed to put it's database")
|
||||||
(elfeed-feeds '(("https://feeds.bbci.co.uk/news/technology/rss.xml" bbc technology)
|
(elfeed-feeds '(("https://feeds.bbci.co.uk/news/technology/rss.xml" bbc technology)
|
||||||
("https://feeds.feedburner.com/rsscna/engnews" taiwan central focustaiwan)
|
("https://feeds.feedburner.com/rsscna/engnews" taiwan central focustaiwan)
|
||||||
|
|
|
||||||
3
todo.org
3
todo.org
|
|
@ -1,8 +1,9 @@
|
||||||
* Things to Improve in this configuration
|
* Things to Improve in this configuration
|
||||||
** To Fix
|
** To Fix
|
||||||
|
- [ ] set chinese font
|
||||||
- [X] stop using custom file
|
- [X] stop using custom file
|
||||||
- [X] separate font config
|
- [X] separate font config
|
||||||
- [X] add optimizations ==> dolist
|
- [X] add optimizations ==> dolist
|
||||||
- [X] org-mode indentation
|
- [X] org-mode indentation
|
||||||
** Add
|
** Add
|
||||||
- [ ] use gnus
|
- [X] use gnus
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue