Run code in .emacs file for Emacs command line only?

I use Carbon Emacs on Mac computers and my emacs GUI has an extremely nice color scheme configured for use. Unfortunately, it seems that when you run "emacs" in a terminal window that parses the same .emacs file in my root folder.

So, is there a way to conditionally execute the code in my .emacs file so that I can choose a different color scheme for the command line and emacs "GUI"?

Thank!

+3
source share
2 answers

window-system, , Emacs . , - .emacs.el:

(when window-system
  (setq default-frame-alist
    (append
      '((background-color . "#102e4e")
        (background-mode  . dark)
        ...))))

window-system ( Emacs, C-h v window-system RET):

, .
- - , `x ' X-.
, .

+10

emacs. , , :

Valideres-MacBook-Pro:be james$ which emacs
/usr/bin/emacs
Valideres-MacBook-Pro:be james$ emacs --version  
GNU Emacs 22.1.1
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Valideres-MacBook-Pro:be james$ /Applications/Emacs.app/Contents/MacOS/Emacs --version
GNU Emacs 25.1.1
Copyright (C) 2016 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Valideres-MacBook-Pro:be james$ /Applications/Emacs.app/Contents/MacOS/Emacs -nw ~/code/tmp/greatstuff.lsp

emacs , . -nw "no window". :

/Applications/Emacs.app/Contents/MacOS/Emacs -nw ~/code/tmp/greatstuff.lsp

, , , . , ( )

0

Source: https://habr.com/ru/post/1725045/


All Articles