1

I run emacs using a server and multiple clients on both, the graphical display and the terminal.
To use the same configuration files for terminal and graphical display, I used this solution.

The issue is, on starting a new emacs client, the fullscreen function gets called on all the already running clients too, and causes a very unwanted behaviour which sometimes throws up errors too.

The display-graphic-p function doc says,

(display-graphic-p &optional DISPLAY)

Return non-nil if DISPLAY is a graphic display. Graphical displays are those which are capable of displaying several frames and several different fonts at once. This is true for displays that use a window system such as X, and false for text-only terminals. DISPLAY can be a display name, a frame, or nil (meaning the selected frame's display).

I think my issue can be resolved by specifically calling the fullscreen function on the selected frame's display. So, my question is, how to obtain the name of the current display?

reza.safiyat
  • 184
  • 3
  • 14
  • I think you should call it without arguments, that way you check if the current (selected) frame is a tty or graphical. – Lindydancer Nov 06 '15 at 07:39
  • Yes. I do that. But after checking that, I need to call some functions to modify the concerned frame (graphical or tty). To do that, I need to pass the DISPLAY variable, else it calls the functions on all the running frames. – reza.safiyat Nov 06 '15 at 09:54
  • Can you post a link to the `fullscreen` package that you use. – Lindydancer Nov 06 '15 at 10:04
  • https://github.com/safiyat/emacs/blob/76d67f8ce849ab88787f4c861685affe4fc5544a/loadpaths/fullscreen.el But now I started using emacs 24.5 (since yesterday). Will see how its inbuilt fullscreen behaves. :) – reza.safiyat Nov 06 '15 at 10:15
  • 1
    It seem to ask the window system to enter fullscreen mode by sending X11 events. Obviously, you can't control which frames should be affected. Try to simply do `(set-frame-parameter (selected-frame) 'fullscreen 'fullboth)` instead, when the current frame is graphical. – Lindydancer Nov 06 '15 at 10:37
  • This works!!! :D – reza.safiyat Nov 06 '15 at 10:42

2 Answers2

2

After digging into get-device-terminal it looks like it's the same as the device or tty frame property.

According to the documentation, it's the X11 display name HOST.SERVER.SCREEN. On MS-windows it's simply the string "w32".

Lindydancer
  • 6,095
  • 1
  • 13
  • 25
  • Looks like what I have been looking for. Running it in my case prints `#`. Have to figure out how to use that info. :) – reza.safiyat Nov 05 '15 at 18:13
1

For frames running on a graphic display, the name of the current display as a string is obtained with (frame-parameter nil 'display), which returns the display property of the selected frame.