branch: externals/fontaine
commit 1ae260fb1d8150d456aacc1a5ab905c575120f03
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Make fontaine-set-preset-hook a defcustom
    
    Before, it was hard for users to discover it.
---
 README.org  |  4 ++++
 fontaine.el | 13 +++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 6434b4e33d..a7f49ddcba 100644
--- a/README.org
+++ b/README.org
@@ -130,6 +130,10 @@ applies the effects to the given object, while the latter 
means the
 current frame and thus is the same as interactively supplying the prefix
 argument.
 
+#+vindex: fontaine-set-preset-hook
+As a final step, ~fontaine-set-preset~ calls the ~fontaine-set-preset-hook~.
+[ This is part of {{{development-version}}}. ]
+
 #+findex: fontaine-set-face-font
 #+vindex: fontaine-font-families
 The command ~fontaine-set-face-font~ prompts with completion for a face
diff --git a/fontaine.el b/fontaine.el
index 8938fe71f2..8648a8c5bc 100644
--- a/fontaine.el
+++ b/fontaine.el
@@ -362,6 +362,12 @@ combine the other two lists."
   :package-version '(fontaine . "0.2.0")
   :group 'fontaine)
 
+(defcustom fontaine-set-preset-hook nil
+  "Hook that runs after setting fonts with `fontaine-set-preset'."
+  :type 'hook
+  :package-version '(fontaine . "1.1.0")
+  :group 'fontaine)
+
 ;;;; General utilities
 
 (defun fontaine--frame (frame)
@@ -517,9 +523,6 @@ ARGS are its routines."
       (fontaine--presets-no-fallback)
       nil t nil 'fontaine--font-display-hist def))))
 
-(defvar fontaine-set-preset-hook nil
-  "Hook that runs after setting fonts.")
-
 (defvar fontaine-current-preset nil
   "Current font set in `fontaine-presets'.
 This is the preset last used by `fontaine-set-preset'.  Also see
@@ -542,7 +545,9 @@ argument (\\[universal-argument]), FRAME is interpreted as
 non-nil.
 
 Set `fontaine-current-preset' to PRESET.  Also see the command
-`fontaine-apply-current-preset'."
+`fontaine-apply-current-preset'.
+
+Call `fontaine-set-preset-hook' as a final step."
   (interactive
    (list
     (if (= (length fontaine-presets) 1)

Reply via email to