unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Reverting trouble
@ 2013-06-21 11:08 Thorsten Jolitz
  0 siblings, 0 replies; only message in thread
From: Thorsten Jolitz @ 2013-06-21 11:08 UTC (permalink / raw)
  To: help-gnu-emacs


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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-21 11:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-21 11:08 Reverting trouble Thorsten Jolitz

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