Search code examples
elisp

which file it refer to in variable of find-file-hook


Upon reading the function find-file-hook, I get very confused.

it is documented that:

Documentation 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.

(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."

The variable hold functions that are executed after a file is loaded to the buffer, break the steps down,

1) find file 2) load to buffer 3) execute the function.

The function define the operations on step 3, why it is called find-file, which file it is finding?


Solution

  • I'm not sure where this terminology comes from, but Emacs uses the expression "find file" for the operation that most other programs call "open file". It doesn't have anything to do with searching for a file by name, etc.