Doom Emacs 一些好用的地方

Posted on December 10, 2025
Tags:

Table of Contents

  1. sudo-this-file
  2. Add source code refs for native functions

sudo-this-file

无意间在使用 Doom Emacs 时发现当尝试 doom/sudo-this-file 。 在以只读模式打开某些系统配置文件时,同时需要编辑该文件,此时只需在这个打开的 buffer 中执行 doom/sudo-this-file 即可。 函数如其名,好用!

Add source code refs for native functions

(use-package! find-func
  :custom
  (find-function-C-source-directory "~/projects/github/2024/emacs/src"))

这样在使用 helpful-callable 时,如果选择的是 emacs 的 C 函数而非 elisp 函数时, 可以在 helpful buffer 中提示定义在 C 源代码中函数的源代码路径。