From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: [Out-of-Thread] Re: [RFC] Org syntax (draft) Date: Mon, 18 Mar 2013 11:48:48 +0100 Message-ID: <87hak97zlb.fsf@gmail.com> References: <6449B53A-997D-411D-8E13-AAFAE6D81397@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHXcl-0000vx-Ed for emacs-orgmode@gnu.org; Mon, 18 Mar 2013 06:49:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHXcj-0003Fj-Pi for emacs-orgmode@gnu.org; Mon, 18 Mar 2013 06:49:03 -0400 Received: from plane.gmane.org ([80.91.229.3]:59195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHXcj-0003FT-Is for emacs-orgmode@gnu.org; Mon, 18 Mar 2013 06:49:01 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UHXd4-0005Zt-2i for emacs-orgmode@gnu.org; Mon, 18 Mar 2013 11:49:22 +0100 Received: from e178061224.adsl.alicedsl.de ([85.178.61.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Mar 2013 11:49:22 +0100 Received: from tjolitz by e178061224.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Mar 2013 11:49:22 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Carsten Dominik 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 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 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