Display formatted text in org-mode without formatting characters - emacs

For example, to make text bold in Org I have to type like this: *bold*. I don't want the asterisks to be displayed. How do I do this?

(setq org-hide-emphasis-markers t)
More details here: Hiding markup elements in org-mode

Related

How to change text color in Markdown in Emacs for italics and quotes?

Basically, when I have a Markdown file opened in Emacs, I want the italics and quotes to be a different color. If I write:
"Hello, world!"
I want the quotation marks and the text between them to be a different color than the rest of the text in the file.
Same goes for italics.
How do I get this?
For italics it's easy, just customize markdown-italic-face:
(set-face-attribute 'markdown-italic-face nil :foreground "magenta") ;; or "#ff00ff"
For quotes, you'd need to add a font-lock rule to match quoted strings and apply a different face. It might be non-trivial.

Does Org-mode support RTL Languages like arabic

Does Org-mode support RTL Languages like arabic ?
The objective is to prepare and typeset a book in arabic script and export it as PDF for print.
For a correct RTL display you can add the following snippet to your init file:
(defun set-bidi-env ()
"interactive"
(setq bidi-paragraph-direction 'nil))
(add-hook 'org-mode-hook 'set-bidi-env)
From Emacs Manual:
The variable bidi-paragraph-direction, if non-nil, disables the dynamic determination of the base direction, and instead forces all paragraphs in the buffer to have the direction specified by its buffer-local value. The value can be either right-to-left or left-to-right. Any other value is interpreted as nil.
As for pdf export, orgmode handles this using latex. Latex have a rich language support and you can easily makes this work. You can read more about that here.

Highlight and space out tags in org-mode

I would like to change the way tags are displayed in the org-mode buffer from this:
* Headline :tag1:tag2:tag3:
to this:
* Headline tag1 tag2 tag3
So basically, the changes I'm looking for are:
Start tags immediately after the headline.
Hide the : characters
Add a space in-between each tag, so that long lists of tags will wrap properly in visual line mode
Remove default bold formatting of tags and add a highlight
So far, I've been able to change the font face and add a highlight by customizing the Org Tag property. As a temp/hack, I made the : characters invisible by turning on hi-lock-mode and then M-x highlight-phrase [RET] : [RET] org-hide [RET]. But this only hides the colon—it doesn't actually create a real space. So tags still won't wrap properly in visual line mode. Also, this hides all colons, everywhere, not just the ones that separate tags.
Perhaps another option is to add the space but leave the colon?
* Headline :tag1 :tag2 :tag3
I've been auditioning this with the solarized-light theme. Here's a screenshot:
Any ideas, comments? Thanks!
As mentioned by #lawlist, the (setq org-tags-column 0) puts the tags immediately after headline.
To hide the colons associated with tags, I tried the approach suggested by #Tobias, by setting the display property of :. Putting this snippet in .emacs or init.el seems to work for me.
(font-lock-add-keywords 'org-mode
'(("^\\*+ "
":" nil nil
(0 (put-text-property (match-beginning 0) (match-end 0) 'display " ")))))
I was referring to the (matcher . anchored-highlighter) format of setting a Search-based Fontification:
the "^\\*+ " part first matches an org heading
the subsequent ":" searches for :
the next line replaces the matched : with a space, according to the doc on display specs that replaces the texts
A screenshot (note I didn't set org-tags-column 0 so it aligns right, and the font coloring are set by customize-face RET org-tag RET):
What you ask for could be solved if:
there was a face org-tag-separator (for example) just for the ":" symbol,
you customized that face to have its foreground equal to your background.
To ask on the Org ML?

Prevent Auctex indentation with (fill-paragraph)

I prefer not to use indentation in my LaTeX documents because it makes cooperating with users of other editors more difficult. This is typically pretty easy to achieve, except that Auctex likes to automatically indent whenever I use (fill-paragraph).
For example, if I have something like:
\begin{abstract}
Some series of sentences here.
\end{abstract}
When I run (fill-paragraph) I get something like
\begin{abstract}
Some series of
sentences here.
\end{abstract}
I don't want the filled text to be indented.
Note that I don't want to disable this functionality Emacs-wide, because I like being able to fill indented comments and such in other modes. I just don't want it to happen in Auctex.
How can I achieve this?
I've already seen this question [1], but it only has a partial solution for latex-mode, not Auctex.
[1] Emacs: Turn off indentation when doing a paragraph fill in LaTeX mode
If you set the customization variables LaTeX-indent-level and LaTeX-item-indent to 0 you'll get rid of most or all of AucTex's indentation.
You could do something like
(add-hook 'LaTeX-mode-hook
(lambda ()
(kill-local-variable 'line-indent-function)))
so as to disable LaTeX's indentation algorithm.

Colorize snippets of text in emacs

Suppose I have a few words I would like to highlight, so I want to change the color of those few words only to, say, green.
Is there an easy way to do this in emacs?
Thank you.
This is what I've done, using font-lock-add-keywords. I wanted to highlight the words TODO:, HACK:, and FIXME: in my code.
(defface todo-face
'((t ()))
"Face for highlighting comments like TODO: and HACK:")
(set-face-background 'todo-face cyan-name)
;; Add keywords we want highlighted
(defun add-todo-to-current-mode ()
(font-lock-add-keywords nil
'(("\\(TODO\\|HACK\\|FIXME\\):" 1 'todo-face prepend))
t))
Use library HighLight. You can use overlays or text properties. You can save the highlighting permanently or let it be temporary. You can highlight in many ways (regexp, mouse-drag,...). Lots of possibilities.
The highlight package has hlt-highlight-regexp-region and hlt-highlight-regexp-to-end, which do exactly what you want.
http://www.emacswiki.org/cgi-bin/wiki/highlight.el
Use the function font-lock-add-keywords to define a new matcher for the string in question, binding that matcher to some face you've defined that will display as green. For example:
(font-lock-add-keywords nil
'("\\<foo\\>" 0 my-green-face))
Note that you can specify a particular mode where I wrote nil above, and the matching forms can take on any of six different styles. See the documentation for the variable font-lock-keywords for the rules and a few examples.
If you want them highlighted only temporarily, I find M-x highlight-regexp command very helpful, it is especially nice for looking through log files of sorts. For example you made yourself a logging class that outputs some tracing info like MyClass::function() > when function is run and MyClass::function() < when it exits (can be especially useful sometimes when debugging multithreading issues) then you just ask emacs to highlight some of them green and other red and then you can see how did the execution go.
I use what Dimitri suggested. In particular, I have the following two lines in my .emacs
(global-hi-lock-mode t)
(global-set-key (kbd "C-M-h") 'highlight-regexp)
Every-time I need to highlight a certain word (or regex) in a buffer, I hit "C-M-h", which then prompts me for the word (or regex) I want to be displayed differently and then for a face to display it in.