The built-in CSS mode should support this just fine by giving indent-tabs-mode a non-nil value.
Note that spaces will still be used for padding if the number of indentation spaces isn't a multiple of tab-width. The default values of tab-width and css-indent-offset are 8 and 4 respectively, so you'll need two levels of indentation before a tab is inserted.
I use TAB to trigger company-mode on demand in cases like that -- it works fine in your CSS example. I also use TAB to indent (tab-always-indent set to complete). You can integrate company with the built-in indent-for-tab-command using the configuration described here:
Here is the ...
Via StackOverflow → Setting an Emacs background image, I found https://github.com/wachikun/emacs_bgex which will allow you to set background images. Although it's an indirect method, if you can generate the image with CSS rules then you can now include it in Emacs BGex (i.e. a patched version of Emacs). For the image generating step, there's a tip posted ...
You don't have to create a one-liner. The following list of definitions should create an imenu items:
'((nil "\\(^@font-face\\)" 1)
(nil "\\(^body\\)" 1)
(nil "\\(^#foo\\)" 1)
(nil "\\(^h\\)" 1)
(nil "\\(^\.CheltenhamBT-BoldHeadline\\)" 1)
In the end the solution that worked for me was to put the entire email in a DIV tag.
(insert "<div style=\"font-family:Georgia,serif\">")
It's probably easier to insert your own stylesheet in the head of your HTML mail instead of replacing the default settings:
(lambda () (insert (concat "<head>\n<style>\n"
M-x customize-group RET css RET
would inform you about:
css-fontify-colors is a variable defined in `css-mode.el'.
Its value is t
This variable is safe as a file local variable if its value
satisfies the predicate `booleanp'.
Whether CSS colors should be fontified using the color as the background.
You can do this with the advice method. It's not the info parameter you need, but src-block. Use the org-export-read-attribute to extract the #ATTR_HTML contents.
The following advice checks for the :class and :id keywords in a #attr_html line and constructs a div around the source block accordingly.
(defun my-org-html-src-block-advice (oldfun src-block ...
Suppose your major-mode is css-mode.
You can place (setq-default css-indent-offset 2) into .emacs.
Or you can set up per buffer,
(defun my-setup-indent ()
(setq-local css-indent-offset 2))
(add-hook 'prog-mode-hook 'my-setup-indent)
A useful option is to put
at the top of each .org file and then place your common heading commands such as
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="mystyle.css" />
in the file mysetup.org. Note that mysetup.org can contain further #+SETUPFILE: lines, reading in other files.
palette.el provides a color picker that shows such info, but it does not give HSLA or RGBA. eyedropper.el provides some of that functionality, including for older Emacs versions.
hexrgb.el provides functions for converting etc., but, again, not for HSLA or RGBA.
OK… wasn't aware of rainbow-mode, wich does exactly, what I intended. Of cource I found it after I posted question here ^^.
So the solution is:
M-x package-install RET rainbow-mode RET
To answer my question completely and enable it in all modes: I added
(define-globalized-minor-mode global-rainbow-mode rainbow-mode
(lambda () (rainbow-mode 1)))
I found the culprit, it was a line on my web-mode use-package block.
;; --- Web-Mode ---
("\\.php\\'" . web-mode)
("\\.html\\'" . web-mode)
("\\.htm\\'" . web-mode)
("\\.js\\'" . web-mode)
("\\.css\\'" . web-mode) ;; <----Removed this one
It seems web-mode was grabbing ...
I just committed a fix to CSS mode, so it should hopefully work as you describe out of the box in the next Emacs release. (Or you could always fetch the latest version from the master branch if you don't want to wait for a release.)
You could do that by having the css-mode's completion-at-point-functions return an appropriatr :exit-function property which inserts ": ;" and puts point just before the semi-colon (which it's called with a finished status).
Maybe a patch along the lines of:
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 9e36a88..f8ee3ec 100644
Actually the comment of @lawlist helped me to figure out that you just need to "rewind" your point, once you changed the style of an element like so:
(org-mime-change-element-style "ul.org-ul li" "font-family: Georgia,serif;")