From: Bernt Hansen <bernt@norang.ca>
To: Dan Davison <dandavison7@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Skip source block fontification when the language is not defined
Date: Wed, 22 Dec 2010 12:34:59 -0500 [thread overview]
Message-ID: <878vzhyam4.fsf@norang.ca> (raw)
In-Reply-To: <m1bp4drgeu.fsf@94.197.185.4.threembb.co.uk> (Dan Davison's message of "Wed, 22 Dec 2010 15:11:37 +0000")
Dan Davison <dandavison7@gmail.com> writes:
> Bernt Hansen <bernt@norang.ca> writes:
>
>> I'm confused about _why_ I'm getting these errors though - I was
>> expecting fontification only to apply to #+begin_src blocks and I'm only
>> using a few languages in that document (sh, org, emacs-lisp, ditaa, and dot).
>>
>> Unless it's picking up on the begin_src in the following text
>
> Hi Bernt,
>
> I was wondering about the same thing.
>
> How about hacking the org-src-font-lock-fontify-block function so that
> it throws an error with a helpful message when the language string is
> unrecognised? I just tried this on your document with C-c C-e h and it
> didn't throw anything, but maybe in your setup it will? (Check the
> *Messages* buffer, it may be that font-lock handles the error). I've
> prepended the below with "$ " to stop patchwork from grabbing it.
>
> $ diff --git a/lisp/org-src.el b/lisp/org-src.el
> $ index f55e292..0d796b4 100644
> $ --- a/lisp/org-src.el
> $ +++ b/lisp/org-src.el
> $ @@ -781,7 +781,9 @@ fontification of code blocks see `org-src-fontify-block' and
> $ (add-text-properties
> $ start end
> $ '(font-lock-fontified t fontified t font-lock-multiline t))
> $ - (set-buffer-modified-p modified)))))
> $ + (set-buffer-modified-p modified))
> $ + (error "Unrecognised language: %s line: %d"
> $ + lang (line-number-at-pos (point))))))
>
> Dan
,----[ messages buffer ]
| Fontifying org-src-fontification:emacs-lisp-mode... (regexps.....................)
| if: Unrecognised language: line: 1210
| Ispell process killed
| Starting new Ispell process [british] ...
`----
This chokes on the #+end_example line of this block:
,----
|
| *Clock history selection buffer for C-u C-c C-x C-i*
| #+begin_example
| Default Task
| [d] norang Organization <-- Task B
| The task interrupted by starting the last one
| [i] norang Organization <-- Task B
| Current Clocking Task
| [c] org NEXT Document my use of org-mode <-- Task A
| Recent Tasks
| [1] org NEXT Document my use of org-mode <-- Task A
| [2] norang Organization <-- Task B
| ...
| [Z] org DONE Fix default section links <-- 35 clock task entries ago
| #+end_example
`----
The last line '#+end_example' is line 1210.
Huh?
-Bernt
prev parent reply other threads:[~2010-12-22 17:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-22 3:56 Bug: Publishing with org-src-fontify-natively fails with Lisp error: (void-function -mode) [7.4 (release_7.4.79.g9c4b9)] Bernt Hansen
2010-12-22 4:06 ` [PATCH] Skip source block fontification when the language is not defined Bernt Hansen
2010-12-22 12:08 ` Dan Davison
2010-12-22 13:57 ` Bernt Hansen
2010-12-22 15:11 ` Dan Davison
2010-12-22 17:34 ` Bernt Hansen [this message]
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=878vzhyam4.fsf@norang.ca \
--to=bernt@norang.ca \
--cc=dandavison7@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).