Hot answers tagged

22

Use display-graphic-p to determine if Emacs is in a GUI or not. Assuming solarized is installed and loaded: (if (display-graphic-p) (enable-theme 'solarized) (enable-theme 'wheatgrass)) See also: Is there a way to detect that emacs is running in a terminal?


21

I've added the following to my init.el file (I don't have a .emacsfile in ~). (setq package-enable-at-startup nil) (package-initialize) and then at the end (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If ...


21

add to your init.el (load-theme 'solarized-dark t) you can ignore stuff emacs added there, just delete it.


21

I'm not sure why the background color is there either, but it seems to be controlled by the function shr-color-check, which is supposed to check that the contrast between the fg and bg is sufficient for the text to be visible. I agree that the readability is not very good in your example. Luckily, there are some variables that can be tweaked: shr-color-...


20

Are you sure that you are using color themes and not Emacs custom themes? Color themes are defined by library color-theme.el. Custom themes are available starting with Emacs 24 - and they are not the same as color themes. If you are using color themes then the answer is simple: just enable the pseudo color-theme named [Reset]. That completely undoes the ...


15

By default, Emacs only autoload the packages after processing the init file. So when it was trying to set theme, the theme package wasn't loaded. Rather than making all packages load in your init file (like what you seem to be doing), you can also load the them after package autoloading by adding a hook to after-init-hook, since packages are autoloaded just ...


15

Set the second argument of the load-theme function. From its docstring: If the theme is not considered safe by ‘custom-safe-themes’, prompt the user for confirmation before loading it. But if optional arg NO-CONFIRM is non-nil, load the theme without prompting. For example: (load-theme 'solarized-dark t) will load the solarized-dark theme ...


14

I found a solution, and no longer I need transparent theme. The solution is : ;; set transparency (set-frame-parameter (selected-frame) 'alpha '(85 85)) (add-to-list 'default-frame-alist '(alpha 85 85))


12

I favor using custom-theme-set-faces to redefine how the theme displays a particular face, e.g., (custom-theme-set-faces 'zenburn '(font-lock-comment-face ((t (:foreground "#DFAF8F")))) '(font-lock-comment-delimiter-face ((t (:foreground "#DFAF8F"))))) For the specific case of zenburn, the theme itself defines various colors and a macro in which those ...


11

I'm guessing that you are not really looking for a way to "execute the hook only once". I'm guessing that you are looking for a way to execute that particular function only once, whenever the hook is run. The conventional, and simple, answer to that question is for your function to remove itself from the hook, after carrying out the one-time action that ...


10

Just found this, did not tried it: (set-mouse-color "red")


10

Your init.el file probably contains a snippet like this: (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ...) Amongst many other things, this snippet is ...


10

I believe it is standard practice for themes installed as packages to add their own paths to custom-theme-load-path as an autoload. A call to package-initialize will execute all of your package autoloads (among other things), and if there isn't an explicit call in your init file, it is called implicitly at the end of initialization. I recommend putting a (...


9

Update: load-theme-buffer-local.el (GitHub repository) is supposed to do what I tried to do, but do it the right way. To use it with eww, install it and add (add-hook 'eww-mode-hook (lambda () (load-theme-buffer-local 'tango (current-buffer)))) to your init file. PS: I cannot test this approach myself, so let me know if this works. Original ...


9

There are 4 regions where text may be displayed in Emacs, here is what you can do to inspect each of them. The mode-line: See the value of mode-line-format. The header-line: See the value of header-line-format. Buffer: If the face is in a region of the buffer you can't reach, see the value of (buffer-string). Minibuffer: If point is currently in the ...


8

You cannot do this using different themes. The solution is to create a theme that has different face definitions depending on the terminal. If you look at an example like font-lock-comment-face, you'll see how it works. Instead of specifying ((class color) (min-colors 88) (background dark)) you could also specifcy (type tty) or (type graphic) etc. The manual ...


8

github.com/altercation/solarized.git is the repository for the Solarized theme for vim. For emacs, the repo is https://github.com/bbatsov/solarized-emacs. The recommended approach to install the theme is via the emacs-inbuilt package manager. Ensure that you have the below in your emacs setup (~/.emacs.d/init.el by default): (require 'package) ;; Add ...


8

Use custom-theme-set-faces in a with-eval-after-load to easily customize a theme. For example, this modifies ample-theme to have a lighter background and green keywords instead of the defaults. (with-eval-after-load "ample-theme" (custom-theme-set-faces 'ample '(default ((t (:foreground "#bdbdb3" :background "gray15")))) '(font-lock-keyword-face ...


7

I think the important part is (package-initialize). I'm not so sure you need the package-enable-at-startup bit. So: (package-initialize) (load-theme 'ample t) You can also tell emacs to trust all your themes by default so you don't get prompted each time: (setq custom-safe-themes t) The thing to keep in mind is that the order to everything is important. ...


7

The Short Answer You should not customize the custom-theme-load-path variable in the Customize interface. So call M-x customize-variable RET custom-theme-load-path and ask to erase customizations (and save changes). If you want to configure a custom theme directory beyond that which packages automatically add, customize the custom-theme-directory variable ...


7

I do not know about using the mouse, but I've often found it's easiest for me to run list-faces-display and then just i-search for what the face is likely called or visually scan for text that looks the same.


7

Not sure of the specific colors, but to replace the asterisks with custom unicode chars, you might use https://github.com/sabof/org-bullets


7

From the emacs manual regarding packages: By default, Emacs also automatically loads all installed packages in subsequent Emacs sessions. This happens at startup, after processing the init file. So if your theme relies on some package initialisation you can put your call in after-init-hook. For example (add-hook 'after-init-hook (lambda () ...


6

color-theme-buffer-local provides buffer-local theme support for both color-theme and the Emacs 24 theme systems. My version of the solarized theme also supports both systems, if you decide to go this route.


6

The Emacs manual says you can set the option frame-resize-pixelwise to non-nil to allow frame sizes by pixel. Normally the frame dimensions (not counting the menu bar, tool bar, etc) are integer multiples of frame-char-height in height and frame-char-width in width. The manual notes that you need to set this variable to non-nil in your init file so that it ...


6

In spacemacs, install the layer theming, see https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bthemes/theming For example, I have the following snipped in the dotspacemacs/user-init of my .spacemacs to adjust the background and linenumber color of the gruvbox and the solarized-light theme: (setq theming-modifications '( ;; requires the ...


6

Like @lawlist said, determining if a file or directory is remote is easy and can be done using file-remote-p which will actually return the remote host is available. You could then use find-file-hook and dired-mode-hook to check if the file is remote and if so assign the host a color(s) and use that color to determine the mode-line and mode-line-inactive ...


6

M-x list-faces-display shows you all of the faces currently defined, including those with names mode-line*. It shows you the appearance of each face. And it lets you customize any of them - just click the face name. (See @Zaile's nice answer about using Customize to customize a face.) In sum, it gives you a WYSIWYG way to find out what faces are involved ...


5

You can set transparency within Emacs by setting 'alpha frame parameter, This parameter specifies the opacity of the frame, on graphical displays that support variable opacity. It should be an integer between 0 and 100, where 0 means completely transparent and 100 means completely opaque. It can also have a nil value, which tells Emacs not to set the ...


5

Doesn't sound like a theme to be honest. Try org-bullet.


Only top voted, non community-wiki answers of a minimum length are eligible