From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Crash of emacs when using SHIFT-TAB Date: Tue, 6 Jul 2010 10:25:50 +0200 Message-ID: <4B66B7DB-9C3A-4431-BB0E-EF4878D54FB7@gmail.com> References: <20AAFFE1-F2E6-4EF4-B914-6BAF9D17AF3B@gmail.com> <87y6dpg73x.fsf@riotblast.dunsmor.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=40391 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW3Tb-000538-OK for emacs-orgmode@gnu.org; Tue, 06 Jul 2010 04:26:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OW3TZ-0006ft-W2 for emacs-orgmode@gnu.org; Tue, 06 Jul 2010 04:25:59 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:52609) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OW3TZ-0006fN-Pv for emacs-orgmode@gnu.org; Tue, 06 Jul 2010 04:25:57 -0400 Received: by fxm20 with SMTP id 20so488098fxm.0 for ; Tue, 06 Jul 2010 01:25:54 -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 Hi Jason, thanks for this, I have checked in a modified version of your proposed fix. - Carsten On 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). > > 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 - Carsten