Commit 26b04dbd authored by Jason Blevins's avatar Jason Blevins

Add hook that runs after Deft opens a file

Also add documentation for all existing hooks.
parent f17af863
......@@ -350,6 +350,10 @@ also be customized. By default, these faces inherit their
properties from the standard font-lock faces defined by your current
color theme.
Deft also provides several hooks: `deft-mode-hook`,
`deft-filter-hook`, and `deft-open-file-hook`. See the
documentation for these variables for further details.
Acknowledgments
---------------
......
......@@ -376,6 +376,10 @@
;; properties from the standard font-lock faces defined by your current
;; color theme.
;; Deft also provides several hooks: `deft-mode-hook',
;; `deft-filter-hook', and `deft-open-file-hook'. See the
;; documentation for these variables for further details.
;; Acknowledgments
;; ---------------
......@@ -732,6 +736,9 @@ or kebab-case
(defvar deft-filter-hook nil
"Hook run when the Deft filter string changes.")
(defvar deft-open-file-hook nil
"Hook run after Deft opens a file.")
(defvar deft-filter-regexp nil
"A list of string representing the current filter used by Deft.
......@@ -1244,6 +1251,7 @@ FILE must be a relative or absolute path, with extension."
(deft-cache-update-file buffer-file-name)
(deft-refresh-filter)))
nil t))
(run-hooks 'deft-open-file-hook)
(if other
(if switch
(switch-to-buffer-other-window buffer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment