Code Monkey home page Code Monkey logo

Comments (3)

bbatsov avatar bbatsov commented on June 14, 2024

That'd be trivial to add. We can just add something similar to the auto-save for a single file as shown here https://github.com/bbatsov/super-save/blob/master/super-save.el#L103

That being said I don't quite get the need for such a command - if you're already super-saving everything why would need a command that periodically saves all buffers? Usually the only buffer that can potentially be unsaved is the current one.

from super-save.

JJPandari avatar JJPandari commented on June 14, 2024

Sorry, I thought mouse-leave-buffer-hook only works when actually using the mouse, so I removed it from the super-save-hook-triggers. Adding it back makes "the only buffer potentially unsaved is the current one" true.

However I also found some problem with mouse-leave-buffer-hook: switch-to-buffer and other-window do trigger it, but neither winum-select-window-1 nor spacemacs/alternate-window triggers it, which I use more often when switching windows. Their definitions are as follows:

(defun spacemacs/alternate-window ()
  "Switch back and forth between current and last window in the
current frame."
  (interactive)
  (let (;; switch to first window previously shown in this frame
        (prev-window (get-mru-window nil t t)))
    ;; Check window was not found successfully
    (unless prev-window (user-error "Last window not found."))
    (select-window prev-window)))

(defun winum--switch-to-window (window)
  "Switch to the window WINDOW and switch input focus if on a different frame."
  (let ((frame (window-frame window)))
    (when (and (frame-live-p frame)
               (not (eq frame (selected-frame))))
      (select-frame-set-input-focus frame))
    (if (window-live-p window)
        (select-window window)
      (error "Got a dead window %S" window))))

As of the save-all-buffers feature, it makes file watchers trigger less constantly, reducing cpu/power use. Also I sometimes look at the file-saved indicator in mode-line to see "haved I undo-ed to last save?", so I want the saving happen when I switch to the browser, "I'm certain about the last few edits now, save them and see how the web page looks now". But sure, these aren't common needs and sound a bit paranoid. I'll think again and implement it myself or just ditch the idea.

from super-save.

cireu avatar cireu commented on June 14, 2024

@JJPandari @bbatsov I've implemented this feature, it will be optional and closed by default, see #20

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.