[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft)
From: |
Thorsten Jolitz |
Subject: |
Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft) |
Date: |
Mon, 18 Mar 2013 11:48:48 +0100 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux) |
Carsten Dominik <address@hidden> 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 <address@hidden> 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
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), zeltak, 2013/03/17
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Carsten Dominik, 2013/03/18
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft),
Thorsten Jolitz <=
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), zeltak, 2013/03/18
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), W. Greenhouse, 2013/03/18
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Marcin Borkowski, 2013/03/18
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Carsten Dominik, 2013/03/18
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Rasmus, 2013/03/18
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Aaron Ecay, 2013/03/18
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Nicolas Richard, 2013/03/19
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Nicolas Goaziou, 2013/03/21
- Re: [O] [Out-of-Thread] Re: [RFC] Org syntax (draft), Samuel Wales, 2013/03/19