help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reverting trouble


From: Thorsten Jolitz
Subject: Reverting trouble
Date: Fri, 21 Jun 2013 13:08:11 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Hi List,

I have a function that transforms Org-mode files to programming-language
source files, say Emacs Lisp files. More exactly, I create a buffer in
emacs-lisp-mode that might optionally be saved to an .el file.

For emacs-lisp-mode, I have 'outline-minor-mode in the mode hook, and for
outline-minor-mode, I have 'outshine-hook-function in the mode hook (i.e. I
use outline-minor-mode with 'outshine.el' extensions).

Now I have the following problems:

- Case 1 :: unsaved buffer (without buffer-file)

            The buffer is in emacs-lisp-mode, outline-minor-mode (with
            outshine) is activated, and the transformed code looks as it
            should. However, the outshine functionality does not work and the
            headline fontification normally done by outshine is missing.

- Case 2 :: buffer saved to .el file inside the transformation function

            The buffer is in emacs-lisp-mode, outline-minor-mode (with
            outshine) is activated, and the transformed code looks as it
            should - just like above. And again, outshine functionality and
            fontification is missing.

            In this case, revert-buffer is the remedy - then the buffer
            becomes an 'outshine' buffer as the mode-line suggests.


My questions are:

1. does outline(-minor-mode) need a (buffer-)file, or does it work with an
   unsaved buffer too?
2. if so, how must I treat the unsaved buffer from Case 1 to activate the
   outline/outshine functionality?
3. why do I have to revert the buffer in case 2, although I just saved it
   with 'save-buffer' in the transformation function, and nothing changed
   since then?

Question 3 has probably to do with calling hooks. But why is it different to
call 'emacs-lisp-mode on an existing buffer (and then eventually save it to
an .el file) than to open an exiting .el file (in this normal case outshine
functionality and fontification is there right away). 

        --
        cheers,
        Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]