From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: org-indent mode not indenting free text? Date: Sat, 04 Dec 2010 10:12:18 +0100 Message-ID: <87hbet7vgt.fsf@Rainer.invalid> References: <4CEBF039.6040503@ccbr.umn.edu> <87aakzj2l9.wl%n.goaziou@gmail.com> <87r5ebzsll.wl%dmaus@ictsoc.de> <87oc94hqv2.fsf@Rainer.invalid> <4CF91853.9090001@ccbr.umn.edu> <47210110-87A0-4895-9194-F6ACC1B4EF16@gmail.com> <4CF95F69.3050303@ccbr.umn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=49749 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POoAT-0005JK-C4 for emacs-orgmode@gnu.org; Sat, 04 Dec 2010 04:12:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POoAS-0001PL-4D for emacs-orgmode@gnu.org; Sat, 04 Dec 2010 04:12:33 -0500 Received: from lo.gmane.org ([80.91.229.12]:41885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POoAR-0001P2-JF for emacs-orgmode@gnu.org; Sat, 04 Dec 2010 04:12:32 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1POoAQ-0004hV-9F for emacs-orgmode@gnu.org; Sat, 04 Dec 2010 10:12:30 +0100 Received: from p57aacc03.dip.t-dialin.net ([87.170.204.3]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Dec 2010 10:12:30 +0100 Received: from Stromeko by p57aacc03.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Dec 2010 10:12:30 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Eric, Erik Iverson 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