From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: master 1559cc4: Fix missing file&line info in "Unknown defun property" warnings
Date: Sat, 23 Jan 2021 22:20:00 +0000 [thread overview]
Message-ID: <87y2gjz46n.fsf@tcd.ie> (raw)
In-Reply-To: <20210123210447.45FA120AD1@vcs0.savannah.gnu.org> (Stefan Monnier's message of "Sat, 23 Jan 2021 16:04:46 -0500 (EST)")
[-- Attachment #1: Type: text/plain, Size: 1636 bytes --]
monnier@iro.umontreal.ca (Stefan Monnier) writes:
> branch: master
> commit 1559cc445a306b61b2a47c710e049ea26fe5265d
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Commit: Stefan Monnier <monnier@iro.umontreal.ca>
>
> Fix missing file&line info in "Unknown defun property" warnings
>
> * lisp/emacs-lisp/byte-run.el (defmacro, defun): Use
> `macroexp--warn-and-return` rather than `message`.
>
> * lisp/emacs-lisp/macroexp.el: Fix `macroexp--compiling-p`.
> (macroexp--warn-and-return): Don't try and detect repetition on forms
> like `nil`.
> (macroexp-macroexpand): Don't forget to bind `macroexpand-all-environment`.
This gave rise to the following 'make check' failures:
--8<---------------cut here---------------start------------->8---
Test cl-lib-defstruct-record passed unexpectedly
Ran 47 tests, 46 results as expected, 1 unexpected (2021-01-23 22:05:59+0000, 0.052134 sec)
1 expected failures
1 unexpected results:
PASSED cl-lib-defstruct-record
lisp/emacs-lisp/seq-tests.el:416:41: Error: ‘add-to-list’ can’t use lexical
var ‘elts’; use ‘push’ or ‘cl-pushnew’
In toplevel form:
lisp/autorevert-tests.el:642:24: Error: ‘add-to-list’ can’t use lexical var
‘buffers’; use ‘push’ or ‘cl-pushnew’
lisp/autorevert-tests.el:657:15: Error: ‘add-to-list’ can’t use lexical var
‘buffers’; use ‘push’ or ‘cl-pushnew’
--8<---------------cut here---------------end--------------->8---
Are the attached changes TRT, or is there something subtle going on?
Thanks,
--
Basil
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: check.diff --]
[-- Type: text/x-diff, Size: 4382 bytes --]
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index 683e3ea30d..19d9f7b13f 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -609,11 +609,12 @@ auto-revert-test07-auto-revert-several-buffers
(should auto-revert-mode))
(dotimes (i num-buffers)
- (add-to-list
- 'buffers
- (make-indirect-buffer
- (car buffers) (format "%s-%d" (buffer-file-name (car buffers)) i) 'clone)
- 'append))
+ (let ((buf (make-indirect-buffer
+ (car buffers)
+ (format "%s-%d" (buffer-file-name (car buffers)) i)
+ 'clone)))
+ (unless (memq buf buffers)
+ (setq buffers (nconc buffers (list buf))))))
(dolist (buf buffers)
(with-current-buffer buf
(should (string-equal (buffer-string) "any text"))
@@ -640,10 +641,10 @@ auto-revert-test07-auto-revert-several-buffers
(auto-revert-tests--write-file "any text" tmpfile (pop times))
(dotimes (i num-buffers)
- (add-to-list
- 'buffers
- (generate-new-buffer (format "%s-%d" (file-name-nondirectory tmpfile) i))
- 'append))
+ (let ((buf (generate-new-buffer
+ (format "%s-%d" (file-name-nondirectory tmpfile) i))))
+ (unless (memq buf buffers)
+ (setq buffers (nconc buffers (list buf))))))
(dolist (buf buffers)
(with-current-buffer buf
(insert-file-contents tmpfile 'visit)
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el
index 97a44c43ef..888af1b80a 100644
--- a/test/lisp/emacs-lisp/cl-lib-tests.el
+++ b/test/lisp/emacs-lisp/cl-lib-tests.el
@@ -548,10 +548,10 @@ cl-lib-tests--dummy-function
t)
(ert-deftest cl-lib-defstruct-record ()
- ;; This test fails when compiled, see Bug#24402/27718.
- :expected-result (if (byte-code-function-p
- (symbol-function 'cl-lib-tests--dummy-function))
- :failed :passed)
+ ;; This test used to fail when compiled, see Bug#24402/27718.
+ ;; :expected-result (if (byte-code-function-p
+ ;; (symbol-function 'cl-lib-tests--dummy-function))
+ ;; :failed :passed)
(cl-defstruct foo x)
(let ((x (make-foo :x 42)))
(should (recordp x))
@@ -566,6 +566,7 @@ old-struct
(should (eq (type-of x) 'vector))
(cl-old-struct-compat-mode 1)
+ (defvar cl-struct-foo)
(let ((cl-struct-foo (cl--struct-get-class 'foo)))
(setf (symbol-function 'cl-struct-foo) :quick-object-witness-check)
(should (eq (type-of x) 'foo))
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el
index 670398354a..f1dfc24b3f 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -108,16 +108,12 @@ test-seq-map-indexed
'((a 0) (b 1) (c 2) (d 3)))))
(ert-deftest test-seq-do-indexed ()
- (let ((result nil))
- (seq-do-indexed (lambda (elt i)
- (add-to-list 'result (list elt i)))
- nil)
- (should (equal result nil)))
+ (let (result)
+ (seq-do-indexed (lambda (elt i) (push (list elt i) result)) ())
+ (should-not result))
(with-test-sequences (seq '(4 5 6))
- (let ((result nil))
- (seq-do-indexed (lambda (elt i)
- (add-to-list 'result (list elt i)))
- seq)
+ (let (result)
+ (seq-do-indexed (lambda (elt i) (push (list elt i) result)) seq)
(should (equal (seq-elt result 0) '(6 2)))
(should (equal (seq-elt result 1) '(5 1)))
(should (equal (seq-elt result 2) '(4 0))))))
@@ -410,12 +406,11 @@ test-seq-sort-by
(ert-deftest test-seq-random-elt-take-all ()
(let ((seq '(a b c d e))
- (elts '()))
- (should (= 0 (length elts)))
+ elts)
(dotimes (_ 1000)
(let ((random-elt (seq-random-elt seq)))
- (add-to-list 'elts
- random-elt)))
+ (or (memq random-elt elts)
+ (push random-elt elts))))
(should (= 5 (length elts)))))
(ert-deftest test-seq-random-elt-signal-on-empty ()
next parent reply other threads:[~2021-01-23 22:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210123210445.12536.65283@vcs0.savannah.gnu.org>
[not found] ` <20210123210447.45FA120AD1@vcs0.savannah.gnu.org>
2021-01-23 22:20 ` Basil L. Contovounesios [this message]
2021-01-23 22:46 ` master 1559cc4: Fix missing file&line info in "Unknown defun property" warnings Stefan Monnier
2021-01-23 23:42 ` Basil L. Contovounesios
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y2gjz46n.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.