unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* elint cannot handle dolist any more?
@ 2012-07-14 14:48 Ulrich Mueller
  2012-07-15 22:39 ` Stefan Monnier
  2012-07-17 12:31 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Ulrich Mueller @ 2012-07-14 14:48 UTC (permalink / raw)
  To: emacs-devel

I've noticed that with the current trunk, elint-defun will fail for any
function that contains the "dolist" macro, with an error message:
"Wrong type argument: listp, 385"

The last form in the following minimal example:

   (load "cl-macs")
   (elint-initialize)
   (elint-get-args 'dolist nil)

had returned "(spec &rest body)" in Emacs 24.1, whereas it now returns
just "385".

Is this a bug or a feature?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: elint cannot handle dolist any more?
  2012-07-14 14:48 elint cannot handle dolist any more? Ulrich Mueller
@ 2012-07-15 22:39 ` Stefan Monnier
  2012-07-17 12:31 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2012-07-15 22:39 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: emacs-devel

> I've noticed that with the current trunk, elint-defun will fail for any
> function that contains the "dolist" macro, with an error message:
> "Wrong type argument: listp, 385"

> The last form in the following minimal example:

>    (load "cl-macs")
>    (elint-initialize)
>    (elint-get-args 'dolist nil)

> had returned "(spec &rest body)" in Emacs 24.1, whereas it now returns
> just "385".

> Is this a bug or a feature?

Thanks, it's a bug in elint which has not been adapted to the new
arglist format in Emacs-24's bytecode.


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: elint cannot handle dolist any more?
  2012-07-14 14:48 elint cannot handle dolist any more? Ulrich Mueller
  2012-07-15 22:39 ` Stefan Monnier
@ 2012-07-17 12:31 ` Stefan Monnier
  2012-07-17 18:10   ` Ulrich Mueller
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2012-07-17 12:31 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: emacs-devel

> I've noticed that with the current trunk, elint-defun will fail for any
> function that contains the "dolist" macro, with an error message:
> "Wrong type argument: listp, 385"

I installed the patch below which should fix the problem.
BTW, while you're here: could you tell me what elint is for?
AFAICT, the byte compiler already performs the same kind of checks, so
could you give me some idea of which differences make it worthwhile to
use elint?


        Stefan


=== modified file 'lisp/emacs-lisp/elint.el'
--- lisp/emacs-lisp/elint.el	2012-07-11 23:13:41 +0000
+++ lisp/emacs-lisp/elint.el	2012-07-17 12:26:43 +0000
@@ -713,14 +713,8 @@
 (defun elint-find-args-in-code (code)
   "Extract the arguments from CODE.
 CODE can be a lambda expression, a macro, or byte-compiled code."
-  (cond
-   ((byte-code-function-p code)
-    (aref code 0))
-   ((and (listp code) (eq (car code) 'lambda))
-    (car (cdr code)))
-   ((and (listp code) (eq (car code) 'macro))
-    (elint-find-args-in-code (cdr code)))
-   (t 'unknown)))
+  (let ((args (help-function-arglist code)))
+    (if (listp args) args 'unknown)))
 
 ;;;
 ;;; Functions to check some special forms




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: elint cannot handle dolist any more?
  2012-07-17 12:31 ` Stefan Monnier
@ 2012-07-17 18:10   ` Ulrich Mueller
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Mueller @ 2012-07-17 18:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

>>>>> On Tue, 17 Jul 2012, Stefan Monnier wrote:

> BTW, while you're here: could you tell me what elint is for?
> AFAICT, the byte compiler already performs the same kind of checks, so
> could you give me some idea of which differences make it worthwhile to
> use elint?

No idea, but some elisp packages use elint, e.g. "make test" for
muse-3.20 (from <http://download.gna.org/muse-el/>) will call it.

Ulrich



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-17 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-14 14:48 elint cannot handle dolist any more? Ulrich Mueller
2012-07-15 22:39 ` Stefan Monnier
2012-07-17 12:31 ` Stefan Monnier
2012-07-17 18:10   ` Ulrich Mueller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).