emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: org-indent mode not indenting free text?


From: Achim Gratz
Subject: [Orgmode] Re: org-indent mode not indenting free text?
Date: Sat, 04 Dec 2010 10:12:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi Eric,

Erik Iverson <address@hidden> writes:
> It only appears defined for Emacs < 23.2,
> So in particular, 23.1.50 is 'stuck' in
> between these two version checks, and maybe
> that's causing Antti's issue?

Sorry for the confusion and my apologies for any trouble I have caused.

When introducing this patch I referred to the documentation that said
"with-silent-modifications" was introduced in Emacs 23.2, hence the test
for this version.  I was completely unaware of Emacs 23.1.50, which must
have this function, otherwise org-indent-mode should not work as it is
currently implemented.  In earlier versions of org-indent-mode the call
to with-silent-modifications had been using org-unmodified (see [1] for
why it has been changed), hence my attempt to redefine
with-silent-modifications with org-unmodified when unavailable.  The
problems on Emacs 23.1.50 prove that these two are not really
interchangeable, but I was hoping for "close enough".

As I understand, the crashes Emacs <23.1.50 with org-indent-mode have
nothing to do with the bug that got fixed by with-silent-modifications,
so these are really different issues.  For the reasons outlined above my
attempted patch is botched, but I'm not sure how to proceed.  Maybe a
better idea is to revert org-indent back to using org-unmodified and
implementing this macro using with-silent-modifications on Emacsen where
it is available.  Since org-unmodified is used in many more places this
would need some testing, but it might be easier to maintain in the long
run.

(defmacro org-unmodified (&rest body)
  "Execute body without changing `buffer-modified-p'.
Also, do not record undo information."
  (if (not (fboundp 'with-silent-modifications))
      `(set-buffer-modified-p
        (prog1 (buffer-modified-p)
          (let ((buffer-undo-list t)
                before-change-functions after-change-functions)
            ,@body)))
    `(with-silent-modifications ,@body)))

The version check in org-indent.el should probably be replaced by a
feature-check for with-silent-modifications to avoid the bug in [1].

[1] http://comments.gmane.org/gmane.emacs.orgmode/31927



Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves




reply via email to

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