emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Fontification in Org tables
@ 2012-12-28 17:40 François Pinard
  2012-12-28 18:11 ` Bastien
  2012-12-28 18:25 ` Jambunathan K
  0 siblings, 2 replies; 5+ messages in thread
From: François Pinard @ 2012-12-28 17:40 UTC (permalink / raw)
  To: emacs-orgmode

Hi, Org people.

Let me report an old problem of mine about missing fontification in Org
tables.  In my .emacs file, I have:


(defun fp-fontify-fixme ()
  (font-lock-add-keywords
   nil '(("\\<FIXME\\>" 0 font-lock-warning-face t))))

(let ((hooks '(c-mode-common-hook change-log-mode-hook
               cperl-mode-hook css-mode-hook emacs-lisp-mode-hook
               html-mode-hook latex-mode-hook lisp-mode-hook
               makefile-mode-hook message-mode-hook org-mode-hook
               php-mode-hook python-mode-hook sh-mode-hook
               shell-mode-hook ssh-config-mode-hook)))
  (while hooks
    (add-hook (car hooks) 'fp-fontify-fixme)
    (setq hooks (cdr hooks))))


This works nicely in Org file, /except/ within Org tables.  Would
someone be kind enough to give me a magical recipe to solve it? :-)

François

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fontification in Org tables
  2012-12-28 17:40 Fontification in Org tables François Pinard
@ 2012-12-28 18:11 ` Bastien
  2012-12-29  3:40   ` François Pinard
  2012-12-28 18:25 ` Jambunathan K
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien @ 2012-12-28 18:11 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Hi François,

François Pinard <pinard@iro.umontreal.ca> writes:

> (defun fp-fontify-fixme ()
>   (font-lock-add-keywords
>    nil '(("\\<FIXME\\>" 0 font-lock-warning-face t))))

Use this instead:

(defun fp-fontify-fixme ()
  (font-lock-add-keywords
   nil '(("\\<FIXME\\>" 0 font-lock-warning-face t)) t))

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fontification in Org tables
  2012-12-28 17:40 Fontification in Org tables François Pinard
  2012-12-28 18:11 ` Bastien
@ 2012-12-28 18:25 ` Jambunathan K
  2012-12-29  4:24   ` François Pinard
  1 sibling, 1 reply; 5+ messages in thread
From: Jambunathan K @ 2012-12-28 18:25 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

François Pinard <pinard@iro.umontreal.ca> writes:

> Hi, Org people.
>
> Let me report an old problem of mine about missing fontification in Org
> tables.  In my .emacs file, I have:
>
>
> (defun fp-fontify-fixme ()
>   (font-lock-add-keywords
>    nil '(("\\<FIXME\\>" 0 font-lock-warning-face t))))
>
> (let ((hooks '(c-mode-common-hook change-log-mode-hook
>                cperl-mode-hook css-mode-hook emacs-lisp-mode-hook
>                html-mode-hook latex-mode-hook lisp-mode-hook
>                makefile-mode-hook message-mode-hook org-mode-hook
>                php-mode-hook python-mode-hook sh-mode-hook
>                shell-mode-hook ssh-config-mode-hook)))
>   (while hooks
>     (add-hook (car hooks) 'fp-fontify-fixme)
>     (setq hooks (cdr hooks))))
>
>
> This works nicely in Org file, /except/ within Org tables.  Would
> someone be kind enough to give me a magical recipe to solve it? :-)

1. Visit Org file

        C-x C-f file.org RET

2. Turn on Hi-lock mode

        M-x hi-lock-mode RET

3. Highlight FIXME lines

        C-x w h FIXME RET

4. Save highlighted regexps right in to the buffer

        C-x w b 

        ,----
        | # Hi-lock: (("FIXME" (0 (quote hi-lock-1) t)))
        `----

5. Revisit the Org file

        C-x C-v file.org

6. Turn on Hi-lock mode

        M-x hi-lock-mode RET

7. Highlight custom regexps

        C-x w i

> François
>
>
>
>
>
>

-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fontification in Org tables
  2012-12-28 18:11 ` Bastien
@ 2012-12-29  3:40   ` François Pinard
  0 siblings, 0 replies; 5+ messages in thread
From: François Pinard @ 2012-12-29  3:40 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> (defun fp-fontify-fixme ()
>   (font-lock-add-keywords
>    nil '(("\\<FIXME\\>" 0 font-lock-warning-face t)) t))

> HTH,

IDHITAL = it did help indeed, thanks a lot! :-)

I had more fontification to do in some tables, and succeeded because of
your good hint.  Joy! :-)

François

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fontification in Org tables
  2012-12-28 18:25 ` Jambunathan K
@ 2012-12-29  4:24   ` François Pinard
  0 siblings, 0 replies; 5+ messages in thread
From: François Pinard @ 2012-12-29  4:24 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode

Jambunathan K <kjambunathan@gmail.com> writes:

> 2. Turn on Hi-lock mode

Wow, Jambunathan, thanks as well!  I was not aware of this mode, which
announces to be useful and handsome, especially when some often visited
files would benefit from some very specific highlighting.  How nice!

François

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-29  4:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-28 17:40 Fontification in Org tables François Pinard
2012-12-28 18:11 ` Bastien
2012-12-29  3:40   ` François Pinard
2012-12-28 18:25 ` Jambunathan K
2012-12-29  4:24   ` François Pinard

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).