ark
ark

Reputation: 148

How to have an emacs function called when display size changes?

I'm trying to define an emacs function that will be called when the display size changes, currently I'm not finding any hooks that I can use for this.

I an NOT trying to notice when the emacs window changes size.

My use case is that I have emacs open on my laptop, then I close it and bring it to work and plug it into a bigger monitor and turn it on via the keyboard. After logging in my windows are all in the top left corner.

I want emacs to notice the screen size change and call my function allow me to reposition the window and change the font size.

yes, I know about stay but I also want to change the font size.

I'm running emacs 24.3.1 from emacsformacosx.com under OSX Mavericks

Upvotes: 0

Views: 77

Answers (1)

Stefan
Stefan

Reputation: 28581

AFAIK, Emacs currently does not catch such screen-size-change events, and even if it does internally, it doesn't expose this in any way to ELisp. So your two best bets might be:

  • Use a timer that checks the screen size to detect change.
  • Ask for the feature via M-x report-emacs-bug.

Upvotes: 2

Related Questions