diff options
-rw-r--r-- | config.org | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/config.org b/config.org index d45c46e..4bd98cd 100644 --- a/config.org +++ b/config.org | |||
@@ -89,7 +89,7 @@ doesn't work, I'll call git directly and clone the repo myself. | |||
89 | (acdw/bootstrap-straight)) | 89 | (acdw/bootstrap-straight)) |
90 | #+END_SRC | 90 | #+END_SRC |
91 | 91 | ||
92 | ** Customize macros | 92 | ** Ease-of-configuring functions |
93 | 93 | ||
94 | *** Emulate use-package’s =:custom= | 94 | *** Emulate use-package’s =:custom= |
95 | 95 | ||
@@ -120,6 +120,17 @@ doesn't work, I'll call git directly and clone the repo myself. | |||
120 | (add-hook 'after-init-hook #'acdw/set-custom-faces)) | 120 | (add-hook 'after-init-hook #'acdw/set-custom-faces)) |
121 | #+end_src | 121 | #+end_src |
122 | 122 | ||
123 | *** Determine whether any Emacs frame is focused or not | ||
124 | |||
125 | This comes in handy when I want to garbage collect, say, or save recent files. | ||
126 | |||
127 | #+begin_src emacs-lisp | ||
128 | (defun acdw/when-unfocused (func &rest args) | ||
129 | "Run FUNC with ARGS only if all frames are out of focus." | ||
130 | (if (seq-every-p #'null (mapcar #'frame-focus-state (frame-list))) | ||
131 | (apply func args))) | ||
132 | #+end_src | ||
133 | |||
123 | ** Clean =.emacs.d= | 134 | ** Clean =.emacs.d= |
124 | 135 | ||
125 | #+BEGIN_SRC emacs-lisp | 136 | #+BEGIN_SRC emacs-lisp |