From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Iverson Subject: Re: Bug: inline image display not working when org-indent-mode active, follow-up Date: Thu, 05 Aug 2010 23:56:35 -0500 Message-ID: <4C5B9603.4020905@ccbr.umn.edu> References: <4C5A1FC3.5000201@ccbr.umn.edu> <4C5A778E.2020301@os.inf.tu-dresden.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=50874 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhEv3-0006as-VR for emacs-orgmode@gnu.org; Fri, 06 Aug 2010 00:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhEv2-0004s6-QV for emacs-orgmode@gnu.org; Fri, 06 Aug 2010 00:52:33 -0400 Received: from pegasus.biostat.wisc.edu ([144.92.73.35]:63652) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhEv2-0004rr-KW for emacs-orgmode@gnu.org; Fri, 06 Aug 2010 00:52:32 -0400 In-Reply-To: <4C5A778E.2020301@os.inf.tu-dresden.de> 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: Martin Pohlack Cc: emacs-orgmode On 08/05/2010 03:34 AM, Martin Pohlack wrote: > Hi, > > On 05.08.2010 04:19, Erik Iverson wrote: >> In the past few weeks, I found that the overlays of inline images in >> my org-mode >> files would flash quickly and then be deleted when using >> org-indent-mode. This >> also happened when re-running an org-babel source block that generates >> graphical >> output, even without org-indent-mode turned on.[1] >> >> I believe I've tracked this down to the following patch, >> >> http://www.mail-archive.com/emacs-orgmode@gnu.org/msg25738.html > If a functions want to elide trigger the modification hooks it should > bind: inhibit-modification-hooks. > Could you try to find out the path from where these modifications > occur, insert a relevant bind there, and see if this helps? OK, seems like I got it! Issue 1: The overlays would disappear when org-indent-mode was turned on. Solution: Simply bind inhibit-modification-hooks in org-indent-refresh-section. Do other functions in org-indent.el need this? Possibly, but it seems like this worked in my basic testing. diff --git a/lisp/org-indent.el b/lisp/org-indent.el index 45865d1..f6b0487 100644 --- a/lisp/org-indent.el +++ b/lisp/org-indent.el @@ -251,7 +251,7 @@ Assumes that BEG is at the beginning of a line." Point is assumed to be at the beginning of a headline." (interactive) (when org-indent-mode - (let (beg end) + (let ((beg end) (inhibit-modification-hooks t)) (save-excursion (when (ignore-errors (org-back-to-heading)) (setq beg (point)) Issue 2: The overlays would quickly appear, then disappear when running an org-babel source block that generates graphical output, say, in R. This was actually tracked down to using pabbrev.el [2] in my org buffers. Ugh. Since this isn't org related, there's nothing in org to fix, but on the very small chance someone else ever has their inline images disappearing in org-mode, and uses pabbrev mode, I fixed it by simply binding inhibit-modification-hooks in the let block in pabbrev-mark-add-word. [2] http://homepages.cs.ncl.ac.uk/phillip.lord/download/emacs/pabbrev.el