Skip to content

㌧クス – yewton’s .emacs.d

License

Notifications You must be signed in to change notification settings

yewton/.emacs.d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8d3fb98 · Feb 26, 2025
Feb 26, 2025
Sep 29, 2024
Feb 26, 2025
Sep 28, 2020
Dec 30, 2020
Mar 9, 2022
Jan 9, 2025
Jan 9, 2025
Sep 28, 2020
Apr 11, 2022
Sep 29, 2024
May 2, 2022

Repository files navigation

Banner

㌧クス – yewton’s .emacs.d

使い方

事前準備

依存パッケージのビルドに必要なものをインストールしておきます。

macOS の場合はプロジェクトルートで以下を実行すると全部入ります:

brew bundle

Ubuntu の場合は以下のような感じで:

sudo apt install -y texinfo exa cmake libtool libtool-bin

macOS の場合は、以下のようにして man のページインデックスキャッシュを作っておくとよいです:

sudo mandb $(gmanpath)

ビルド

make を実行すると、設定ファイルを生成したり、依存パッケージをインストールしたりして .emacs.d の準備を整えます。

実行が終わったら、通常通り Emacs を実行すればよいです。

お試し実行

.emacs.d 以外に配置して、 make run を実行すると、既存の .emacs.d を汚さずに動かせます。

この場合は ~emacs –no-init-file~ で起動するので、カスタマイズの保存は出来ません。

特徴

macOS と Ubuntu(Xubuntu) で使えます

普段使っている mac のバージョン情報:

sw_vers
ProductName:macOS
ProductVersion:12.5.1
BuildVersion:21G83

Xubuntu はこっち:

lsb_release -a
Distributor ID:Ubuntu
Description:Ubuntu 22.04 LTS
Release:22.04
Codename:jammy

一部依存する外部コマンドが Xfce 前提になってたりします。

migemo に対応してます

cmigemo のインストールさえ済んでいれば、辞書の設定含めて consult/orderless といい感じに動きます。

SKK による日本語入力に対応してます

ddskk の動作に必要な基本的な辞書のダウンロードとその設定を含めて、インストール時にいい感じにします。

いわゆる Literate Emacs Config です

Org mode でドキュメントと設定を併せて書き、 tangle して使います。

でもちゃんとバイトコンパイルするし、起動時には最小限のライブラリだけ読み込むなどの フツーの Emacs Lisp ベストプラクティスには従うようにしています。

起動処理

bootstrap

通常起動かバッチモードかに依らず、常に実行したい処理です。

ロードパスと autoload の設定が主にやりたいことです。

;;; toncs-bootstrap.el -*- lexical-binding: t; no-byte-compile: t; -*-
(when load-file-name
  (setq user-emacs-directory (file-name-directory load-file-name)))

(defvar el-get-dir (expand-file-name "var/el-get" user-emacs-directory))

(dolist (dir (list (expand-file-name "el-get" el-get-dir)
                   (expand-file-name "lisp" user-emacs-directory)))
    (add-to-list 'load-path dir))

(setq load-prefer-newer t)
(setq package-enable-at-startup nil)

;; cf. https://emacs.stackexchange.com/a/35953/18118
(require 'gnutls)
(add-to-list 'gnutls-trustfiles "/private/etc/ssl/cert.pem")

;; batch モードでいちいち出てくるのはウザいので…
(when noninteractive
  (setq byte-compile-warnings '(not obsolete)))

(defvar el-get-install-skip-emacswiki-recipes t)
(defvar el-get-install-shallow-clone t)
(defvar el-get-byte-compile (not (getenv "EL_GET_SKIP_BYTE_COMPILE")))
(unless (require 'el-get nil t)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.githubusercontent.com/yewton/el-get/yewton-test/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

(require 'toncs-el-get)
(toncs-el-get-init)
(el-get 'sync)
;;; toncs-bootstrap.el ends here

early-init

;;; early-init.el -*- lexical-binding: t; no-byte-compile: t; -*-

Emacs 27 以降導入された仕組みです。

Doom Emacs を参考に、高速化や体験向上に寄与しそうな設定をしています。

(setq gc-cons-threshold most-positive-fixnum)

(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)

(setq frame-inhibit-implied-resize t)

(when load-file-name
  (setq user-emacs-directory (file-name-directory load-file-name))
  (setq user-init-file (expand-file-name "init.el" user-emacs-directory)))

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(defvar toncs-early-init-loaded t)
;;; early-init.el ends here

init

;;; init.el -*- lexical-binding: t; no-byte-compile: t; -*-
(load (locate-user-emacs-file "toncs-bootstrap.el"))

(unless (bound-and-true-p toncs-early-init-loaded)
  (when load-file-name
    (setq user-emacs-directory (file-name-directory load-file-name)))
  (load (locate-user-emacs-file "early-init.el")))
(toncs-init)
(require 'toncs-el-get)
(toncs-el-get-init)
(el-get 'sync)

(when (memq window-system '(mac ns x))
  (require 'exec-path-from-shell)
  (setq exec-path-from-shell-check-startup-files nil)
  (exec-path-from-shell-copy-envs '("PATH" "MANPATH" "LANG" "LC_ALL" "LC_MESSAGES")))

(require 'auto-compile)
(auto-compile-on-load-mode)
(auto-compile-on-save-mode)

(require 'no-littering)

(require 'toncs-config)
(toncs-config-install)

(load custom-file)

(setq gc-cons-threshold (* 2 1000 1000))
;;; init.el ends here

クレジット

アジェンダのカテゴリアイコン

res/task.svg

task
Tasks Icon by freepik from www.flaticon.com

res/routine.svg

routine
Recycling Icon by freepik from www.flaticon.com

res/event.svg

event
Calendar Icon by freepik from www.flaticon.com

res/anniv.svg

anniv
Birthday Cake Icon by freepik from www.flaticon.com

res/leave.svg

leave
Beach Icon by freepik from www.flaticon.com

res/holiday.svg

holiday
Star Icon by freepik from www.flaticon.com

res/log.svg

log
Writing Icon by freepik from www.flaticon.com

res/sprint.svg

sprint
Running Icon by freepik from www.flaticon.com

res/habit.svg

habit
To Do List Icon by freepik from www.flaticon.com

オシャレな README.org の書き方参考元