From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: Emacs 22 compatibility Date: Wed, 19 Dec 2012 19:54:40 +0100 Message-ID: <87ehil3ma7.fsf@Rainer.invalid> References: <87licz2ejp.fsf@Rainer.invalid> <10228.1355612445@alphaville> <87ehiq62qe.fsf@gmail.com> <8738z3fgo8.fsf@bzg.ath.cx> <87hanji7an.fsf@Rainer.invalid> <87zk1b106i.fsf@yagnesh.org> <87txrjrlbt.fsf@bzg.ath.cx> <87licujt2s.fsf@Rainer.invalid> <87bodq9y60.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlOnO-0000Ul-Vn for emacs-orgmode@gnu.org; Wed, 19 Dec 2012 13:55:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlOnJ-0003EI-Sc for emacs-orgmode@gnu.org; Wed, 19 Dec 2012 13:55:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:47328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlOnJ-0003Bf-LG for emacs-orgmode@gnu.org; Wed, 19 Dec 2012 13:55:05 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TlOnV-0007VJ-6h for emacs-orgmode@gnu.org; Wed, 19 Dec 2012 19:55:17 +0100 Received: from pd9eb42a8.dip.t-dialin.net ([217.235.66.168]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Dec 2012 19:55:17 +0100 Received: from Stromeko by pd9eb42a8.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Dec 2012 19:55:17 +0100 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Bastien writes: > If you or anyone can fix those error, please have a go. Here is another one that may need further work. The byte-compiler of Emacs 22 does not seem to handle defaliased special forms correctly when expanding macros. This can be circumvented with a defmacro, but then the decision becomes compile-time rather than load time (one could make it run-time by quoteing more broadly). For the current uses this should be OK. Also, ODT export now compiles correctly, but still doesn't work in Emacs 22 since delete-directory doesn't have a second argument (recursive delete) in Emacs 22. This would need to be worked around or at least the error caught. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Backwards-compatibility-don-t-defalias-special-forms.patch >From e459dde441932d95d157648519fc2768262fd1e8 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 19 Dec 2012 19:35:19 +0100 Subject: [PATCH] Backwards compatibility: don't defalias special forms * lisp/org-compat.el (org-condition-case-unless-debug): Do not use defalias for special forms, the Emacs 22 byte-compiler does not recognize them correctly when compiling macros. Use a macro instead and rely on macro expansion. That however makes the decision at compile time, which should be acceptable in this case since it only affects debugging. --- lisp/org-compat.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 1f330b1..292a777 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -438,12 +438,13 @@ (defun org-pop-to-buffer-same-window ;; `condition-case-unless-debug' has been introduced in Emacs 24.1 ;; `condition-case-no-debug' has been introduced in Emacs 23.1 -(defalias 'org-condition-case-unless-debug +(defmacro org-condition-case-unless-debug (var bodyform &rest handlers) + (declare (debug condition-case) (indent 2)) (or (and (fboundp 'condition-case-unless-debug) - 'condition-case-unless-debug) + `(condition-case-unless-debug ,var ,bodyform ,@handlers)) (and (fboundp 'condition-case-no-debug) - 'condition-case-no-debug) - 'condition-case)) + `(condition-case-no-debug ,var ,bodyform ,@handlers)) + `(condition-case ,var ,bodyform ,@handlers))) ;;;###autoload (defmacro org-check-version () -- 1.8.0.1 --=-=-= Content-Type: text/plain With all fixes in, Emacs 24 can run the tests for an the Org compiled by Emacs 22 now with just one error remaining, on master this is: Test ob-exp/mixed-blocks-with-exports-both condition: (wrong-type-argument number-or-marker-p nil) FAILED 19/403 ob-exp/mixed-blocks-with-exports-both and this one on maint: Test test-org-src/blank-line-block condition: (error "No special environment to edit here") FAILED 346/378 test-org-src/blank-line-block One of the 13 errors when Emacs 22 runs the testsuite itself is due to an unconditional use of visual-line-mode, which Emacs 22 does not have. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada --=-=-=--