首页 > 解决方案 > 它在 find-file-hook 的变量中引用哪个文件

问题描述

读完函数find-file-hook,我很困惑。

据记载:

从文件加载缓冲区后要调用的函数的文档列表。缓冲区的局部变量(如果有)将在调用函数之前进行处理。

(defcustom find-file-hook nil
  "List of functions to be called after a buffer is loaded from a file.
The buffer's local variables (if any) will have been processed before the
functions are called."

在文件加载到缓冲区后执行的变量保持函数,分解步骤,

1) 查找文件 2) 加载到缓冲区 3) 执行函数。

该函数定义了步骤 3 中的操作,为什么调用find-file它,它正在查找哪个文件?

标签: elisp

解决方案


我不确定这个术语是从哪里来的,但是 Emacs 使用“查找文件”这个表达式来进行大多数其他程序称为“打开文件”的操作。它与按名称搜索文件等没有任何关系。


推荐阅读