emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Editing HTML blocks: no special environment to edit here
@ 2013-08-21  9:12 Karl Voit
  2013-08-22  8:55 ` Karl Voit
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Voit @ 2013-08-21  9:12 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

Org-mode version 8.0.2 (release_8.0.2-121-g86fab4 from the git
repository a couple of weeks ago)

        #+BEGIN_SRC html
        bar
        #+END_SRC
        
        #+BEGIN_HTML
        foo
        #+END_HTML

I can edit "bar" in a separate buffer by invoking C-c '
(org-edit-special). However, this does not work for "foo"
("user-error: No special environment to edit here") although I guess
that the foo-html-block is the one that should be preferred.[1]

It is either rooted in my personal set-up, my (older) org-mode
version from git, or a general bug.

So I started Emacs with "--no-init-file" and got "Org-mode version
6.33x" (the site-specific org installation). After I evaluated the
statements to my local org-mode installation I got "Org-mode version
6.33x (release_8.0.2.121.g86fab)". Strange (6.33x vs. 8.0.2...) but
I hope this worked so far and I got the newer release from git.

In this rather minimal Emacs, I can edit both blocks as special
buffers as I want to.

So I guess I did something in my Org-mode setup files [2] which
causes this issue. Unfortunately, I could not locate anything which
I identify as the root of this issue.

Do you have any idea what this might be?


  1. There is not even an entry for "html" on 
     http://orgmode.org/worg/org-contrib/babel/languages.html

  2. https://github.com/novoid/dot-emacs -> org-mode.el

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-21  9:12 Editing HTML blocks: no special environment to edit here Karl Voit
@ 2013-08-22  8:55 ` Karl Voit
  2013-08-22  8:57   ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Voit @ 2013-08-22  8:55 UTC (permalink / raw)
  To: emacs-orgmode

* Karl Voit <devnull@Karl-Voit.at> wrote:
>
> Org-mode version 8.0.2 (release_8.0.2-121-g86fab4 from the git
> repository a couple of weeks ago)
>
>         #+BEGIN_SRC html
>         bar
>         #+END_SRC
>         
>         #+BEGIN_HTML
>         foo
>         #+END_HTML
>
> I can edit "bar" in a separate buffer by invoking C-c '
> (org-edit-special). However, this does not work for "foo"
> ("user-error: No special environment to edit here") although I guess
> that the foo-html-block is the one that should be preferred.[1]
>
> It is either rooted in my personal set-up, my (older) org-mode
> version from git, or a general bug.

I did some additional tests and now I am sure that this is not
because of my org-mode.el configuration.

Can someone please test her/his current setup if BEGIN_HTML-blocks
can be edited by <C-c '> ? Thanks!

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-22  8:55 ` Karl Voit
@ 2013-08-22  8:57   ` Nicolas Goaziou
  2013-08-22 11:07     ` Karl Voit
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2013-08-22  8:57 UTC (permalink / raw)
  To: news1142; +Cc: emacs-orgmode

Hello,

Karl Voit <devnull@Karl-Voit.at> writes:

> Can someone please test her/his current setup if BEGIN_HTML-blocks
> can be edited by <C-c '> ? Thanks!

I can.


Regards,

-- 
Nicolas Goaziou

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-22  8:57   ` Nicolas Goaziou
@ 2013-08-22 11:07     ` Karl Voit
  2013-08-22 12:02       ` Nick Dokos
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Voit @ 2013-08-22 11:07 UTC (permalink / raw)
  To: emacs-orgmode

* Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Hello,
>
> Karl Voit <devnull@Karl-Voit.at> writes:
>
>> Can someone please test her/his current setup if BEGIN_HTML-blocks
>> can be edited by <C-c '> ? Thanks!
>
> I can.

Damn.

However, I did a fresh "git pull" (release_8.0.7-384-g6fdc23) and
still get this behavior:

#+BEGIN_HTML
  bar
#+END_HTML

... cannot be edited via «C-c '».


Then I replaced by ~/.emacs with a file containing only the
following lines:

  ;; set paths to manually installed Org-mode (from git)
  (add-to-list 'load-path "~/.emacs.d/contrib/org-mode/contrib/lisp")
  (add-to-list 'load-path (expand-file-name "~/.emacs.d/contrib/org-mode/lisp"))

... and started using: «emacs --no-site-file org/test.org». This
should eliminate all local settings.

With «Org-mode version 8.0.7 (release_8.0.7-384-g6fdc23 @
/home/vk/.emacs.d/contrib/org-mode/lisp/)» I still can not edit HTML
blocks :-(


I am no Emacs pro. However, I tend to think that this is a bug in
Org-mode.

Or: what else can I check on my side?

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-22 11:07     ` Karl Voit
@ 2013-08-22 12:02       ` Nick Dokos
  2013-08-22 13:03         ` Karl Voit
  0 siblings, 1 reply; 10+ messages in thread
From: Nick Dokos @ 2013-08-22 12:02 UTC (permalink / raw)
  To: emacs-orgmode

Karl Voit <devnull@Karl-Voit.at> writes:

> * Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>> Hello,
>>
>> Karl Voit <devnull@Karl-Voit.at> writes:
>>
>>> Can someone please test her/his current setup if BEGIN_HTML-blocks
>>> can be edited by <C-c '> ? Thanks!
>>
>> I can.
>
> Damn.
>

I can too: Org-mode version 8.0.7 (release_8.0.7-380-g2a28de @
/home/nick/elisp/org-mode/lisp/)

> However, I did a fresh "git pull" (release_8.0.7-384-g6fdc23) and
> still get this behavior:
>
> #+BEGIN_HTML
>   bar
> #+END_HTML
>
> ... cannot be edited via «C-c '».
>
>
> Then I replaced by ~/.emacs with a file containing only the
> following lines:
>
>   ;; set paths to manually installed Org-mode (from git)
>   (add-to-list 'load-path "~/.emacs.d/contrib/org-mode/contrib/lisp")
>   (add-to-list 'load-path (expand-file-name "~/.emacs.d/contrib/org-mode/lisp"))
>
> ... and started using: «emacs --no-site-file org/test.org». This
> should eliminate all local settings.
>
> With «Org-mode version 8.0.7 (release_8.0.7-384-g6fdc23 @
> /home/vk/.emacs.d/contrib/org-mode/lisp/)» I still can not edit HTML
> blocks :-(
>
>
> I am no Emacs pro. However, I tend to think that this is a bug in
> Org-mode.
>
> Or: what else can I check on my side?

Maybe you can edebug-defun the function org-edit-special and step
through it to see where it goes astray in the html case.

-- 
Nick

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-22 12:02       ` Nick Dokos
@ 2013-08-22 13:03         ` Karl Voit
  2013-08-22 13:59           ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Voit @ 2013-08-22 13:03 UTC (permalink / raw)
  To: emacs-orgmode

Hello Nick!

* Nick Dokos <ndokos@gmail.com> wrote:
> Karl Voit <devnull@Karl-Voit.at> writes:
>
>> However, I did a fresh "git pull" (release_8.0.7-384-g6fdc23) and
>> still get this behavior:
>>
>> #+BEGIN_HTML
>>   bar
>> #+END_HTML
>> ... cannot be edited via «C-c '».
>>
>> Or: what else can I check on my side?
>
> Maybe you can edebug-defun the function org-edit-special and step
> through it to see where it goes astray in the html case.

First time I used edebug! Great experience :-)

OK, so I guess I nailed it down to the line which goes wrong:

«org-edit-special» is defined in «org.el»:

The line «(case (org-element-type element)» does not result
positively. Instead, it results to:

Result: (paragraph (:begin 182 :end 188 :contents-begin 182
:contents-end 188 :post-blank 0 :post-affiliated 182 :parent
(special-block (:type "HTML" :begin 169 :end 200 :hiddenp nil
:contents-begin 182 :contents-end 188 :post-blank 1 :post-affiliated
169 :parent nil)))) 

This way, the main routines are not executed. Instead, the line «(if
(eq (org-element-type...» gets evaluated next.

In short: «#+BEGIN_HTML» is not of element type «element» and thus
ignored by «org-edit-special».

I hope, I did not misinterpret the debugging result.

In case my interpretation is correct, it still seems to be a bug of
Org-mode and not my setup. So why does your setup work properly?

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-22 13:03         ` Karl Voit
@ 2013-08-22 13:59           ` Nicolas Goaziou
  2013-08-22 14:46             ` Karl Voit
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2013-08-22 13:59 UTC (permalink / raw)
  To: news1142; +Cc: emacs-orgmode

Karl Voit <devnull@Karl-Voit.at> writes:

> Hello Nick!
>
> * Nick Dokos <ndokos@gmail.com> wrote:
>> Karl Voit <devnull@Karl-Voit.at> writes:
>>
>>> However, I did a fresh "git pull" (release_8.0.7-384-g6fdc23) and
>>> still get this behavior:
>>>
>>> #+BEGIN_HTML
>>>   bar
>>> #+END_HTML
>>> ... cannot be edited via «C-c '».
>>>
>>> Or: what else can I check on my side?
>>
>> Maybe you can edebug-defun the function org-edit-special and step
>> through it to see where it goes astray in the html case.
>
> First time I used edebug! Great experience :-)
>
> OK, so I guess I nailed it down to the line which goes wrong:
>
> «org-edit-special» is defined in «org.el»:
>
> The line «(case (org-element-type element)» does not result
> positively. Instead, it results to:
>
> Result: (paragraph (:begin 182 :end 188 :contents-begin 182
> :contents-end 188 :post-blank 0 :post-affiliated 182 :parent
> (special-block (:type "HTML" :begin 169 :end 200 :hiddenp nil
> :contents-begin 182 :contents-end 188 :post-blank 1 :post-affiliated
> 169 :parent nil)))) 
>
> This way, the main routines are not executed. Instead, the line «(if
> (eq (org-element-type...» gets evaluated next.
>
> In short: «#+BEGIN_HTML» is not of element type «element» and thus
> ignored by «org-edit-special».
>
> I hope, I did not misinterpret the debugging result.
>
> In case my interpretation is correct, it still seems to be a bug of
> Org-mode and not my setup. So why does your setup work properly?

It only means that you didn't load `html' back-end. So the parser cannot
recognize "html" blocks as export blocks.


Regards,

-- 
Nicolas Goaziou

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-22 13:59           ` Nicolas Goaziou
@ 2013-08-22 14:46             ` Karl Voit
  2013-08-22 16:38               ` Suvayu Ali
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Voit @ 2013-08-22 14:46 UTC (permalink / raw)
  To: emacs-orgmode

* Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Karl Voit <devnull@Karl-Voit.at> writes:
>
>> In short: «#+BEGIN_HTML» is not of element type «element» and thus
>> ignored by «org-edit-special».
>
> It only means that you didn't load `html' back-end. So the parser cannot
> recognize "html" blocks as export blocks.

OK, two lines and even I with my limited ELISP-knowledge start to
see that I did blame Org-mode for no profound reason :-)

Sorry to be cumbersome but I could not find anything related to
«html back-end» in the documentation. Where do I have to look in
order to learn how to fix my issue?

Thanks!

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

* Re: Editing HTML blocks: no special environment to edit here
  2013-08-22 14:46             ` Karl Voit
@ 2013-08-22 16:38               ` Suvayu Ali
  2013-08-22 17:44                 ` Editing HTML blocks: no special environment to edit here - solved Karl Voit
  0 siblings, 1 reply; 10+ messages in thread
From: Suvayu Ali @ 2013-08-22 16:38 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Aug 22, 2013 at 04:46:49PM +0200, Karl Voit wrote:
> * Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> > Karl Voit <devnull@Karl-Voit.at> writes:
> >
> >> In short: «#+BEGIN_HTML» is not of element type «element» and thus
> >> ignored by «org-edit-special».
> >
> > It only means that you didn't load `html' back-end. So the parser cannot
> > recognize "html" blocks as export blocks.
> 
> OK, two lines and even I with my limited ELISP-knowledge start to
> see that I did blame Org-mode for no profound reason :-)
> 
> Sorry to be cumbersome but I could not find anything related to
> «html back-end» in the documentation. Where do I have to look in
> order to learn how to fix my issue?

All supported exporters are known as backends in Org lingo.  So I guess
you just need a: 

  (require 'ox-html)

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Editing HTML blocks: no special environment to edit here - solved
  2013-08-22 16:38               ` Suvayu Ali
@ 2013-08-22 17:44                 ` Karl Voit
  0 siblings, 0 replies; 10+ messages in thread
From: Karl Voit @ 2013-08-22 17:44 UTC (permalink / raw)
  To: emacs-orgmode

* Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
> On Thu, Aug 22, 2013 at 04:46:49PM +0200, Karl Voit wrote:
>> 
>> Sorry to be cumbersome but I could not find anything related to
>> «html back-end» in the documentation. Where do I have to look in
>> order to learn how to fix my issue?
>
> All supported exporters are known as backends in Org lingo.  So I guess
> you just need a: 
>
>   (require 'ox-html)

Oh wow, it seems I missed a lot of export backends then (since 8.0).

I found [1] and [2] and added quite a number of require-statements
to my configuration :-)

Thanks for solving my issue - I am now able to edit HTML blocks!


  1. http://orgmode.org/worg/exporters/ox-overview.html
  2. http://orgmode.org/worg/org-8.0.html
-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

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

end of thread, other threads:[~2013-08-22 17:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-21  9:12 Editing HTML blocks: no special environment to edit here Karl Voit
2013-08-22  8:55 ` Karl Voit
2013-08-22  8:57   ` Nicolas Goaziou
2013-08-22 11:07     ` Karl Voit
2013-08-22 12:02       ` Nick Dokos
2013-08-22 13:03         ` Karl Voit
2013-08-22 13:59           ` Nicolas Goaziou
2013-08-22 14:46             ` Karl Voit
2013-08-22 16:38               ` Suvayu Ali
2013-08-22 17:44                 ` Editing HTML blocks: no special environment to edit here - solved Karl Voit

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