emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Would it be possible to color horizontal lines in org mode?


From: John Kitchin
Subject: Re: Would it be possible to color horizontal lines in org mode?
Date: Thu, 30 Sep 2021 15:14:24 -0400
User-agent: mu4e 1.6.5; emacs 28.0.50

This looks correct. Some people prefer to use named functions for this,
so it is easier to remove them, but this works fine.

Alper Alimoglu <alper.alimoglu@gmail.com> writes:

> Thank you Professor Kitchin. Would something like follows would work?
> #+BEGIN_SRC emacs-lisp :results silent
> (add-hook 'org-mode-hook (lambda () (font-lock-add-keywords
>                                      nil
>                                      '(("^-\\{5,\\}"  0 '(:foreground "red" 
> :weight bold))))))
> #+END_SRC
>
> -Alper 
>
> On Tue, Sep 28, 2021 at 8:18 PM John Kitchin <jkitchin@andrew.cmu.edu> wrote:
>
>  you can add a rule like this in an org-mode hook:
>
>  #+BEGIN_SRC emacs-lisp :results silent
>  (font-lock-add-keywords
>   nil
>   '(("^-\\{5,\\}"  0 '(:foreground "red" :weight bold))))
>  #+END_SRC
>
>  that will make a line starting with at least 5 - be red and bold in color.
>
>  John
>
>  -----------------------------------
>  Professor John Kitchin (he/him/his)
>  Doherty Hall A207F
>  Department of Chemical Engineering
>  Carnegie Mellon University
>  Pittsburgh, PA 15213
>  412-268-7803
>  @johnkitchin
>  http://kitchingroup.cheme.cmu.edu
>
>  On Tue, Sep 28, 2021 at 4:00 AM Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>
>  You could use hi-lock-mode to define your own colouring for such
>  lines.  But I'm sure those that under font-locking better might be able
>  to add appropriate rules for this horizontal line construct.
>
>  -- 
>  : Eric S Fraga via Emacs 28.0.50, Org 9.5-g9a4a24
>  : Latest paper written in org: https://arxiv.org/abs/2106.05096


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
Pronouns: he/him/his



reply via email to

[Prev in Thread] Current Thread [Next in Thread]