From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Re: Crash of emacs when using SHIFT-TAB Date: Mon, 5 Jul 2010 22:34:06 +0200 Message-ID: References: <20AAFFE1-F2E6-4EF4-B914-6BAF9D17AF3B@gmail.com> <87y6dpg73x.fsf@riotblast.dunsmor.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1720852123==" Return-path: Received: from [140.186.70.92] (port=59849 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVsMj-0008JI-83 for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 16:34:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVsMh-0000p1-N7 for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 16:34:09 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:45522) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVsMh-0000on-EJ for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 16:34:07 -0400 Received: by pxi7 with SMTP id 7so960145pxi.0 for ; Mon, 05 Jul 2010 13:34:06 -0700 (PDT) In-Reply-To: <87y6dpg73x.fsf@riotblast.dunsmor.com> 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: Jason Dunsmore Cc: emacs-orgmode@gnu.org --===============1720852123== Content-Type: multipart/alternative; boundary=00163646c256a9d798048aa9dbec --00163646c256a9d798048aa9dbec Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jul 5, 2010 at 7:40 PM, Jason Dunsmore wrote: > Carsten Dominik writes: > > >> Hi > >> > >> my emacs is crashing quite regularly when I am using org-babel. Is > >> there a way to get a traceback or something similar which I could > >> submit to get an idea what is causing it? > > > > I think this has probably nothing to do with org-babel. More likely, > > you are using org-indent-mode, on an Emacs version where it does not > > work. Check the Org manual for the exact version of Emacs you need. > > I was bitten by this same bug. I narrowed it down to org-indent, but I > had no idea I should look in the manual to see which version of emacs > org-indent was compatible with. > > Here's a patch that will make emacs display an error if org-indent is > loaded with an incompatible version of emacs: > > --8<---------------cut here---------------start------------->8--- > diff --git a/lisp/org-indent.el b/lisp/org-indent.el > index 77411af..0ef8456 100644 > --- a/lisp/org-indent.el > +++ b/lisp/org-indent.el > @@ -131,6 +131,18 @@ FIXME: How to update when broken?" > (setq org-indent-mode nil) > (if org-indent-mode > (progn > + (destructuring-bind (maj min bld) > + (mapcar 'string-to-number (split-string emacs-version > "[.]")) > + (let ((msg "Emacs 23.1.50.3 or greater is recommended for > org-indent > + (when (< maj 23) > + (display-warning 'org msg :warning)) > + (when (= maj 23) > + (unless (>= bld 50) > + (display-warning 'org msg :warning))) > + (when (and (= maj 23) > + (= bld 50)) > + (unless (>= min 1) > + (display-warning 'org msg :warning))))) > (org-set-local 'indent-tabs-mode nil) > (or org-indent-strings (org-indent-initialize)) > (when org-indent-mode-turns-off-org-adapt-indentation > --8<---------------cut here---------------end--------------->8--- > > Perhaps this would be better as a separate function: > > --8<---------------cut here---------------start------------->8--- > (defun org-version-check (version feature level) > (destructuring-bind (rmaj rmin rbld) > (mapcar 'string-to-number (split-string version "[.]")) > (destructuring-bind (maj min bld) > (mapcar 'string-to-number (split-string emacs-version "[.]")) > (let ((msg (format "Emacs %s or greater is recommended for %s" version > feature))) > (when (< maj rmaj) > (display-warning 'org msg level)) > (when (= maj rmaj) > (unless (>= min rmin) > (display-warning 'org msg level))) > (when (and (= maj rmaj) > (= min rmin)) > (unless (>= bld rbld) > (display-warning 'org msg level))))))) > --8<---------------cut here---------------end--------------->8--- > > It could then be called with: > > (org-version-check "23.1.50" "org-indent" :warning) > > I made it display a warning because org-indent seems to work almost > perfectly with the version of emacs I'm running (23.1.1). > I think that is a brilliant idea, especially as the repositories from ubuntu do not yet include emacs 23.2. Cheers, Rainer > Regards, > Jason > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: Rainer@krugs.de Skype: RMkrug Google: R.M.Krug@gmail.com --00163646c256a9d798048aa9dbec Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Jul 5, 2010 at 7:40 PM, Jason Du= nsmore <e= macs-orgmode@dunsmor.com> wrote:
Carsten Dominik <carsten.dominik@gmail.com> writes:

>> Hi
>>
>> my emacs is crashing quite regularly when I am using org-babel. Is=
>> there a way to get a traceback or something similar which I could<= br> >> submit to get an idea what is causing it?
>
> I think this has probably nothing to do with org-babel. =A0More likely= ,
> you are using org-indent-mode, on an Emacs version where it does not > work. =A0Check the Org manual for the exact version of Emacs you need.=

I was bitten by this same bug. =A0I narrowed it down to org-indent, b= ut I
had no idea I should look in the manual to see which version of emacs
org-indent was compatible with.

Here's a patch that will make emacs display an error if org-indent is loaded with an incompatible version of emacs:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-indent.el b/lisp/org-indent.el
index 77411af..0ef8456 100644
--- a/lisp/org-indent.el
+++ b/lisp/org-indent.el
@@ -131,6 +131,18 @@ FIXME: =A0How to update when broken?"
=A0 =A0 =A0 (setq org-indent-mode nil)
=A0 =A0 (if org-indent-mode
=A0 =A0 =A0 =A0(progn
+ =A0 =A0 =A0 =A0 =A0(destructuring-bind (maj min bld)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0(mapcar 'string-to-number (split-string em= acs-version "[.]"))
+ =A0 =A0 =A0 =A0 =A0 =A0(let ((msg "Emacs 23.1.50.3 or greater is rec= ommended for org-indent
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0(when (< maj 23)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(display-warning 'org msg :warning)) + =A0 =A0 =A0 =A0 =A0 =A0 =A0(when (=3D maj 23)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(unless (>=3D bld 50)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(display-warning 'org msg :warning= )))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0(when (and (=3D maj 23)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (=3D bld 50))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(unless (>=3D min 1)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(display-warning 'org msg :warning= )))))
=A0 =A0 =A0 =A0 =A0(org-set-local 'indent-tabs-mode nil)
=A0 =A0 =A0 =A0 =A0(or org-indent-strings (org-indent-initialize))
=A0 =A0 =A0 =A0 =A0(when org-indent-mode-turns-off-org-adapt-indentation --8<---------------cut here---------------end--------------->8---

Perhaps this would be better as a separate function:

--8<---------------cut here---------------start------------->8---
(defun org-version-check (version feature level)
=A0(destructuring-bind (rmaj rmin rbld)
=A0 =A0 =A0(mapcar 'string-to-number (split-string version "[.]&q= uot;))
=A0 =A0(destructuring-bind (maj min bld)
=A0 =A0 =A0 =A0(mapcar 'string-to-number (split-string emacs-version &= quot;[.]"))
=A0 =A0 =A0(let ((msg (format "Emacs %s or greater is recommended for= %s" version
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 feature)))
=A0 =A0 =A0 =A0(when (< maj rmaj)
=A0 =A0 =A0 =A0 =A0(display-warning 'org msg level))
=A0 =A0 =A0 =A0(when (=3D maj rmaj)
=A0 =A0 =A0 =A0 =A0(unless (>=3D min rmin)
=A0 =A0 =A0 =A0 =A0 =A0(display-warning 'org msg level)))
=A0 =A0 =A0 =A0(when (and (=3D maj rmaj)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (=3D min rmin))
=A0 =A0 =A0 =A0 =A0(unless (>=3D bld rbld)
=A0 =A0 =A0 =A0 =A0 =A0(display-warning 'org msg level)))))))
--8<---------------cut here---------------end--------------->8---

It could then be called with:

(org-version-check "23.1.50" "org-indent" :warning)

I made it display a warning because org-indent seems to work almost
perfectly with the version of emacs I'm running (23.1.1).

I think that is a brilliant idea, especially as the repositorie= s from ubuntu do not yet include emacs 23.2.

Cheers,

Rainer

Regards,
Jason

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



--
NEW GERMAN = FAX NUMBER!!!

Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (= Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellen= ce for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch UniversityMain Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:= =A0 =A0 =A0 =A0 =A0 +27 - (0)83 9479 042
Fax: =A0 =A0 =A0 =A0 =A0 =A0+2= 7 - (0)86 516 2782
Fax: =A0 =A0 =A0 =A0 =A0 =A0+49 - (0)321 2125 2244
email: =A0 =A0 =A0 = =A0 =A0Rainer@krugs.de

Skype:= =A0 =A0 =A0 =A0 =A0RMkrug
Google: =A0 =A0 =A0 =A0 R.M.Krug@gmail.com

--00163646c256a9d798048aa9dbec-- --===============1720852123== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1720852123==--