From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: bug#12905: 24.2.50; org: edit source block causes data loss Date: Thu, 13 Dec 2012 11:36:35 +0100 Message-ID: <8738za44ss.fsf@bzg.ath.cx> References: <50A62865.8010904@gmail.com> <87sj7han8a.fsf__16482.9143243425$1354894646$gmane$org@gnu.org> <87wqwnyzud.fsf__32428.3239235685$1355331429$gmane$org@bzg.ath.cx> <87bodzt201.fsf@norang.ca> <877gom7tc3.fsf@bzg.ath.cx> <876246skbt.fsf@norang.ca> <87lid262rf.fsf@norang.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj69l-0008Io-Op for emacs-orgmode@gnu.org; Thu, 13 Dec 2012 05:36:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tj69e-00010Z-EC for emacs-orgmode@gnu.org; Thu, 13 Dec 2012 05:36:45 -0500 Received: from mail-wg0-f41.google.com ([74.125.82.41]:50702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj69e-0000zb-5b for emacs-orgmode@gnu.org; Thu, 13 Dec 2012 05:36:38 -0500 Received: by mail-wg0-f41.google.com with SMTP id ds1so2237889wgb.0 for ; Thu, 13 Dec 2012 02:36:37 -0800 (PST) In-Reply-To: <87lid262rf.fsf@norang.ca> (Bernt Hansen's message of "Wed, 12 Dec 2012 22:37:40 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Bernt, thanks for chasing this down. I tried to install emacs-23.2 but it does not compile on my machine. Does this patch fixes the problem for you? My guess is that (copy-marker nil t) returns an error on emacs-23.2. It's a weird sexp anyway, make-marker and set-marker-insertion-type are cleaner IMO. Thanks for testing, --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=org-src.el.patch diff --git a/lisp/org-src.el b/lisp/org-src.el index f91da19..d2c3e19 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -228,12 +228,11 @@ buffer." (full-info (org-babel-get-src-block-info 'light)) (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive (beg (make-marker)) - ;; Move marker with inserted text for case when src block is - ;; just one empty line, i.e. beg == end. - (end (copy-marker nil t)) + (end (make-marker)) (allow-write-back-p (null code)) block-nindent total-nindent ovl lang lang-f single lfmt buffer msg begline markline markcol line col transmitted-variables) + (set-marker-insertion-type end t) (if (not info) nil (setq beg (move-marker beg (nth 0 info)) --=-=-= Content-Type: text/plain -- Bastien --=-=-=--