Hot answers tagged

17

This is really a matter of opinion, but I have always found that that making the hl-line have a slightly darker background than the default is best. I would like to maintain syntax highlighting, which has broken in my attempts. If you want to maintain syntax highlighting, make sure that hl-line face's :foreground attribute is nil, then set the :...


15

Have a look at helm-colors. It presents the colors exactly as in your screenshot and seems to be using a similar or even the same palette. To insert a color name into the current buffer, press C-c n (runs the action Insert Name). To insert the hex value of a color, press C-c r (run the action Insert RGB).


13

Library Palette (palette.el) gives you a general WYSIWYG color editor/picker, which lets you explore and modify colors using RGB and HSV values, including incrementally. It looks like what you show in your second image. Library Do Re Mi (doremi.el, doremi-cmd.el, doremi-frm.el) lets you modify colors used in Emacs incrementally: "direct manipulation". ...


11

The official way would be customizing the theme in question to make the fringe face look the same as the background face. A face spec along the lines of (fringe :inherit default) should do the trick. Alternatively, you can modify it on the fly using a code snippet: (defun my-tone-down-fringes () (set-face-attribute 'fringe nil :...


11

Put the cursor on the blue word, and say C-u C-x =. Find the face entry and click on its value. Then click on customize this face and change the foreground value to e.g. Cyan1. If you are in a console or are doing emacs -nw in a terminal, instead of clicking, put the cursor on the appropriate element and press RET.


10

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


10

The name of the face helm uses to highlight the selected item is helm-selection. You can change just the background color of any face with set-background-color: (set-background-color 'helm-selection "purple"). You can also useset-face-attribute like this: (set-face-attribute 'helm-selection nil :background "purple" ...


9

You can use font-lock-add-keywords to add custom highlights. In the below example, I am highlighting any string that begins with _ preceded by a white-space character or beginning of the line followed by a single alpha-numeric character followed by anything else ending with : The highlight color chosen is font-lock-warning-face; you can choose any other ...


8

Turns out this was a problem with gnome-terminal. I fixed it by opening the profile preferences from the gnome-terminal menu bar, selecting colours, and changing the built-in scheme to Linux console.


7

You can modify zenburn's face definitions in your .emacs. I use this to avoid mucking up the background of other themes. (with-eval-after-load "zenburn-theme" (zenburn-with-color-variables (custom-theme-set-faces 'zenburn ;; original `(default ((t (:foreground ,zenburn-fg :background ,zenburn-bg)))) `(default ((t (:foreground ,zenburn-...


7

highlight-symbol-mode uses text properties, not an overlay. hl-line-mode uses an overlay, not text properties. Overlays always take precedence over text properties, no matter how low the overlay priority is. So without some coding or code tweaking, I don't see a solution. However, if you use the Highlight library (highlight.el) then the solution is ...


6

My Emacs (GNU Emacs 24.5.1) sets TERM=dumb in startup.el and my ls from GNU coreutils 8.24 checks TERM even with --color=always. dumb is not a terminal type recognized by dircolors (the utility used by ls to decide how to color the output), so running TERM=ansi ls --color=always in a *shell* buffer works as expected, while ls --color=always does not. So, I ...


6

Just use a string with faces. (message (propertize "foo bar" 'face 'highlight)) Or use a different face, which has a red foreground. Or use a face property list: (message (propertize "foo bar" 'face '(:foreground "Red")))


6

I believe that the @ symbols in your terminfo example are part of the Texinfo markup, rather than part of the terminfo code. Your terminfo entry should look like: # Use colon separators. xterm-24bit|xterm with 24-bit direct color mode, use=xterm-256color, setb24=\E[48:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm, setf24=\E[38:2:%...


6

Faces in Emacs can have different values, depending on display attributes such as the number of colors supported or whether they're displayed on a light/dark background. Emacs can guess the latter without any issues in graphical mode, for textual frames however the guessing isn't nearly as good. If it turns out to be wrong, you'll get dark blue on black (...


6

If you want to get a well formatted text document, you can use emacs and others packages like LaTeX, ConTeXt, org-mode, or markdown (and pandoc) to get a beautiful and well structured pdf/html/ePub document. Emacs is very efficient for coding any markup language. On the other hand, if you want organizing your notes with syntax highlighting, you can use org-...


5

Eshell and shell-mode both use ansi-color.el to turn ansi color codes into faces. ansi-color.el supports the following faces: Parameter Description Face used by default 0 default default 1 bold bold 2 faint default 3 italic italic 4 underlined ...


5

In general, a terminal application like emacs -nw has only very limited information about what colors are available. The shell will have an environment variable called TERM which contains the name of the terminal you're using. The application can then use a library such as terminfo to pick the right escape sequences to use each feature of the terminal. This ...


5

I think the error comes from list-colors-print, which seems to have a nil at the end, and that gives you the error you see. This doesn't seem to happen in earlier versions of emacs and is probably a bug.


4

try to add this code in init.el and restart the daemon: (require 'frame) (defun set-cursor-hook (frame) (modify-frame-parameters frame (list (cons 'cursor-color "DeepSkyBlue")))) (add-hook 'after-make-frame-functions 'set-cursor-hook)


4

How about: (defun my-insert-color-hex () "Select a color and insert its hexadecimal format." (interactive "*") (let ((buf (current-buffer))) (list-colors-display nil nil `(lambda (name) (interactive) (quit-window) (with-current-buffer ,buf (insert (apply 'color-rgb-to-hex ...


4

You can set the fringe color to nil, in which case you don't need to worry about any theme changes. I've got the following in my config: (set-face-attribute 'fringe nil :background nil) And the fringe just disappears.... :)


4

You are using the wrong property. ,----[ (info "(elisp) Special Properties") ] | `face' | This property controls the appearance of the text (*note Faces::). `---- Example: (propertize "Foo" 'face '(:foreground "orange"))


4

Another possibility would be to display line numbers and say the line number before the word, or, since looking over to get the exact line number would be bothersome, you could have the algorithm search within + or - 5 or 10 lines of the number you say. Or perhaps declare a region or function that you are working in and have all searches only look there. I ...


4

You can use library Highlight to highlight a region using an overlay or text properties -- in particular, property face. To highlight the background, use a face that uses attribute background but not foreground. If you use text property face then you can also copy properties from some text and paste them to other text. So if your definition changes and ...


4

No, you cannot set a face to always be a certain amount lighter or darker than the inherited face. You can not customize a face based on context either. If you would like org tags to change color based on their location in the org tree, you will need to use a custom font-lock keyword function that programmatically apply colors to org tags based on location....


4

Assuming that the org- libraries have already been loaded ... Type: M-x customize-face RET org-ellipsis RET To see a list of all faces for the org- library, type: M-x customize-group RET org-faces RET If the org- libraries have not yet been loaded, then evaluate (require 'org) using something like M-x eval-expression aka M-: before querying a particular ...


3

Make sure that your $TERM is set correctly before running Emacs. If launching direct from the terminal, check with echo $TERM - preferably its value would be xterm-256color Set it either directly before you run Emacs: TERM=xterm-256color emacs -nw With any other arguments you need. As a more permanent solution, set the value of TERM in your terminal ...


3

Move to the coloured text you're interested in, and type C-uC-x= to view details of the character at point, including any faces. Select the face you're interested in, then select "customize this face", make the desired changes, and save.


3

The problem is that I have no idea how the colors are set to begin with, and more importantly, why they are set differently. Perhaps this discussion on StackOverflow is relevant - some detailed answers on what's going on. My case was the way emacs detects background color. It has a fallback for xterm-*, but not screen-*, and was using black background ...


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