I find Emacs always blinks when it startup, My operation system is MacOS 10.14, I take a screenshot to show what I say, and slow the playback to 5%, then I find there is a screen draw first, but it's white fill color, after that it redraws as the config in .emacs file.
Could anybody tell me what's the mechanism of this and how to remove it?
screenshot of emacs startup
UPDATE: You can set most of these in early-init.el with Emacs 27+. That code gets executed before the GUI comes up.
Some Emacs config can happen before init.el is loaded, for instance X resources and command line options. So you can start Emacs like
emacs -bg black
or edit your ~/.Xresources:
Emacs.Background: black
and update the xrdb:
xrdb -merge ~/.Xresources
If you go the X resources route, make sure something updates xrdb at start up/log in.
You can use named colors like in list-colors-display or a hex color like #000000.
Related
I want to use the color theme solarized-light. It works just fine if I do (load-theme 'solarized-light t), however I am having issues with having it load automatically.
If I simply add (load-theme 'solarized-light t) to my .emacs, the color theme won't load properly. Some of the colors are applied but others aren't, I assume this is because it's not running in a GUI so it assumes the terminal can't support the colors or something.
Logically, I tried putting the call to load the theme in the after-make-frame-functions variable. I thought that if it only tries to load the theme after I'm already in a GUI, then it should work right?
It doesn't. When I create the first frame the same thing happens with the terminal and the colors aren't loaded properly. However, if I make another frame while I already have one open then it works properly.
Is there any way to apply the theme properly when I make the first frame, or even before that if possible?
I'm on Arch Linux running Emacs 24.3.1 as a daemon. In case this behavior is tied to the window manager, I've tried it in both StumpWM and Openbox and it doesn't work in either.
Edit:
As a temporary workaround I have made a command in my .stumpwmrc that runs the shell command emacsclient --eval "(load-theme 'solarized-light t)" after making the frame. This works but it doesn't answer my original question (nor is it likely to help people with other window managers).
add
(package-initialize)
(setq package-enable-at-startup nil)
to the top of your .emacs file. then set the them from M-x customize-groups: themes, select theme in the menu and save to your .emacs file, also disable foreground and background from default faces group. restart emacs or M-x eval-buffers to check.
When I started to use emacs as daemon and emacsclient with new frame as interface, all was just fine. But then I wanted to adopt emacsclient for running in urxvt terminal. I’ve installed color-scheme package from my distro’s package manager and added initializing code to my ~/.emacs.d/init.el I switched between various color themes, but then realized that colors are actually depend of color palette of the terminal emacsclient is running in. So I deleted the color-theme package and removed lines related to it from my init.el. But something went wrong and I was left with default black foreground color, totally black cursor (I use only default X cursor which is black arrow outlined white, but what I got was looking almost like this, but totally black) and decreased font-size.
I was digging to fix all that as fast as possible, and started to use
'(default-frame-alist (quote ((menu-bar-lines . 0) (left-fringe . 0) (right-fringe) (tool-bar-lines . 0) (background-color . "#2e3436") (foreground-color . "#d3d7cf") (cursor-color . "#ffffff"))))
This is what appeared in my custom-set-variables of my init.el after I finally hit on an appropriate item crawling the customize menu. However, now I need to specify more and more of things to make them look as in usual emacs (not as deamon, there colors and font are still fine). Then a question appeared: ‘Why before installation of color-theme frames of emacsclient were always inherit the default look of emacs I described through customize menu and saved to init.el?’
Deleted all frame-related stuff from init.el and it works like before now.
I want to set the window size (maybe it is the frame in emacs speaking). I use this for the config. It works, but something happened that confused me. for example, if I set the width 80 and the height 30. When I start the emacs. It initialize to wider than 80 and higher than 30 which I set previously, then in a flash, it shrinked to the width 80 and height 30.
What I want to ask is why it appeared like this? can I set the window size as soon as the emacs initialized? How?
a similar thing happened with the toolbar. I disable the toolbar like this
(tool-bar-mode 0)
when I initialize the emacs, the toolbar appears, but in a flash it disappeared. FYI, I put the (tool-bar-mode 0) in the very first line of the .emacs file.
For the strangely resizing window:
Basically, Emacs brings up its window (frame) before it reads your .emacs. Obviously it has to be some size. Of course, this is customizable. On Unix systems, you do this by setting an X resource, which works a bit like an environment variable: Emacs can check for the setting when it first runs before loading up all the elisp-parsing machinery and getting to work on your .emacs. On Windows, I think you can set these variables through the registry. See this EmacsWiki page for a description of how to set variables in the registry. You want the Emacs.Geometry key.
I don't know if it's possible to change tool-bar-mode as an X resource. I didn't bother, since the appearing and disappearing tool bar was much less irritating than a moving window!
I am running Emacs 23.3 on Windows XP. When Emacs is started, the mode line will assume one of these two appearances at random. Needless to say, I prefer the first one. How do I figure out what is going on and how do I make the first one stick?
The images don't show it, but the first one has a GUI type appearance. If I hover over the various bits of text with a mouse, e.g. Help then the text Help turns into a button with shadows etc.
The black mode line appears to be a text mode widget. The only thing that the mouse will change on it is the highlighting.
PS: Thanks JSON!
I vaguely remember this happening years ago depending on whether or not I started Emacs from Remote Desktop. Perhaps there's an issue with color depth?
See if anything has changed your settings to
(set-face-background 'modeline "#000000")
(set-face-foreground 'modeline "#FFFFFF")
(EDIT: Color codes corrected) in any of your .el files.
I use xterm and set its appearance in ~/.Xdefaults:
XTerm*background: paleTurquoise
XTerm*foreground: black
I also use emacs, but set its appearance differently in ~/.emacs:
(set-background-color "black")
(set-foreground-color "yellow")
I usually run emacs within the terminal emulator with emacs -nw, rather than creating a separate X window. For some reason, this doesn't work properly for emacs23; instead, emacs retains the pale turquoise background of my xterm window. Looking at what's new in emacs23, I noted that:
** When running in a new enough xterm (newer than version 242), Emacs asks xterm what the background color is and it sets up faces accordingly for a dark background if needed (the current default is to consider the background light).
So it's a feature, not a bug? Anyway, is there some way that I can I tell emacs23 to ignore the xterm background settings when running in console mode, and use the settings in ~/.emacs instead?
I'll also note that:
It works fine in emacs23 running in a separate X window (without the -nw option).
It worked fine in emacs22; and I'm not really sure whether I need to use emacs23...
Running M-x set-background-color within emacs23 -nw has no effect.
It's not just xterm: the same problem exists with $TERM=cygwin, for example.
UPDATE: the best answer seems to be to use the -fg and -bg command-line options...
Setting TERM=xterm-256color is what you need.