Similarly, you can start Emacs in daemon mode ( emacs -daemon), then later tell it to create a graphical frame with emacsclient -c. That is to say, you can get different values of display-graphics-p even within a single Emacs instance.įor example, you can start a GUI Emacs and then connect to it via emacsclient -t in a terminal the resulting terminal frame will see a value of nil for display-graphics-p. Some of those might be on a terminal, and others might be on a window system. While the above solution works, it fails to address one fundamental aspect of Emacs - you can have multiple Emacs frames (or windows, in non-Emacs terminology) associated with one Emacs instance. If you dont want to have to type emacs -nw, you could create an alias. In the past the variable window-system provided another way to check for this, but it has been deprecated for a while, so I’d advise against using it. So run the following command to use emacs from the command-line: emacs -nw. If you close the terminal, the Emacs will close along with it. There are basically 2 conditions that need to be satisfied: You must use an Emacs built with GUI support. ( if ( display-graphic-p ) GUI mode ( progn ( your ) ( code )) Terminal mode ( your ) ( code )) You need to be sure that the text editor is tied to the terminal which launched it. 1 Emacs will start 'in GUI mode' automatically when possible.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |