In my .emacs file, I have commands that only makes sense in graphical mode (like (set-frame-size (selected-frame) 166 100)). How do I run these only in graphical mode and not in terminal mode (i.e. emacs -nw).
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The
window-systemvariable tells Lisp programs what window system Emacs is running under. The possible values areFrom the doc.
Edit: it seems that window-system is deprecated in favor of
display-graphic-p(source: C-h f window-system RET on emacs 23.3.1).So what you want to do is :
And if you don’t have an else clause, you can just: