In emacs, how can I refer to physical screens?

I have a multi-screen display. Inside emacs (GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) on Windows 7), how can I determine the number of physical screens and call something on different screens? For example, I may need to open a new frame on a different screen, or I may need to move the frame in which Emacs starts from another screen.

+6
source share
2 answers

I'm not sure if these features work on Windows, but on Linux and Mac OS X you can use:

  • x-display-screens : number of monitors
  • x-display-pixel-width : current screen (screen containing Emacs windows).
  • x-display-pixel-height : Current screen height
  • set-frame-width and set-frame-height : resize
  • set-frame-position : move frame

For example, if you want to create a new frame on another screen, you can do:

 (when (and (display-graphic-p) (= (display-screens) 2)) (make-frame) (set-frame-position (selected-frame) 1280 0)) 

Where 1280 is the width of your first screen.

+6
source

Checkout the code pos-tip.el ( http://www.emacswiki.org/emacs/pos-tip.el )

It says that it works on X and Windows, so maybe you can find some compatible layer in it.

+2
source

Source: https://habr.com/ru/post/946675/


All Articles