Browse Source

[emacs] Small hack for fd overload in macOS

Colin Powell 2 năm trước cách đây
mục cha
commit
df01936c7f
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      emacs/.config/doom/config.org

+ 13 - 0
emacs/.config/doom/config.org

@@ -14,6 +14,18 @@ From a friend at [[https://discord.com/channels/406534637242810369/6954505857589
 #+BEGIN_SRC emacs-lisp
 ;;(setq ivy-read-action-function #'ivy-hydra-read-action)
 #+END_SRC
+
+Sometimes macOS hates us (file descriptors overload)
+#+begin_src emacs-lisp
+(defun file-notify-rm-all-watches ()
+  "Remove all existing file notification watches from Emacs."
+  (interactive)
+  (maphash
+   (lambda (key _value)
+     (file-notify-rm-watch key))
+   file-notify-descriptors))
+
+#+end_src
 * User interface
 ** Fonts and themes
 I change my default theme almost as often as the weather. I tend to revert back
@@ -78,6 +90,7 @@ border.
         :desc "Search in eww"           "3" #'eww-search-words
         :desc "Search all the things"   "g" #'deadgrep))
 #+END_SRC
+
 * Music
 Right now, just make sure I can connect to my local Mopidy server via MPDel.