Is there a way to change the text of the command line in emacs?
I do not know, what the real name of the command line at the bottom ist, but I marked it on the picture. It is the blue text at the bottom:
The bottom part is called minibuffer if I recall correctly.
M-x customize-face
minibuffer-prompt
Two possibilities for this one:
One: http://www.gnu.org/software/emacs/windows/old/faq4.html
Just scroll down until you see the part about color, in which it gives you the libraries where you can change emacs colors using RGB values.
Two: http://www.emacswiki.org/emacs/ColorTheme
This one's definitely a lot more robust than you need, but it's basically a 'plugin' of sorts that allows you to customize literally any color in emacs, or use premade color themes.
Related
I am trying to customize the tsdh-dark emacs theme, which I find particularly relaxing.
I am able to customize colors for functions, comments, etc.
However, typing LaTeX documents, particular kind of elements, such as custom or not built-in commands, have a color too close to default text.
See for example the \hypersetup command versus his content:
or shorttitle, \hh, tr versus normal text:
How can I change this color?
I am using Emacs Prelude. I didn't find most of the custom themes comfortable. I really liked Sublime Text 2's Monokai theme, so I installed the Monokai theme ported for Emacs. Though it is more or less similar to Sublime Text 2's Monokai, there are some differences which I want to correct, so as get my Emacs Monokai more close to Sublime's Monokai.
For example I don't want every Python keyword to be the bold pinkish. I would be prefer keywords like class,def to have a blue color than the pink ones and I would prefer the function arguments to have an orange color.
The Emacs Monokai theme seems to color the variable name to an orange color, which I don't want. How do I implement this? I checked the monokai-theme.el file, but I don't know what variable to edit and what variable to add to give the features in color changes I mentioned above.
I suppose you're referring to this version of Monokai?
You'll be able to make some of your changes, but without doing a huge amount of work some of them won't be feasible. This theme uses font-lock to identify many of the things to be coloured, and font-lock identifies all Python keywords the same way.
Have a look through the various font-lock variables in that file. This will give you a good idea of what you can easily change. For example, if you want to change variables from orange to something else, change
'(font-lock-variable-name-face
(:foreground monokai-orange))
to use one of the other monokai- colour variables, or define your own.
If you're trying to figure out how a particular character is recognized by Emacs, move your cursor over that character and do C-u C-x = (C-u M-x what-cursor-position). This will show, among other things, the face for that character.
I'm using scss-mode in Emacs.
There are a lot of color string like #f2d3aa in text.
I wonder if there is a function that pop up a color square from string of current position.
Is there a emacs function like this?
I'm using rainbow-mode. It's a minor mode that fontifies the text color descriptions as you type them.
Very user-friendly, since it's got only one interactive function (i.e. rainbow-mode).
It's available from MELPA.
Here are a couple of tools that can help:
hexcolour.el -- shows such hex color codes in their own color in the text
palette.el -- interactive color palette: takes such hex codes as input and provides them as output (in addition to color names etc.)
hexrgb.el -- (used by the color palette and other libraries) color manipulation functions
The first one, hexcolour.el, is the closest to what you asked for.
Is it possible to select a piece of text you're editing and change its color? I know it's possible to create a color theme that will color certain kinds of text (like for example coloring functions in a certain programming language), but is it possible to do a one time color change to a selected piece of text in a specific emacs document without creating a theme? thanks in advance.
A theme doesn't allow you to specify the color of arbitrary text in any case. It only describes a set of face to be used by font-lock.
To apply a face to an arbitrary piece of text, select the text, then M-: (add-text-properties (region-beginning) (region-end) '(face font-lock-warning-face))
See the faces section of the elisp manual on how to create a face.
Emacs also comes with the hi-lock package, which can highlight regexps or lines containing regexps. See manual
how about M-x highlight-phrase ?
I know six years is a pretty long time, but I stumbled across this question and, after a lot of research, I did not find anything nearly as objective as what I eventually dug out for myself.
To color say, the first 200 characters in your buffer, execute the command:
(put-text-property 1 200 'face (cons 'foreground-color "red"))
If you need help executing this command in emacs, here is one possibility among many:
Type ESC-x eval-expression.
Type or paste the above command in the mini-buffer after the prompt.
Press ENTER.
You might like to look at enriched-mode.
If you are in a buffer that isn't controlled by font-lock, you can use 'facemenu'.
For example, highlight a bit of text, then with the mouse, press C-mouse-2. You can then select a face (some combination of text properties with a name). You can also pick random forground or background colors.
If you Emacs is particularly old, I seem to remember something similar on M-g.
Try set-background-color, set-foreground-color, set-cursor-color.
Changes won't be saved with the document though.
Note:
When I try those functions, they don't set the region's color unless I go through the menus.
See http://www.emacswiki.org/emacs/HighlightTemporarily (and it need not be temporary).
You can "color" text by swiping it with the mouse, or matching it with a regexp, and several other ways. Library highlight.el, in particular, lets you "color" text in many ways.
I highlight current line by evaluating:
(hl-line-mode)
It could also be set globally:
(global-hl-line-mode nil)
The problem is that this way line highlighting overrides highlight-phrase. So my question is: "how to highlight both current line and a given phrase in this line?"
Both highlight-phrase and hl-line apply faces that have a background color set. hl-line wins because it uses an overlay, and overlays always override text properties, which highlight-phrase uses. I suggest that you work around this by customizing the hi-yellow face to use a bright foreground color instead of a background color, or even a box.
So here's some, definetly not ideal, solution. Do:
M-x customize-face
emacs then asks you which one, and I did
hl-line
Then I turned off "inherit" flag (the last one), and turned on the "foreground" flag, - it was saying "black" - I made it red. After that You should save it all at the top of the page - either - for this seccion only, or for future sessions too.
That's it! This way current line text arrears of red font, while highlight-phrase highlights the phrase with yellow.
Edit: The previous solution that I posted doesn't work, but this one should.
Highlight has two modes, one for font-lock-enabled buffers (which uses font-lock) and one for without (which uses overlay). The solution I found was to simply force highlight to use overlay at all times, and thus have higher priority over hl-line (because shorter overlays have an implicitly higher priority, given the same value of priority).
To do this I went into hi-lock.el and replaced every instance of font-lock-fontified with nil. Be sure to M-x byte-compile-file afterwards in order to update hi-lock.elc.