Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reverse video by default in Emacs?

I am running Emacs 24.3.1 on Mac OS 10.9, compiled on my machine from source through MacPorts. (For good measure I also tried a 24.3 binary from emacsformacosx.com.) I can use the -r switch from the command line to get Emacs to run in reverse video, however adding a customization to my .emacs file (setq inverse-video t) or through the Emacs customization menu is having no effect. Does anyone know another way to reverse the video without running Emacs from the command line?

like image 308
ash Avatar asked Nov 03 '13 16:11

ash


2 Answers

I put this in my .emacs file: (Running GNU Emacs 21.1.3 on x86 linux)

(set-background-color "black")
(set-foreground-color "white")

Edit / update: Works just fine for the first frame. But a new frame is opened with a white background, and black text. Have some vague recollection of separately setting the frame background/foreground colors in the past, but don't know the name of the setting.

like image 42
Julie Avatar answered Nov 10 '22 00:11

Julie


The problem is that the usual Emacs init file (~/.emacs or ~/.emacs.d/init.el) is read after the GUI is initialized, so it has no effect on reverse video. You have to stick with the command line option --reverse-video or -rv or -r.

However, Emacs 28.1 (not yet released) adds an early init file ‘~/.emacs.d/early-init.el which is loaded before GUI is initialized, and if you put

(add-to-list 'default-frame-alist '(reverse . t))
(setq initial-frame-alist default-frame-alist)

into it, your Emacs will start with reverse video.

like image 162
sds Avatar answered Nov 10 '22 01:11

sds