From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: Emacs 22 compatibility
Date: Wed, 19 Dec 2012 19:54:40 +0100 [thread overview]
Message-ID: <87ehil3ma7.fsf@Rainer.invalid> (raw)
In-Reply-To: 87bodq9y60.fsf@bzg.ath.cx
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Backwards-compatibility-don-t-defalias-special-forms.patch --]
[-- Type: text/x-patch, Size: 1589 bytes --]
From e459dde441932d95d157648519fc2768262fd1e8 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
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
[-- Attachment #3: Type: text/plain, Size: 813 bytes --]
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
next prev parent reply other threads:[~2012-12-19 18:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-15 21:25 Emacs 22 compatibility Achim Gratz
2012-12-15 23:00 ` Nick Dokos
2012-12-16 4:27 ` Jambunathan K
2012-12-16 7:18 ` Achim Gratz
2012-12-18 15:22 ` Bastien
2012-12-18 17:44 ` Achim Gratz
2012-12-18 22:10 ` Yagnesh Raghava Yakkala
2012-12-18 23:29 ` Bastien
2012-12-19 6:46 ` Yagnesh Raghava Yakkala
2012-12-19 9:42 ` Bastien
2012-12-19 9:21 ` Achim Gratz
2012-12-19 9:41 ` Bastien
2012-12-19 10:18 ` Achim Gratz
2012-12-24 12:53 ` Bastien
2012-12-19 18:54 ` Achim Gratz [this message]
2012-12-19 19:13 ` Jambunathan K
2012-12-19 19:20 ` Achim Gratz
2012-12-24 12:52 ` Bastien
2012-12-19 19:13 ` Achim Gratz
2012-12-24 13:03 ` Bastien
2012-12-19 19:02 ` Achim Gratz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ehil3ma7.fsf@Rainer.invalid \
--to=stromeko@nexgo.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).