bbatsov / super-save

Save Emacs buffers when they lose focus
313 stars 20 forks source link

Changing "super-save-idle-duration" has no effect unless I reboot #33

Closed alienbogart closed 2 years ago

alienbogart commented 4 years ago

My Environment

Issue

Setting and evaluating super-save-idle-duration to any value has no effect whatsoever. The only way to change it is to reboot Emacs completely. It is also not possible to use setq-local to set different values for different modes.

This is my use-package declaration for super-save:

(use-package super-save
  :defer nil
  :ensure t
  :config
  (setq auto-save-default nil
        auto-save-file-name-transforms `((".*" "~/.emacs.d/var/temp" t))
        auto-save-interval 300
        auto-save-timeout 30
        auto-save-visited-mode t
        super-save-exclude '(".py")
        super-save-auto-save-when-idle t
        super-save-idle-duration 1
        super-save-triggers
        '(balance-windows
          evil-window-next
          evil-window-prev
          eyebrowse-close-window-config
          eyebrowse-create-window-config
          my/no-highlight
          eyebrowse-next-window-config
          eyebrowse-prev-window-config
          eyebrowse-switch-to-window-config-1
          eyebrowse-switch-to-window-config-2
          eyebrowse-switch-to-window-config-3
          eyebrowse-switch-to-window-config-4
          eyebrowse-switch-to-window-config-5
          eyebrowse-switch-to-window-config-6
          eyebrowse-switch-to-window-config-7
          eyebrowse-switch-to-window-config-8
          eyebrowse-switch-to-window-config-9
          next-buffer
          org-babel-execute-src-block
          other-window
          previous-buffer
          split-window-below
          split-window-horizontally
          start-process-shell-command
          switch-to-buffer
          treemacs-select-window
          windmove-down
          windmove-left
          windmove-right
          windmove-up))

  (super-save-mode +1))
kamoii commented 4 years ago

@mrbig033 The idle timmer is global and only set once when (super-save-mode +1) is called. So if you want to change it, you need to first disable super-save-mode, change the value and turn on super-save-mode again by (super-save-mode +1).

Also if you want a buffer local setting for super-save-idle-duration, you need to customize the code since currently its is implemented globally.