Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

super-save isn't working with the window-numbering package #17

Closed
ghost opened this issue Dec 12, 2016 · 1 comment
Closed

super-save isn't working with the window-numbering package #17

ghost opened this issue Dec 12, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 12, 2016

Hello,

I'm using Spacemacs and it has a feature to number all Emacs windows from 1, 2, 3... using the window-numbering package: https://github.com/nschum/window-numbering.el

When editing a file with super-save is enabled, the file is not automatically saved when I move the cursor to a new window by using the select-window-... function from window-numbering.el package.

Given the code of the core function of select-window-by-number as follow, can you advise how to hook super-save with the code that changes the window (setq window (aref windows i))?

(defun select-window-by-number (i &optional arg)
  "Select window given number I by `window-numbering-mode'.
If prefix ARG is given, delete the window instead of selecting it."
  (interactive "P")
  (let ((windows (car (gethash (selected-frame) window-numbering-table)))
        window)
    (if (and (>= i 0) (< i 10)
             (setq window (aref windows i)))
        (if arg
            (delete-window window)
          (select-window window))
      (error "No window numbered %s" i))))

Thanks!

@bbatsov
Copy link
Owner

bbatsov commented Sep 30, 2018

I guess you just need this in your config:

(add-to-list 'super-save-triggers 'select-window-by-number)

@bbatsov bbatsov closed this as completed Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant