emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Debugger entered--Lisp error: (void-function -mode)
@ 2010-11-22 20:48 Sébastien Vauban
  2010-11-23 20:19 ` David Maus
  0 siblings, 1 reply; 6+ messages in thread
From: Sébastien Vauban @ 2010-11-22 20:48 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

When having the following code in any Org page, I now have an error generated.

- If the code is in a =begin_src html= block, no problem.
- If between a =begin_html=, see what I get.

* Some code

#+begin_html
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('<a class="backtotop" href="#top">^</a>')
    .insertAfter('h2');
$('<a id="top"></a>')
    .prependTo('body');
});
</script>
#+end_html

* Debug info

#+begin_src emacs-lisp
Debugger entered--Lisp error: (void-function -mode)
  -mode()
  funcall(-mode)
  (if (eq major-mode lang-mode) nil (funcall lang-mode))
  (unless (eq major-mode lang-mode) (funcall lang-mode))
  (save-current-buffer (set-buffer (get-buffer-create ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
  (with-current-buffer (get-buffer-create (concat " org-src-fontification:" ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
  (let* ((lang-mode ...) (string ...) (modified ...) (org-buffer ...) pos next) (remove-text-properties start end (quote ...)) (with-current-buffer (get-buffer-create ...) (delete-region ... ...) (insert string) (unless ... ...) (font-lock-fontify-buffer) (setq pos ...) (while ... ... ...)) (add-text-properties start end (quote ...)) (set-buffer-modified-p modified))
  org-src-font-lock-fontify-block("" 27 287)
#+end_src

I don't understand why. Maybe it will ring a bell to you?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Debugger entered--Lisp error: (void-function -mode)
  2010-11-22 20:48 Debugger entered--Lisp error: (void-function -mode) Sébastien Vauban
@ 2010-11-23 20:19 ` David Maus
  2010-11-23 21:10   ` Sébastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: David Maus @ 2010-11-23 20:19 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2822 bytes --]

At Mon, 22 Nov 2010 21:48:25 +0100,
Sébastien Vauban wrote:
> 
> Hello,
> 
> When having the following code in any Org page, I now have an error generated.
> 
> - If the code is in a =begin_src html= block, no problem.
> - If between a =begin_html=, see what I get.
> 
> * Some code
> 
> #+begin_html
> <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
> <script type="text/javascript">
> $(document).ready(function () {
> $('<a class="backtotop" href="#top">^</a>')
>     .insertAfter('h2');
> $('<a id="top"></a>')
>     .prependTo('body');
> });
> </script>
> #+end_html
> 
> * Debug info
> 
> #+begin_src emacs-lisp
> Debugger entered--Lisp error: (void-function -mode)
>   -mode()
>   funcall(-mode)
>   (if (eq major-mode lang-mode) nil (funcall lang-mode))
>   (unless (eq major-mode lang-mode) (funcall lang-mode))
>   (save-current-buffer (set-buffer (get-buffer-create ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
>   (with-current-buffer (get-buffer-create (concat " org-src-fontification:" ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
>   (let* ((lang-mode ...) (string ...) (modified ...) (org-buffer ...) pos next) (remove-text-properties start end (quote ...)) (with-current-buffer (get-buffer-create ...) (delete-region ... ...) (insert string) (unless ... ...) (font-lock-fontify-buffer) (setq pos ...) (while ... ... ...)) (add-text-properties start end (quote ...)) (set-buffer-modified-p modified))
>   org-src-font-lock-fontify-block("" 27 287)
> #+end_src
> 
> I don't understand why. Maybe it will ring a bell to you?
> 

I cannot reproduce this on


Org-mode version 7.3 (release_7.3.123.g950be)

GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of
 2010-11-03 on potassium, modified by Debian

It looks like some problem with the font-locking: I suspect you have
`org-fontify-natively' set to a non-nil value and for whatever reason
Org tries to fontify the #+begin_html as a source block with the
language beeing the empty string.

I have no idea about how font-locking works, but one thing for sure:
The regexp in `org-fontify-meta-lines-in-blocks' does match
a #+begin_html statement and the matching group used to determine the
language (it's 7) returns an empty string.

Best,
  -- David

-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Debugger entered--Lisp error: (void-function -mode)
  2010-11-23 20:19 ` David Maus
@ 2010-11-23 21:10   ` Sébastien Vauban
  2010-11-28 20:27     ` David Maus
  2010-12-13 19:47     ` Eric Schulte
  0 siblings, 2 replies; 6+ messages in thread
From: Sébastien Vauban @ 2010-11-23 21:10 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi David,

David Maus wrote:
> Sébastien Vauban wrote:

Thanks a lot for looking at this, really!

>> When having the following code in any Org page, I now have an error generated.
>> 
>> - If the code is in a =begin_src html= block, no problem.
>> - If between a =begin_html=, see what I get.
>> 
>> * Some code
>> 
>> #+begin_html
>> <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
>> <script type="text/javascript">
>> $(document).ready(function () {
>> $('<a class="backtotop" href="#top">^</a>')
>>     .insertAfter('h2');
>> $('<a id="top"></a>')
>>     .prependTo('body');
>> });
>> </script>
>> #+end_html
>> 
>> * Debug info
>> 
>> #+begin_src emacs-lisp
>> Debugger entered--Lisp error: (void-function -mode)
>>   -mode()
>>   funcall(-mode)
>>   (if (eq major-mode lang-mode) nil (funcall lang-mode))
>>   (unless (eq major-mode lang-mode) (funcall lang-mode))
>>   (save-current-buffer (set-buffer (get-buffer-create ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
>>   (with-current-buffer (get-buffer-create (concat " org-src-fontification:" ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
>>   (let* ((lang-mode ...) (string ...) (modified ...) (org-buffer ...) pos next) (remove-text-properties start end (quote ...)) (with-current-buffer (get-buffer-create ...) (delete-region ... ...) (insert string) (unless ... ...) (font-lock-fontify-buffer) (setq pos ...) (while ... ... ...)) (add-text-properties start end (quote ...)) (set-buffer-modified-p modified))
>>   org-src-font-lock-fontify-block("" 27 287)
>> #+end_src
>> 
>> I don't understand why. Maybe it will ring a bell to you?
>
> I cannot reproduce this on
>
>
> Org-mode version 7.3 (release_7.3.123.g950be)
>
> GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of
>  2010-11-03 on potassium, modified by Debian
>
> It looks like some problem with the font-locking: I suspect you have
> `org-fontify-natively' set to a non-nil value and for whatever reason
> Org tries to fontify the #+begin_html as a source block with the
> language beeing the empty string.

I was testing some patches both from Eric and Dan (about native
fontification)...

I've pulled a new version, temporarily setting the patches aside, as I needed
to be able to export. Since then, I don't have the problem anymore.


> I have no idea about how font-locking works, but one thing for sure:
> The regexp in `org-fontify-meta-lines-in-blocks' does match
> a #+begin_html statement and the matching group used to determine the
> language (it's 7) returns an empty string.

That looks like the explanation of what I observed. Do I understand you
correctly if I read that the regexp should be patched to be more restrictive?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Debugger entered--Lisp error: (void-function -mode)
  2010-11-23 21:10   ` Sébastien Vauban
@ 2010-11-28 20:27     ` David Maus
  2010-12-13 19:47     ` Eric Schulte
  1 sibling, 0 replies; 6+ messages in thread
From: David Maus @ 2010-11-28 20:27 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 3982 bytes --]

At Tue, 23 Nov 2010 22:10:32 +0100,
Sébastien Vauban wrote:
> 
> Hi David,
> 
> David Maus wrote:
> > Sébastien Vauban wrote:
> 
> Thanks a lot for looking at this, really!
> 
> >> When having the following code in any Org page, I now have an error generated.
> >> 
> >> - If the code is in a =begin_src html= block, no problem.
> >> - If between a =begin_html=, see what I get.
> >> 
> >> * Some code
> >> 
> >> #+begin_html
> >> <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
> >> <script type="text/javascript">
> >> $(document).ready(function () {
> >> $('<a class="backtotop" href="#top">^</a>')
> >>     .insertAfter('h2');
> >> $('<a id="top"></a>')
> >>     .prependTo('body');
> >> });
> >> </script>
> >> #+end_html
> >> 
> >> * Debug info
> >> 
> >> #+begin_src emacs-lisp
> >> Debugger entered--Lisp error: (void-function -mode)
> >>   -mode()
> >>   funcall(-mode)
> >>   (if (eq major-mode lang-mode) nil (funcall lang-mode))
> >>   (unless (eq major-mode lang-mode) (funcall lang-mode))
> >>   (save-current-buffer (set-buffer (get-buffer-create ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
> >>   (with-current-buffer (get-buffer-create (concat " org-src-fontification:" ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
> >>   (let* ((lang-mode ...) (string ...) (modified ...) (org-buffer ...) pos next) (remove-text-properties start end (quote ...)) (with-current-buffer (get-buffer-create ...) (delete-region ... ...) (insert string) (unless ... ...) (font-lock-fontify-buffer) (setq pos ...) (while ... ... ...)) (add-text-properties start end (quote ...)) (set-buffer-modified-p modified))
> >>   org-src-font-lock-fontify-block("" 27 287)
> >> #+end_src
> >> 
> >> I don't understand why. Maybe it will ring a bell to you?
> >
> > I cannot reproduce this on
> >
> >
> > Org-mode version 7.3 (release_7.3.123.g950be)
> >
> > GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of
> >  2010-11-03 on potassium, modified by Debian
> >
> > It looks like some problem with the font-locking: I suspect you have
> > `org-fontify-natively' set to a non-nil value and for whatever reason
> > Org tries to fontify the #+begin_html as a source block with the
> > language beeing the empty string.
> 
> I was testing some patches both from Eric and Dan (about native
> fontification)...
> 
> I've pulled a new version, temporarily setting the patches aside, as I needed
> to be able to export. Since then, I don't have the problem anymore.
> 
> > I have no idea about how font-locking works, but one thing for sure:
> > The regexp in `org-fontify-meta-lines-in-blocks' does match
> > a #+begin_html statement and the matching group used to determine the
> > language (it's 7) returns an empty string.
> 
> That looks like the explanation of what I observed. Do I understand you
> correctly if I read that the regexp should be patched to be more restrictive?

Not sure, it might depend on the patches for native fontification: If
they (try to) fontify the #+begin_html block on purpose, than this
might be the case.  If not, than they shouldn't call the function.

But fontification and export of source blocks is still a mistery to
me :|

Best,
  -- David

PS: I don't read the list via this address, so it is a good idea to
always Cc: me in replies -- otherwise I only discover replies that
need action on my side when working on the issue file.

-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Debugger entered--Lisp error: (void-function -mode)
  2010-11-23 21:10   ` Sébastien Vauban
  2010-11-28 20:27     ` David Maus
@ 2010-12-13 19:47     ` Eric Schulte
  2010-12-13 20:39       ` Sébastien Vauban
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2010-12-13 19:47 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

Hi,

Does this error still exist?  If so could you send a small example
org-mode file which reproduces the problem?

Thanks, and my apologies if such an example has already been shared with
the list -- Eric

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

> Hi David,
>
> David Maus wrote:
>> Sébastien Vauban wrote:
>
> Thanks a lot for looking at this, really!
>
>>> When having the following code in any Org page, I now have an error generated.
>>> 
>>> - If the code is in a =begin_src html= block, no problem.
>>> - If between a =begin_html=, see what I get.
>>> 
>>> * Some code
>>> 
>>> #+begin_html
>>> <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
>>> <script type="text/javascript">
>>> $(document).ready(function () {
>>> $('<a class="backtotop" href="#top">^</a>')
>>>     .insertAfter('h2');
>>> $('<a id="top"></a>')
>>>     .prependTo('body');
>>> });
>>> </script>
>>> #+end_html
>>> 
>>> * Debug info
>>> 
>>> #+begin_src emacs-lisp
>>> Debugger entered--Lisp error: (void-function -mode)
>>>   -mode()
>>>   funcall(-mode)
>>>   (if (eq major-mode lang-mode) nil (funcall lang-mode))
>>>   (unless (eq major-mode lang-mode) (funcall lang-mode))
>>>   (save-current-buffer (set-buffer (get-buffer-create ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
>>>   (with-current-buffer (get-buffer-create (concat " org-src-fontification:" ...)) (delete-region (point-min) (point-max)) (insert string) (unless (eq major-mode lang-mode) (funcall lang-mode)) (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next ...) (put-text-property ... ... ... ... org-buffer) (setq pos next)))
>>>   (let* ((lang-mode ...) (string ...) (modified ...) (org-buffer ...) pos next) (remove-text-properties start end (quote ...)) (with-current-buffer (get-buffer-create ...) (delete-region ... ...) (insert string) (unless ... ...) (font-lock-fontify-buffer) (setq pos ...) (while ... ... ...)) (add-text-properties start end (quote ...)) (set-buffer-modified-p modified))
>>>   org-src-font-lock-fontify-block("" 27 287)
>>> #+end_src
>>> 
>>> I don't understand why. Maybe it will ring a bell to you?
>>
>> I cannot reproduce this on
>>
>>
>> Org-mode version 7.3 (release_7.3.123.g950be)
>>
>> GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of
>>  2010-11-03 on potassium, modified by Debian
>>
>> It looks like some problem with the font-locking: I suspect you have
>> `org-fontify-natively' set to a non-nil value and for whatever reason
>> Org tries to fontify the #+begin_html as a source block with the
>> language beeing the empty string.
>
> I was testing some patches both from Eric and Dan (about native
> fontification)...
>
> I've pulled a new version, temporarily setting the patches aside, as I needed
> to be able to export. Since then, I don't have the problem anymore.
>
>
>> I have no idea about how font-locking works, but one thing for sure:
>> The regexp in `org-fontify-meta-lines-in-blocks' does match
>> a #+begin_html statement and the matching group used to determine the
>> language (it's 7) returns an empty string.
>
> That looks like the explanation of what I observed. Do I understand you
> correctly if I read that the regexp should be patched to be more restrictive?
>
> Best regards,
>   Seb

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

* Re: Debugger entered--Lisp error: (void-function -mode)
  2010-12-13 19:47     ` Eric Schulte
@ 2010-12-13 20:39       ` Sébastien Vauban
  0 siblings, 0 replies; 6+ messages in thread
From: Sébastien Vauban @ 2010-12-13 20:39 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

"Eric Schulte" wrote:
> Does this error still exist?

Yes, I do think so, but...


> If so could you send a small example org-mode file which reproduces the
> problem?

I'm not able to reproduce it right now...

Thanks!

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-12-13 20:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22 20:48 Debugger entered--Lisp error: (void-function -mode) Sébastien Vauban
2010-11-23 20:19 ` David Maus
2010-11-23 21:10   ` Sébastien Vauban
2010-11-28 20:27     ` David Maus
2010-12-13 19:47     ` Eric Schulte
2010-12-13 20:39       ` Sébastien Vauban

Code repositories for project(s) associated with this 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).