* Re: A weird warning and a test (eager macro expansion) error
2013-11-05 20:59 ` Bastien
@ 2013-11-12 21:50 ` Achim Gratz
2013-11-13 8:58 ` Bastien
0 siblings, 1 reply; 7+ messages in thread
From: Achim Gratz @ 2013-11-12 21:50 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
[resent]
Bastien writes:
> Thanks -- I remember we had this issue before. I'm just surprise I'm
> the first one to report it, I assume many people use a recent Emacs
> with macro expansion done this way.
This patch fixes the error, but it looks strange (indentation is still
unchanged for clarity). Not sure if this an Ert or Emacs error, though.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-testing-fix-eager-macro-expansion-failures-on-Emacs-.patch --]
[-- Type: text/x-patch, Size: 9764 bytes --]
From e123a7c180f5390a8658e0f352e05d85aca3627c Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Tue, 12 Nov 2013 22:01:41 +0100
Subject: [PATCH] testing: fix eager macro expansion failures on Emacs trunk
* testing/lisp/test-ob.el, testing/lisp/test-org-table.el: Quote
deftest body forms starting with a let clause.
This may actually constitute a bug in Emacs or Ert.
---
testing/lisp/test-ob.el | 36 ++++++++++++++++++------------------
testing/lisp/test-org-table.el | 16 ++++++++--------
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index e7f0645..ac409a4 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -41,7 +41,7 @@
" \t #+headers : blah1 blah2 blah3 \t\n\t\n blah4 blah5 blah6 \n"))))
(ert-deftest test-org-babel/src-block-regexp ()
- (let ((test-block
+ `(let ((test-block
(concat
"#+begin_src language -n-r-a-b -c :argument-1 yes :argument-2 no\n"
"echo this is a test\n"
@@ -103,7 +103,7 @@
org-babel-default-inline-header-args)))
(ert-deftest ob-test/org-babel-combine-header-arg-lists ()
- (let ((results (org-babel-combine-header-arg-lists
+ `(let ((results (org-babel-combine-header-arg-lists
'((foo . :any)
(bar)
(baz . ((foo bar) (baz)))
@@ -280,7 +280,7 @@
(should-not (org-babel-get-inline-src-block-matches)))))
(ert-deftest test-org-babel/inline-src_blk-default-results-replace-line-1 ()
- (let ((test-line "src_sh{echo 1}"))
+ `(let ((test-line "src_sh{echo 1}"))
;; src_ at bol line 1...
(org-test-with-temp-text
test-line
@@ -300,7 +300,7 @@
(concat test-line " =1= =1= =1=")
(buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
;; src_ follows space line 1...
- (let ((test-line " src_emacs-lisp{ 1 }"))
+ `(let ((test-line " src_emacs-lisp{ 1 }"))
(org-test-with-temp-text
test-line
(should-error (org-ctrl-c-ctrl-c))
@@ -317,7 +317,7 @@
(ert-deftest test-org-babel/inline-src_blk-default-results-replace-line-2 ()
;; src_ at bol line 2...
- (let ((test-line " src_emacs-lisp{ \"x\" }"))
+ `(let ((test-line " src_emacs-lisp{ \"x\" }"))
(org-test-with-temp-text
(concat "\n" test-line)
(should-error (org-ctrl-c-ctrl-c))
@@ -331,7 +331,7 @@
(buffer-substring-no-properties
(point-at-bol) (point-at-eol))))))
- (let ((test-line "Some text prior to block src_emacs-lisp{ \"y\" }"))
+ `(let ((test-line "Some text prior to block src_emacs-lisp{ \"y\" }"))
(org-test-with-temp-text
test-line
(goto-char (point-max))
@@ -348,7 +348,7 @@
(should-error (org-ctrl-c-ctrl-c)))))
(ert-deftest test-org-babel/inline-src_blk-manual-results-replace ()
- (let ((test-line " src_emacs-lisp[:results replace]{ \"x\" }"))
+ `(let ((test-line " src_emacs-lisp[:results replace]{ \"x\" }"))
(org-test-with-temp-text
(concat "\n" test-line)
(should-error (org-ctrl-c-ctrl-c))
@@ -362,7 +362,7 @@
(buffer-substring-no-properties
(point-at-bol) (point-at-eol))))))
- (let ((test-line (concat " Some text prior to block "
+ `(let ((test-line (concat " Some text prior to block "
"src_emacs-lisp[:results replace]{ \"y\" }")))
(org-test-with-temp-text test-line
(goto-char (point-max))
@@ -379,7 +379,7 @@
(should-error (org-ctrl-c-ctrl-c)))))
(ert-deftest test-org-babel/inline-src_blk-results-silent ()
- (let ((test-line "src_emacs-lisp[ :results silent ]{ \"x\" }"))
+ `(let ((test-line "src_emacs-lisp[ :results silent ]{ \"x\" }"))
(org-test-with-temp-text test-line
(org-ctrl-c-ctrl-c)
(should (string= test-line
@@ -387,7 +387,7 @@
(point-at-bol) (point-at-eol))))
(end-of-buffer)
(should-error (org-ctrl-c-ctrl-c))))
- (let ((test-line (concat " Some text prior to block src_emacs-lisp"
+ `(let ((test-line (concat " Some text prior to block src_emacs-lisp"
"[ :results silent ]{ \"y\" }")))
(org-test-with-temp-text
test-line
@@ -405,12 +405,12 @@
(should-error (org-ctrl-c-ctrl-c)))))
(ert-deftest test-org-babel/inline-src_blk-results-raw ()
- (let ((test-line "src_emacs-lisp[ :results raw ]{ \"x\" }"))
+ `(let ((test-line "src_emacs-lisp[ :results raw ]{ \"x\" }"))
(org-test-with-temp-text test-line
(org-ctrl-c-ctrl-c)
(should (string= (concat test-line " x")
(buffer-string)))))
- (let ((test-line (concat " Some text prior to block "
+ `(let ((test-line (concat " Some text prior to block "
"src_emacs-lisp[ :results raw ]{ \"the\" }")))
(org-test-with-temp-text (concat test-line " end")
(re-search-forward "src_") (org-ctrl-c-ctrl-c)
@@ -425,7 +425,7 @@
(should-error (org-ctrl-c-ctrl-c)))))
(ert-deftest test-org-babel/inline-src_blk-results-file ()
- (let ((test-line "src_emacs-lisp[ :results file ]{ \"~/test-file\" }"))
+ `(let ((test-line "src_emacs-lisp[ :results file ]{ \"~/test-file\" }"))
(org-test-with-temp-text
test-line
(org-ctrl-c-ctrl-c)
@@ -434,7 +434,7 @@
(point-min) (point-max)))))))
(ert-deftest test-org-babel/inline-src_blk-results-scalar ()
- (let ((test-line "src_emacs-lisp[ :results scalar ]{ \"x\" }"))
+ `(let ((test-line "src_emacs-lisp[ :results scalar ]{ \"x\" }"))
(org-test-with-temp-text
test-line
(org-ctrl-c-ctrl-c)
@@ -443,7 +443,7 @@
(point-min) (point-max)))))))
(ert-deftest test-org-babel/inline-src_blk-results-verbatim ()
- (let ((test-line "src_emacs-lisp[ :results verbatim ]{ \"x\" }"))
+ `(let ((test-line "src_emacs-lisp[ :results verbatim ]{ \"x\" }"))
(org-test-with-temp-text
test-line
(org-ctrl-c-ctrl-c)
@@ -628,7 +628,7 @@
(should (looking-at ": 2")))))
(ert-deftest test-ob/eval-header-argument ()
- (flet ((check-eval (eval runp)
+ `(flet ((check-eval (eval runp)
(org-test-with-temp-text (format "#+begin_src emacs-lisp :eval %s
(setq foo :evald)
#+end_src" eval)
@@ -828,7 +828,7 @@ (defun test-ob-verify-result-and-removed-result (result buffer-text)
* next heading"))
(ert-deftest test-org-babel/inline-src_blk-preceded-punct-preceded-by-point ()
- (let ((test-line ".src_emacs-lisp[ :results verbatim ]{ \"x\" }"))
+ `(let ((test-line ".src_emacs-lisp[ :results verbatim ]{ \"x\" }"))
(org-test-with-temp-text
test-line
(forward-char 1)
@@ -1183,7 +1183,7 @@ (defun test-ob-verify-result-and-removed-result (result buffer-text)
(ert-deftest test-ob/safe-header-args ()
"Detect safe and unsafe header args."
- (let ((safe-args '((:cache . "foo")
+ `(let ((safe-args '((:cache . "foo")
(:results . "output")
(:eval . "never")
(:eval . "query")))
diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el
index e78e56b..19cef8d 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -231,7 +231,7 @@ (defconst references/target-special "
"Basic: Assign field reference, sum of field references, sum
and len of simple range reference (no row) and complex range
reference (with row). Mode string E."
- (let ((lisp
+ `(let ((lisp
(concat
"#+TBLFM: $3 = '(identity $1); E :: $4 = '(+ $1 $2); E :: "
"$5 = '(+ $1..$2); E :: $6 = '(+ @0$1..@0$2); E :: "
@@ -274,7 +274,7 @@ (defconst references/target-special "
"Basic: Assign field reference, sum of field references, sum
and len of simple range reference (no row) and complex range
reference (with row). Mode string EN."
- (let ((lisp (concat
+ `(let ((lisp (concat
"#+TBLFM: $3 = '(identity $1); EN :: $4 = '(+ $1 $2); EN :: "
"$5 = '(+ $1..$2); EN :: $6 = '(+ @0$1..@0$2); EN :: "
"$7 = '(length '($1..$2)); EN :: "
@@ -324,7 +324,7 @@ (defconst references/target-special "
"Basic: Assign field reference, sum of field references, sum
and len of simple range reference (no row) and complex range
reference (with row). No mode string."
- (let ((lisp (concat
+ `(let ((lisp (concat
"#+TBLFM: $3 = '(identity $1) :: $4 = '(+ $1 $2) :: "
"$5 = '(+ $1..$2) :: $6 = '(+ @0$1..@0$2) :: "
"$7 = '(length '($1..$2)) :: $8 = '(length '(@0$1..@0$2))"))
@@ -365,7 +365,7 @@ (defconst references/target-special "
"Basic: Assign field reference, sum of field references, sum
and len of simple range reference (no row) and complex range
reference (with row). Mode string N."
- (let ((lisp
+ `(let ((lisp
(concat
"#+TBLFM: $3 = '(identity $1); N :: $4 = '(+ $1 $2); N :: "
"$5 = '(+ $1..$2); N :: $6 = '(+ @0$1..@0$2); N :: "
@@ -554,7 +554,7 @@ (defconst references/target-special "
(ert-deftest test-org-table/copy-field ()
"Experiments on how to copy one field into another field."
- (let ((target
+ `(let ((target
"
| 0 | replace |
| a b | replace |
@@ -940,7 +940,7 @@ (defconst references/target-special "
#+TBLFM: $2=$1*2
#+TBLFM: $2=$1*3
"
- (let ((got (progn (goto-char (point-min))
+ `(let ((got (progn (goto-char (point-min))
(forward-line 3)
(org-table-calc-current-TBLFM)
(buffer-string)))
@@ -954,7 +954,7 @@ (defconst references/target-special "
(should (string= got
expect)))
- (let ((got (progn (goto-char (point-min))
+ `(let ((got (progn (goto-char (point-min))
(forward-line 4)
(org-table-calc-current-TBLFM)
(buffer-string)))
@@ -978,7 +978,7 @@ (defconst references/target-special "
#+TBLFM: $2=$1*2::$2=$1*2
#+TBLFM: $2=$1*3
"
- (let ((expect "
+ `(let ((expect "
| 1 | 1 |
| 2 | 2 |
#+TBLFM: $2=$1*1
--
1.8.4.2
[-- Attachment #3: Type: text/plain, Size: 199 bytes --]
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
^ permalink raw reply related [flat|nested] 7+ messages in thread