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

How to hook a function when all buffers load? #874

Open
danielkrajnik opened this issue May 29, 2023 · 0 comments
Open

How to hook a function when all buffers load? #874

danielkrajnik opened this issue May 29, 2023 · 0 comments

Comments

@danielkrajnik
Copy link

danielkrajnik commented May 29, 2023

I'm trying to clear the clutter that is created when opening .ipynb file by default - unfortunately this doesn't work. I assume that this must fire before all buffers are created.

(add-hook 'ein:ipynb-mode-hook
          (lambda ()
            (cl-letf (((symbol-function 'read-directory-name)
                       (lambda (_prompt dir &rest _args) dir)))
              (ein:process-find-file-callback)
              (mapc 'switch-to-buffer
                     (cl-remove-if-not (lambda (b)
                      (and
                       (string-match-p "ein" (buffer-name b))
                       (string-match-p "ipynb" (buffer-name b))))
                    (buffer-list)))
              (delete-other-windows)
                )))

Is there any way to wait until everything is ready to run it?

You really just want to open that rendered buffer - it really isn't necessary to split the workspace or keep raw json buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant