Parcourir la source

Add ido-cr+-before-fallback-hook

Ryan C. Thompson il y a 8 ans
Parent
commit
08fba595d4
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      ido-completing-read+.el

+ 6 - 0
ido-completing-read+.el

@@ -78,6 +78,11 @@ Debug info is printed to the *Messages* buffer."
 
 These are used for falling back to `completing-read-default'.")
 
+(defvar ido-cr+-before-fallback-hook nil
+  "Hook run when ido-cr+ triggers a fallback.
+
+The hook is run right before calling `ido-cr+-fallback-function'.")
+
 (defgroup ido-completing-read-plus nil
   "Extra features and compatibility for `ido-completing-read'."
   :group 'ido)
@@ -275,6 +280,7 @@ completion for them."
       ;; Handler for ido-cr+-fallback signal
       (ido-cr+-fallback
        (ido-cr+--explain-fallback sig)
+       (run-hooks 'ido-cr+-before-fallback-hook)
        (apply ido-cr+-fallback-function ido-cr+-orig-completing-read-args)))))
 
 ;;;###autoload