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?

  • I think you should call it without arguments, that way you check if the current (selected) frame is a tty or graphical. – Lindydancer Nov 6 '15 at 7: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 6 '15 at 9:54
  • Can you post a link to the fullscreen package that you use. – Lindydancer Nov 6 '15 at 10:04
  • github.com/safiyat/emacs/blob/… But now I started using emacs 24.5 (since yesterday). Will see how its inbuilt fullscreen behaves. :) – reza.safiyat Nov 6 '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 6 '15 at 10:37
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".

  • Looks like what I have been looking for. Running it in my case prints #<terminal 1 on /dev/pts/9>. Have to figure out how to use that info. :) – reza.safiyat Nov 5 '15 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.