emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [Out-of-Thread] Re: [RFC] Org syntax (draft)
Date: Mon, 18 Mar 2013 11:48:48 +0100	[thread overview]
Message-ID: <87hak97zlb.fsf@gmail.com> (raw)
In-Reply-To: 6449B53A-997D-411D-8E13-AAFAE6D81397@gmail.com

Carsten Dominik <carsten.dominik@gmail.com> writes:

> can you show an example on how you use it? Maybe we can find a better way.
> Nicolas is right that portability is compromised by customizable emphasis.

> On 18.3.2013, at 00:02, zeltak <zeltak@gmail.com> wrote:

>> I find the ability to add custom emphasise with custom faces invaluable. i
>> find it very easy to add and very useful for me since i use ALOT of color
>> highlights in my academic work.

Here is an excerpt from my .emacs, actually stolen from Fabrice Nielson
(http://www.mygooglest.com/fni/), that might give some hints how to do
interactive color highlighting without any changes to Org-mode:

,------------------------------------------------------------------------------
| ;; *** 14.13 (info "(emacs)Highlight Interactively")
| 
| ;; You can use `hi-lock-mode' to highlight words:
| ;;     `M-x hi-lock-mode RET'
| ;;     `C-x w h <match> RET hi-blue RET'
| ;; You can also write your settings to the buffer you're using with
| ;; `C-x w b', and read them back in again next time with `C-x w i'.
| 
| ;; TODO Have a look at http://www.emacswiki.org/emacs/color-moccur.el for
| ;; searching regexp in buffer
| 
| (GNUEmacs
|     ;; "identical token highlighting" commands
|     (when (try-require 'highlight)
| 
|         (defface hlt-1 '((t (:background "#FFFFA0"))) nil)
|         (defface hlt-2 '((t (:background "#A0FFA0"))) nil)
|         (defface hlt-3 '((t (:background "#A0FFFF"))) nil)
|         (defface hlt-4 '((t (:background "#FFA0FF"))) nil)
|         (defface hlt-5 '((t (:background "#FFA0A0"))) nil)
|         (defface hlt-6 '((t (:background "#FFFFA0"))) nil)
|         (defface hlt-7 '((t (:background "#A0FFA0"))) nil)
|         (defface hlt-8 '((t (:background "#A0FFFF"))) nil)
|         (defface hlt-9 '((t (:background "#FFA0FF"))) nil)
|         (defface hlt-10 '((t (:background "#FFA0A0"))) nil)
| 
|         (global-set-key (kbd "C-S-p") 'hlt-previous-highlight)
|         (global-set-key (kbd "C-S-n") 'hlt-next-highlight)
| 
|         (defun hlt-highlight-current-word ()
|           (interactive)
|           (let ((var_name (current-word t)))
|             (when var_name
|               (save-excursion
|                 (hlt-highlight-regexp-region
|                  (point-min)
|                  (point-max)
|                  (regexp-quote var_name))))))
| 
|         ;; emulation of Vim's `*' search
|         (global-set-key (kbd "C-*") 'hlt-highlight-current-word)
|         ))
| 
| ;; ;; bind the hi-lock commands to more finger-friendly sequences
| ;; (define-key hi-lock-map (kbd "C-z i") 'hi-lock-find-patterns)
| ;; (define-key hi-lock-map (kbd "C-z p") 'highlight-phrase)
| ;; (define-key hi-lock-map (kbd "C-z r") 'unhighlight-regexp)
| 
| ;; (define-key hi-lock-map (kbd "C-z h") 'highlight-regexp)
| ;; (define-key hi-lock-map (kbd "C-z C-h") 'highlight-lines-matching-regexp)
| ;; (define-key hi-lock-map (kbd "C-z b") 'hi-lock-write-interactive-patterns)
| 
| ;; Highlight based on regexps
| (global-set-key [M-f1] 'highlight-regexp)
| (global-set-key [M-f2] 'highlight-lines-matching-regexp)
| (global-set-key [M-f3] 'hi-lock-mode)
| (global-set-key [M-f4] 'hi-lock-write-interactive-patterns)
| 
| ;; highlight current symbol
| (when (try-require 'light-symbol)
|   (light-symbol-mode))
| 
| ;; highlight current symbol
| (setq highlight-symbol-idle-delay 0.5)
| (when (try-require 'highlight-symbol)
|   (highlight-symbol-mode))
`------------------------------------------------------------------------------

-- 
cheers,
Thorsten

  reply	other threads:[~2013-03-18 10:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-17 23:02 [Out-of-Thread] Re: [RFC] Org syntax (draft) zeltak
2013-03-18  6:08 ` Carsten Dominik
2013-03-18 10:48   ` Thorsten Jolitz [this message]
2013-03-18 13:33   ` zeltak
2013-03-18 15:21     ` W. Greenhouse
2013-03-18 16:05       ` Marcin Borkowski
2013-03-18 19:19       ` Carsten Dominik
2013-03-18 21:24         ` Rasmus
2013-03-19  3:47         ` Aaron Ecay
2013-03-19  9:49         ` Nicolas Richard
2013-03-21 21:36         ` Nicolas Goaziou
2013-04-12  6:23           ` Bastien
2013-04-12  6:23         ` Bastien
2013-03-19  4:07       ` Samuel Wales
  -- strict thread matches above, loose matches on Subject: below --
2013-03-20 17:47 zeltak
2013-03-07 20:37 Nicolas Goaziou
2013-03-09 23:16 ` Achim Gratz
2013-03-09 23:49   ` Nicolas Goaziou
2013-03-10  4:35     ` Jambunathan K
2013-03-10  7:08       ` Nicolas Goaziou
2013-03-10 10:14         ` Bastien
2013-03-10 15:44           ` Jambunathan K
2013-03-14 16:58             ` Eric S Fraga
2013-03-14 18:26               ` Jambunathan K
2013-03-14 18:51                 ` David Engster
2013-03-14 19:03                   ` [Out-of-Thread] " Jambunathan K
2013-03-14 19:15                     ` David Engster
2013-03-14 19:23                       ` Jambunathan K
2013-03-14 19:29                         ` David Engster
2013-03-14 19:52                           ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hak97zlb.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).