Code Monkey home page Code Monkey logo

Comments (1)

peterhoeg avatar peterhoeg commented on June 14, 2024

I work around it by conditionally disabling save on idle if certain modes are enabled. Specifically those involved with formatting-on-save.

(use-package super-save :defer t
  :init
  (doom-load-packages-incrementally '(super-save))

  :config
  (defvar +super-save-disabled-major-modes '()
    "Major modes in which super-save on idle is disabled.")

  (defvar +super-save-disabled-minor-modes '(apheleia-mode format-all-mode)
    "Modes when enabled cause super-save to be disabled.")

  (defvar +super-save-auto-disable-idle 't
    "Automatically disable idle based on major and minor modes.")

  (defun +super-save-auto-disable-idle ()
    "Automatically disable based on major and minor modes."
    (not (or (member major-mode +super-save-disabled-major-modes)
             ;; bound-and-true-p takes a variable, not a symbol
             (-some (lambda (elm) (and (boundp elm) elm))
                    +super-save-disabled-minor-modes))))

  (when +super-save-auto-disable-idle
    (add-to-list 'super-save-predicates #'+super-save-auto-disable-idle))

  (setq auto-save-default nil
        super-save-auto-save-when-idle t
        super-save-idle-duration 30
        super-save-remote-files nil
        super-save-exclude '(".gpg"))
  (super-save-mode +1))

from super-save.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.