/.emacs.d

my emacs config.

Primary LanguageEmacs Lisp

install by nix

nix-env -iA nixpkgs.emacs

nix-env -iA nixpkgs.emacs28NativeComp

install by homebrew

fix mac shortcut

系统偏好设置->键盘->快捷键->App快捷键

  • 取消”显示帮助菜单”
  • 新建一个”表情与符号”快捷键覆盖掉默认的C-M-SPC

(选所有应用程序,菜单标题直接写系统显示的标题,即”表情与符号”)

emacs-plus

https://github.com/d12frosted/homebrew-emacs-plus

brew tap d12frosted/emacs-plus
brew install emacs-plus@28 --with-dbus --with-x11 --with-xwidgets --with-imagemagick --with-native-comp

brew link --overwrite --dry-run emacs-plus@28
brew link --overwrite emacs-plus@28
ln -s /usr/local/opt/emacs-plus@28/Emacs.app /Applications

emacsmacport

https://github.com/railwaycat/homebrew-emacsmacport

brew tap railwaycat/emacsmacport

brew install --cask emacs-mac

# /Applications/Emacs.app/Contents/MacOS/Emacs

compile in debian

https://mirrors.syringanetworks.net/gnu/emacs/

基础依赖

sudo apt-get install libgtk-3-dev libxpm-dev libnettle6 libhogweed4 libx11-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev

gnutls https://gitlab.com/gnutls/gnutls/blob/master/INSTALL.md

# 安装 gmplib
# 安装 nettle
# 安装 libtasn1
# 安装 libunistring

sudo apt-get install m4

# 当 emacs 编译完成后,`readelf -d src/emacs | grep jansson`,如果出现以下表示 native json 编译成功
# 0x0000000000000001 (NEEDED)             共享库:[libjansson.so.4]
sudo apt install libjansson-dev

sudo apt-get install libunistring-dev 安装 libunistring 头文件或手动复制过去

# 安装 p11-kit

# 安装 nettle 后须 export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

# 安装 gnutls 后须将头文件复制到 /usr/include

cp -r gnutls-3.6.16/lib/includes/gnutls /usr/include

安装完所有依赖后,编译前

export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
sudo ldconfig /usr/lib
sudo ldconfig /usr/local/lib
sudo ldconfig /usr/local/lib64

至此,应该能正常编译了

post install

.zshrc 或 .bashrc 需添加以下内容,否则通过终端打开无法输入中文

export LC_CTYPE="zh_CN.UTF-8"

~/.profile 中需添加以下内容

export LC_CTYPE="zh_CN.UTF-8"

# directory-listing-before-filename-regexp 中文日期出现问题
export LC_TIME="en_US.UTF-8"

需要重启