mirror of
https://github.com/dongdigua/dongdigua.github.io
synced 2024-11-30 23:30:53 +08:00
100 lines
4.3 KiB
Org Mode
100 lines
4.3 KiB
Org Mode
#+TITLE: 2023 了, 试试 emacs 29
|
|
#+DATE: <2023-01-02 一>
|
|
#+OPTIONS: toc:1
|
|
|
|
2023 了, 元旦假期, 想体验一下新版本的 emacs, 我已经眼馋好久了
|
|
发行版还没提供? 自己编译, 而且自己编译可以自定义一些选项, 比如 pgtk
|
|
完整的新特性去看 =etc/NEWS= (btw, =emacs-news-mode= 也是新加的)
|
|
|
|
* build emacs (with musl?)
|
|
gcc (it's GNU emacs, so...) 参数来源:
|
|
- https://zhuanlan.zhihu.com/p/172518559
|
|
- https://snoopitek.com/make.conf
|
|
#+BEGIN_SRC sh
|
|
./configure CFLAGS="-march=native -O3 -pipe -fno-math-errno -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -fno-strict-aliasing -fno-common -fipa-pta -fno-plt" \
|
|
LDFLAGS="-Wl,-no-as-needed -ljemalloc -Wl,-as-needed" \
|
|
--with-x=no \
|
|
--with-gpm=no \
|
|
--with-pgtk \
|
|
--with-native-compilation \
|
|
--with-json \
|
|
--with-sqlite3 \
|
|
--with-tree-sitter \
|
|
--with-webp \
|
|
--with-gif
|
|
#+END_SRC
|
|
|
|
@@html:<details>@@
|
|
@@html:<summary>but what about musl? (CC=musl-gcc)</summary>@@
|
|
#+BEGIN_SRC text
|
|
checking whether GTK compiles... no
|
|
configure: error: Gtk+ wanted, but it does not compile, see config.log.
|
|
#+END_SRC
|
|
|
|
#+BEGIN_SRC text
|
|
<dongdigua> hello, I tried to build emacs with musl-gcc, but it says:
|
|
<dongdigua> error: Gtk+ wanted, but it does not compile
|
|
<dongdigua> it can build using normal gcc
|
|
<dongdigua> and it can build on voidlinux
|
|
<sam_> dalias: <3
|
|
<dongdigua> o_O
|
|
<sam_> dongdigua: you'd have to share some logs in full for us to help at all
|
|
<sam_> but you'd be better off asking your Linux distribution
|
|
<dongdigua> it is mostly `ld: error: unable to find library`
|
|
<dongdigua> sam_: so i think it is probably something about the wrapper script
|
|
<heat> musl-gcc (does not? should not?) pick up on host libraries because they
|
|
were built against glibc and not musl
|
|
<heat> so musl-gcc will not pick up on those
|
|
<heat> or at least they will just not work and will break configure
|
|
<dongdigua> heat: so I should use those libraries that is built on musl?
|
|
<dongdigua> like voidlinux I mentioned above
|
|
<heat> yes
|
|
<dongdigua> ok
|
|
ERC>
|
|
#+END_SRC
|
|
@@html:</details>@@
|
|
|
|
* dump?
|
|
现在开启 =native-comp= 时 =dump-emacs-portable= 没法弄, 见: [[https://emacs-china.org/t/emacs-29-with-native-comp-dump/22762][emacs china: emacs 29 with native-comp 无法 dump]]
|
|
+试着不开 native-comp dump 了一下, 也就加快了 0.2s, 而且有各种问题, 算啦算啦+
|
|
作为一个追求极致的人, 怎么能算了! 不能 dump 已经 dump 的 emacs, 那就放到第一步的 dump 里.
|
|
在 [[https://git.savannah.gnu.org/cgit/emacs.git/tree/INSTALL#n516][INSTALL]] 文件里说了, 自定义的配置放在 =site-init.el=
|
|
我把一些必要的配置用 =;;;ifdef dump= =;;;endif= 包上, 然后随便写一个[[https://github.com/dongdigua/configs/blob/main/epp.ex][脚本]], 只保留之间的部分.
|
|
|
|
这些 "必要的配置" 是主要 GUI 相关的和不须要额外包的配置,
|
|
dump GUI 的配置很好, 之前会看到 窗口缩放以及 tool-bar 和 menu-bar 一闪而过, 现在好了.
|
|
(GUI 模式) 这为我节省了 (0.8 - 0.6)s 和(14 - 12)次 gc
|
|
|
|
btw, 后来我用 =(setq use-package-verbose t)= 找出来了一个我一直不咋用但是还启动时加载的包: ement,
|
|
加上另外几个包也都 defer, 降到 0.4s 了
|
|
|
|
* 我 有切身体会/还没体验但是认为很不错 的新特性
|
|
** [[https://emacs-china.org/t/emacs/19806]["真" 背景透明]]
|
|
这是我提前了解到的第一个 emacs29 特性, [[https://www.bilibili.com/video/BV1ca41127KY][evan 的视频]]
|
|
但是有透明通道的图片不会跟着透明
|
|
|
|
** [[https://www.emacswiki.org/emacs/SmoothScrolling][平滑滚动]]
|
|
搜索 emacs29 蹦出来的
|
|
|
|
** elisp-byte-compile-file
|
|
|
|
** emoji 😀
|
|
|
|
** package-vc-install
|
|
但是 =package-report-bug= 有点迷惑
|
|
|
|
* 我认为早就该加了但是现在才加入
|
|
** erc-sasl
|
|
我编译的时候偶然发现的 =erc-sasl.el=
|
|
我去! 终于有 sasl 了! 不用第三方的 [[https://github.com/emacs-circe/circe][circe]] 了!
|
|
*只需要 customize =erc-modules= 加入 sasl, 然后用 =erc-tls= 就成了*
|
|
这个最早 12 年就有人提出了 ([[https://lists.gnu.org/archive/html/erc-discuss/2012-02/msg00001.html][注释里给的链接]])
|
|
|
|
** restart-emacs
|
|
|
|
** package-update(-all)
|
|
|
|
* 29.1
|
|
- =use-package=
|
|
- more =*-ts-mode=
|