emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Loss of Fontification partway through file
@ 2014-06-19  0:41 Jacob Gerlach
  2014-06-19  7:34 ` Thorsten Jolitz
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Gerlach @ 2014-06-19  0:41 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1916 bytes --]

Hello List,

I just converted my init file to an init.org to load with babel. I
prefer to view the source blocks with font lock
(org-src-fontify-natively). My problem is that certain parts of the
file don't show the fontification.

I had a lot of trouble narrowing down my init to provide a good
MWE/recipe for the behavior, but I can reproduce it with:

$ emacs -q test.org
M-: (package-initialize) RET
M-: (setq org-src-fontify-natively t) RET

The src block in the level 2 headings of the third heading below
doesn't fontify for me. Minor changes (even changing one of the
commented load paths) fix the issue, but not in any way that seems
predictable to me.

If I move headings around in init.org, the exact location where
fontification stops varies, but once it stops, all remaining src
blocks are un-fontified.

Am I violating some sort of convention that is hanging up the
fontification code?

Thanks for any tips,
Jake

--------test.org---------------------
* Heading with some add-to-list's (some commented)
#+BEGIN_SRC emacs-lisp :tangle yes
(add-to-list 'foo "bar")
;; (add-to-list 'load-path "~/.emacs.d/jake-lisp/moos-mode/trunk")
;; (add-to-list 'load-path "~/.emacs.d/jake-lisp/moos-mode/devel")
(add-to-list 'load-path "/home/jacob/.emacs.d/jake-lisp/ai-moos/devel")
#+END_SRC
* Heading with Note
Note: Loading and initializing of package is done in .emacs to
ensure that the newer version of org is loaded from elpa in favor of
the version distributed with emacs
#+BEGIN_SRC emacs-lisp :tangle yes
(add-to-list 'package-archives
    '("marmalade" .
      "http://marmalade-repo.org/packages/"))
#+END_SRC
* Offending section
** Offending subsection
#+BEGIN_SRC emacs-lisp :tangle yes
(message "foobar")
#+END_SRC
-------------------------------------

org-version is a variable defined in `org.el'.
Its value is "8.2.6"

emacs-version is a variable defined in `C source code'.
Its value is "24.3.1"

[-- Attachment #2: Type: text/html, Size: 4690 bytes --]

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

* Re: Loss of Fontification partway through file
  2014-06-19  0:41 Loss of Fontification partway through file Jacob Gerlach
@ 2014-06-19  7:34 ` Thorsten Jolitz
  2014-06-19  9:47   ` Jacob Gerlach
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Jolitz @ 2014-06-19  7:34 UTC (permalink / raw)
  To: emacs-orgmode

Jacob Gerlach <jacobgerlach@gmail.com> writes:

> Hello List,
>
> I just converted my init file to an init.org to load with babel. I
> prefer to view the source blocks with font lock
> (org-src-fontify-natively). My problem is that certain parts of the
> file don't show the fontification.
>
> I had a lot of trouble narrowing down my init to provide a good
> MWE/recipe for the behavior, but I can reproduce it with: 
>
> $ emacs -q test.org
> M-: (package-initialize) RET
> M-: (setq org-src-fontify-natively t) RET
>
> The src block in the level 2 headings of the third heading below
> doesn't fontify for me. Minor changes (even changing one of the
> commented load paths) fix the issue, but not in any way that seems
> predictable to me.
>
> If I move headings around in init.org, the exact location where
> fontification stops varies, but once it stops, all remaining src
> blocks are un-fontified.
>
> Am I violating some sort of convention that is hanging up the
> fontification code?
>
> Thanks for any tips,
> Jake
>
> --------test.org---------------------
> * Heading with some add-to-list's (some commented)
> #+BEGIN_SRC emacs-lisp :tangle yes
> (add-to-list 'foo "bar")
> ;; (add-to-list 'load-path "~/.emacs.d/jake-lisp/moos-mode/trunk")
> ;; (add-to-list 'load-path "~/.emacs.d/jake-lisp/moos-mode/devel")
> (add-to-list 'load-path
> "/home/jacob/.emacs.d/jake-lisp/ai-moos/devel")
> #+END_SRC
> * Heading with Note
> Note: Loading and initializing of package is done in .emacs to
> ensure that the newer version of org is loaded from elpa in favor of
> the version distributed with emacs
> #+BEGIN_SRC emacs-lisp :tangle yes
> (add-to-list 'package-archives
> '("marmalade" .
> "http://marmalade-repo.org/packages/"))
> #+END_SRC
> * Offending section
> ** Offending subsection
> #+BEGIN_SRC emacs-lisp :tangle yes
> (message "foobar")
> #+END_SRC
> -------------------------------------
>
> org-version is a variable defined in `org.el'.
> Its value is "8.2.6"
>
> emacs-version is a variable defined in `C source code'.
> Its value is "24.3.1"

The MWE (with native fontification -> t) looks ok for me, the only
fontification issue I see (and not only in your MWE) is that headline

,----
| * Heading with some add-to-list's (some commented)
`----

looses its font due to the "list" in it -> '(some commented)'. 
I see that often in my Org files - as soon as I type parens in a
headline it turn white.


,----
| Org-mode version 8.2.7 (release_8.2.7-1096-g23496c @
| /usr/share/emacs/24.3/lisp/org/lisp/)
`----

-- 
cheers,
Thorsten

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

* Re: Loss of Fontification partway through file
  2014-06-19  7:34 ` Thorsten Jolitz
@ 2014-06-19  9:47   ` Jacob Gerlach
  2014-06-19 10:39     ` Thorsten Jolitz
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Gerlach @ 2014-06-19  9:47 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]

>
> The MWE (with native fontification -> t) looks ok for me,

Thanks for taking time to check this. I should note that if I find a new
file (test.org) and yank the MWE, it is fontified correctly, but if I save
and kill the buffer and then find the file again, that is when the problem
occurs. In general, if I make a change that brings back the fontification,
it doesn't disappear again until freshly finding the file.


> the only
> fontification issue I see (and not only in your MWE) is that headline
>
> ,----
> | * Heading with some add-to-list's (some commented)
> `----
>
> looses its font due to the "list" in it -> '(some commented)'.
> I see that often in my Org files - as soon as I type parens in a
> headline it turn white.
>
> I do not observe the same. Since it is outside of an emacs-lisp source
block, why would it be interpreted as a "list"?

>

>
> ,----
> | Org-mode version 8.2.7 (release_8.2.7-1096-g23496c @
> | /usr/share/emacs/24.3/lisp/org/lisp/)
> `----
>
> --
> cheers,
> Thorsten
>
> Thanks,
Jake

[-- Attachment #2: Type: text/html, Size: 2281 bytes --]

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

* Re: Loss of Fontification partway through file
  2014-06-19  9:47   ` Jacob Gerlach
@ 2014-06-19 10:39     ` Thorsten Jolitz
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Jolitz @ 2014-06-19 10:39 UTC (permalink / raw)
  To: emacs-orgmode

Jacob Gerlach <jacobgerlach@gmail.com> writes:

>     The MWE (with native fontification -> t) looks ok for me, 
>
> Thanks for taking time to check this. I should note that if I find a
> new file (test.org) and yank the MWE, it is fontified correctly, but
> if I save and kill the buffer and then find the file again, that is
> when the problem occurs. In general, if I make a change that brings
> back the fontification, it doesn't disappear again until freshly
> finding the file.

I did this too (save and kill the buffer and then find the file again),
again no issues, and even the issue described below disappeared ;)

What you describe reminds me a bit of fontification issues with
outshine.el, only that its just the opposite. When I find a file with
e.g  .el extension (having stored `outline-minor-mode' in the major-mode
hook, and `outshine-hook-function' in the outline-minor-mode hook), the
buffer is fontified correctly right away. 

But when I write some (outshine-style structured) content in a temp
buffer in e.g. fundamental-mode, and then call `emacs-lisp-mode' on that
buffer, the org-mode like headline-fontification is not there
immediately, I first have to do something (visibility cycling, add a
char or so...), then the 1st level headers turn blue ...

>     the only
>     fontification issue I see (and not only in your MWE) is that
>     headline
>     
>     
>     
>     ,----
>     | * Heading with some add-to-list's (some commented)
>     
>     `----
>     
>     looses its font due to the "list" in it -> '(some commented)'.
>     I see that often in my Org files - as soon as I type parens in a
>     headline it turn white.
>     
> I do not observe the same. Since it is outside of an emacs-lisp source
> block, why would it be interpreted as a "list"?

no idea, but this 'unfontification' of headline with '(...)' in them
happens quite frequently for me. 

-- 
cheers,
Thorsten

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

end of thread, other threads:[~2014-06-19 10:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19  0:41 Loss of Fontification partway through file Jacob Gerlach
2014-06-19  7:34 ` Thorsten Jolitz
2014-06-19  9:47   ` Jacob Gerlach
2014-06-19 10:39     ` Thorsten Jolitz

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