Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7797985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:51:57+00:00 2026-06-01T23:51:57+00:00

Is it possible to check from within an elisp function if the current emacs

  • 0

Is it possible to check from within an elisp function if the current emacs frame is an X window or a terminal?

I have a function that maximizes the window, and it’s set to run whenever a new frame is created. However, when I open a terminal-only session I get error messages whenever a new frame is created.

I want the function to check whether it is an X window, and do nothing otherwise. Is that possible?

For the record, here is the current function:

(defun fullscreen (&optional f)     
  (interactive)                      ;if called interactively, use current frame
  (if f (select-frame f))            ;if called as hook, use new frame
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
                    '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
                    '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
  )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:51:59+00:00Added an answer on June 1, 2026 at 11:51 pm

    You may look at the window-system function. It accepts a frame optional argument (defaults to current frame). Alternatively, display-graphic-p is more recent (as per the documentation) and allows checking a whole display containing several frames. In your example, you could just write:

    (if (display-graphic-p) ...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to scrape the text from a textbox that is contained within
Is it possible from within a bash script to check if a mysql database
Is it possible to check the existence of process from Java in Windows. I
Is it possible to check who is entering your website in PHP. I have
Is it possible to get the memory-allocated address of a newly-instantiated class from within
I know it's possible to launch another app from within an app, using the
Is it possible to check a bash script syntax without executing it? Using Perl,
It is not possible to check out a single file. The finest level of
Is it possible to check if a dynamically loaded assembly has been signed with
How is it possible to check if MOSS Standard or MOSS Enterprise is installed?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.