bbatsov / super-save

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

Can I have different values for "super-save-idle-duration" according to mode? #26

Open alienbogart opened 5 years ago

alienbogart commented 5 years ago

Runtime Environment

Issue

I'm unable to do it in this way:

(defun my/set-save ()
  (interactive)
  (setq super-save-idle-duration 2))
(add-hook 'web-mode-hook 'my/web-mode-hooks)

Even though the variable is actually set, is has no effect on the saving behavior. setq-local doesn't work either.

That's my use-package for super-save:

(use-package super-save
  :ensure t
  :config

  (setq super-save-triggers
        '(switch-to-buffer
          other-window
          windmove-up
          windmove-down
          windmove-left
          windmove-right
          next-buffer
          previous-buffer
          evil-window-prev
          evil-window-next
          eyebrowse-next-window-config
          eyebrowse-prev-window-config
          eyebrowse-create-window-config))

  (setq super-save-auto-save-when-idle t)

  (setq auto-save-default nil)
  (super-save-mode +1))