Giter VIP home page Giter VIP logo

Comments (10)

hlissner avatar hlissner commented on June 4, 2024 1

@lroolle After some investigation, turns out this wasn't actually a bug, it's just necessary to use zoom-mode instead of calling zoom directly. zoom-mode advises pre-redisplay-function, where it calls zoom--update from a stable "current window".

Without this, it can lose track of the current window where complex display-buffer-alist rules are involved. e.g. with Doom's popup manager, where display-buffer-in-side-window is used, which will delete existing windows to redisplay them on the side of the frame, causing zoom--update to operate out of a deleted window then throw the error.

TL;DR, this should fix it:

(use-package zoom
  :hook (doom-first-input . zoom-mode)
  :config
  (setq zoom-size '(0.7 . 0.7)
        zoom-ignored-major-modes '(dired-mode vterm-mode help-mode helpful-mode rxt-help-mode help-mode-menu org-mode)
        zoom-ignored-buffer-names '("*doom:scratch*" "*info*" "*helpful variable: argv*")
        zoom-ignored-buffer-name-regexps '("^\\*calc" "\\*helpful variable: .*\\*")
        zoom-ignore-predicates (list (lambda () (> (count-lines (point-min) (point-max)) 20)))))

There's also no need to tamper with window-configuration-change-hook because, unlike golden-ratio-mode, zoom doesn't add anything to it.

from zoom.

cyrus-and avatar cyrus-and commented on June 4, 2024

Hmm I don't see anything zoom-related in the backtrace, are you sure it is the culprit?

from zoom.

cyrus-and avatar cyrus-and commented on June 4, 2024
  :config
  (remove-hook 'window-configuration-change-hook #'zoom)
  (add-hook 'doom-switch-window-hook #'zoom)

Moreover what's the point of this?

from zoom.

lroolle avatar lroolle commented on June 4, 2024
  :config
  (remove-hook 'window-configuration-change-hook #'zoom)
  (add-hook 'doom-switch-window-hook #'zoom)

Moreover what's the point of this?

It's doom's hooks according to this issue: @hlissner
-> doomemacs/doomemacs#2225 (comment)

Well actually after I remove these two hooks the Errors never occur. But zoom won't' work automatically any more.

Thanks for replies and due to this is doom's Issue, I'll close this issue.

from zoom.

cyrus-and avatar cyrus-and commented on June 4, 2024

But zoom won't' work automatically any more.

Try with:

(custom-set-variables
  '(zoom-mode t))

from zoom.

lroolle avatar lroolle commented on June 4, 2024

But zoom won't' work automatically any more.

Try with:

(custom-set-variables
  '(zoom-mode t))

While seems like doom does not respect zoom-mode on...this doesnt work automatically

from zoom.

cyrus-and avatar cyrus-and commented on June 4, 2024

Hmm, I'm not familiar with Doom but that's enough to make it work automatically with regular Emacs, being zoom-mode a global minor mode.

from zoom.

hlissner avatar hlissner commented on June 4, 2024

@lroolle This works for me:

(use-package zoom
  :hook doom-switch-window
  :config
  (setq zoom-size '(0.7 . 0.7)
        zoom-ignored-major-modes '(dired-mode vterm-mode help-mode helpful-mode rxt-help-mode help-mode-menu org-mode)
        zoom-ignored-buffer-names '("*doom:scratch*" "*info*" "*helpful variable: argv*")
        zoom-ignored-buffer-name-regexps '("^\\*calc" "\\*helpful variable: .*\\*")
        zoom-ignore-predicates (list (lambda () (> (count-lines (point-min) (point-max)) 20)))))

Although, that ignore predicate is pretty aggressive. I'll assume that was intended.

EDIT: Ah, I think I've found the issue; a fix'll be up shortly.

from zoom.

lroolle avatar lroolle commented on June 4, 2024

@hlissner Awesome!

Thanks for the following.

from zoom.

cyrus-and avatar cyrus-and commented on June 4, 2024

Thank you @hlissner for taking the time to dig into this.

from zoom.

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.