emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-mode with multiple major modes
@ 2007-09-28  9:04 Julien Barnier
  2007-09-28 10:26 ` Adam Spiers
  0 siblings, 1 reply; 6+ messages in thread
From: Julien Barnier @ 2007-09-28  9:04 UTC (permalink / raw)
  To: emacs-orgmode

Hi to all,

And first of all, thanks for this stunning tool.

My problem is that I'd like to use org-mode in conjunction with
noweb-mode, which is used to distinguish code chunks and doc chunks in
my file, using two different major modes for each one (with org-mode
used for doc chunks).

It works great, except that when I move from a code chunk to a doc
chunk, org-mode seems to apply its startup options, and specially the
org-startup-folded one. So if I fold or unfold some sections in my
doc chunks, they are all folded or unfolded (depending on the
org-startup-folded value) when I move from a code chunk to a doc
chunk.

Do you have any idea on how to solve this minor point ?

Thanks in advance for any help,

-- 
Julien

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

* Re: Org-mode with multiple major modes
  2007-09-28  9:04 Org-mode with multiple major modes Julien Barnier
@ 2007-09-28 10:26 ` Adam Spiers
  2007-09-28 11:23   ` Julien Barnier
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Spiers @ 2007-09-28 10:26 UTC (permalink / raw)
  To: emacs-orgmode

On Fri, Sep 28, 2007 at 11:04:35AM +0200, Julien Barnier wrote:
> Hi to all,
> 
> And first of all, thanks for this stunning tool.
> 
> My problem is that I'd like to use org-mode in conjunction with
> noweb-mode, which is used to distinguish code chunks and doc chunks in
> my file, using two different major modes for each one (with org-mode
> used for doc chunks).
> 
> It works great, except that when I move from a code chunk to a doc
> chunk, org-mode seems to apply its startup options, and specially the
> org-startup-folded one. So if I fold or unfold some sections in my
> doc chunks, they are all folded or unfolded (depending on the
> org-startup-folded value) when I move from a code chunk to a doc
> chunk.
> 
> Do you have any idea on how to solve this minor point ?

Hi Julien,

Would this solve your problem?

  http://mmm-mode.sourceforge.net/

"MMM Mode is an emacs add-on package providing a minor mode that
allows Multiple Major Modes to coexist in one buffer."

Adam

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

* Re: Org-mode with multiple major modes
  2007-09-28 10:26 ` Adam Spiers
@ 2007-09-28 11:23   ` Julien Barnier
  2007-09-29 12:49     ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Julien Barnier @ 2007-09-28 11:23 UTC (permalink / raw)
  To: emacs-orgmode

Hi Adam,

> Would this solve your problem?
>
>   http://mmm-mode.sourceforge.net/
>
> "MMM Mode is an emacs add-on package providing a minor mode that
> allows Multiple Major Modes to coexist in one buffer."

In fact, I already have my two major modes coexisting in the same
buffer thanks to noweb-mode. What I am looking for is a way to
disable the org-startup-folded call when I move from a code chunk (in
another mode) to a doc chunk (in org-mode).

I don't think mmm-mode would solve the problem.

Thanks for your help,

-- 
Julien

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

* Re: Re: Org-mode with multiple major modes
  2007-09-28 11:23   ` Julien Barnier
@ 2007-09-29 12:49     ` Carsten Dominik
  2007-09-29 21:26       ` Julien Barnier
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2007-09-29 12:49 UTC (permalink / raw)
  To: Julien Barnier; +Cc: emacs-orgmode

(setq org-startup-folded nil)

- Carsten

On Sep 28, 2007, at 13:23, Julien Barnier wrote:

> Hi Adam,
>
>> Would this solve your problem?
>>
>>   http://mmm-mode.sourceforge.net/
>>
>> "MMM Mode is an emacs add-on package providing a minor mode that
>> allows Multiple Major Modes to coexist in one buffer."
>
> In fact, I already have my two major modes coexisting in the same
> buffer thanks to noweb-mode. What I am looking for is a way to
> disable the org-startup-folded call when I move from a code chunk (in
> another mode) to a doc chunk (in org-mode).
>
> I don't think mmm-mode would solve the problem.
>
> Thanks for your help,
>
> -- 
> Julien
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: Org-mode with multiple major modes
  2007-09-29 12:49     ` Carsten Dominik
@ 2007-09-29 21:26       ` Julien Barnier
  2007-09-30 14:10         ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Julien Barnier @ 2007-09-29 21:26 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

> (setq org-startup-folded nil)

Thanks for your answer, but it doesn't do what I wish. If I have some
part of my file folded and others not, with org-startup-folded set to
nil, when I move from a code chunk to a doc chunk, everything is
unfolded.

What I'd like is a way to disable this feature, or to enable it only
when I open the file, not when I switch from another mode to org-mode
in the same buffer.

But maybe it is a bit complicated for a minor issue.

Thanks again,

-- 
Julien

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

* Re: Re: Org-mode with multiple major modes
  2007-09-29 21:26       ` Julien Barnier
@ 2007-09-30 14:10         ` Carsten Dominik
  0 siblings, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2007-09-30 14:10 UTC (permalink / raw)
  To: Julien Barnier; +Cc: emacs-orgmode


On Sep 29, 2007, at 23:26, Julien Barnier wrote:

> Hi,
>
>> (setq org-startup-folded nil)
>
> Thanks for your answer, but it doesn't do what I wish. If I have some
> part of my file folded and others not, with org-startup-folded set to
> nil, when I move from a code chunk to a doc chunk, everything is
> unfolded.

This is a different issue, and happens because is because outline-mode
pushes a `show-all' onto `change-major-mode-hook'.  Normally, this is
a good thing, of course, but not in your case.  So you need to
do something like

(add-hook 'org-mode-hook
    (lambda () (remove-hooK 'change-major-mode-hook 'show-all)))

However, written like this it will *always* be removed, so you need to
program it a bit more complex, with a test that the current buffer is
this is a noweb buffer or somwthing similar.

Hope this helps.

- Carsten


>
> What I'd like is a way to disable this feature, or to enable it only
> when I open the file, not when I switch from another mode to org-mode
> in the same buffer.
>
> But maybe it is a bit complicated for a minor issue.
>
> Thanks again,
>
> -- 
> Julien
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

end of thread, other threads:[~2007-09-30 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-28  9:04 Org-mode with multiple major modes Julien Barnier
2007-09-28 10:26 ` Adam Spiers
2007-09-28 11:23   ` Julien Barnier
2007-09-29 12:49     ` Carsten Dominik
2007-09-29 21:26       ` Julien Barnier
2007-09-30 14:10         ` Carsten Dominik

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