mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: make emacs gc less annoying
This commit is contained in:
parent
699709c1d6
commit
f85d3dd18e
2 changed files with 17 additions and 13 deletions
|
|
@ -10495,21 +10495,25 @@ When Emacs compiles stuff, it often shows a bunch of warnings that I do not need
|
|||
:PROPERTIES:
|
||||
:CUSTOM_ID: h:1667913c-2272-4010-bf3a-356455b97c83
|
||||
:END:
|
||||
|
||||
This sets up automatic garbage collection when the frame is unused.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq garbage-collection-messages t)
|
||||
(defmacro k-time (&rest body)
|
||||
(setq garbage-collection-messages nil)
|
||||
(defmacro k-time (&rest body)
|
||||
"Measure and return the time it takes evaluating BODY."
|
||||
`(let ((time (current-time)))
|
||||
,@body
|
||||
(float-time (time-since time))))
|
||||
|
||||
|
||||
;; When idle for 15sec run the GC no matter what.
|
||||
(defvar k-gc-timer
|
||||
;; When idle for 15sec run the GC no matter what.
|
||||
(defvar k-gc-timer
|
||||
(run-with-idle-timer 15 t
|
||||
(lambda ()
|
||||
(message "Garbage Collector has run for %.06fsec"
|
||||
(k-time (garbage-collect))))))
|
||||
;; (message "Garbage Collector has run for %.06fsec"
|
||||
(k-time (garbage-collect)))))
|
||||
;; )
|
||||
|
||||
#+end_src
|
||||
*** Indentation
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ create a new one."
|
|||
(setq native-comp-async-report-warnings-errors 'silent) ; Emacs 28 with native compilation
|
||||
(setq native-compile-prune-cache t)) ; Emacs 29
|
||||
|
||||
(setq garbage-collection-messages t)
|
||||
(setq garbage-collection-messages nil)
|
||||
(defmacro k-time (&rest body)
|
||||
"Measure and return the time it takes evaluating BODY."
|
||||
`(let ((time (current-time)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue