all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: emacs-devel@gnu.org
Subject: Re: [bojohan+mail@dd.chalmers.se: The `cl-functions' byte compiler warning doesn't work]
Date: Mon, 03 Mar 2008 11:08:00 +0100	[thread overview]
Message-ID: <yoij8x106ry7.fsf@remote2.student.chalmers.se> (raw)
In-Reply-To: yoijmyz4iue6.fsf@gamma02.me.chalmers.se


So, byte-compile-find-cl-functions still has a few problems:

1. It expects functions to be represented by plain symbols
rather than (defun . FOO) in load-history.

2. It modifies load-history as a side-effect.

3.  byte-compile-cl-functions contains useless `(require/t/provide
    ...)' entries.


This illustrates the problem:

    $ emacs -Q

    (require 'cl)

    (byte-compile (lambda () (subst nil nil nil)))
      => no warning

    (byte-compile (lambda () (subst-if nil nil nil)))
      => Warning: Function `subst-if' from cl package called at runtime

    ;; The (autoload . <CL-FUNCTION>) entries in `load-history' are
       gone.


How about this version:

(defun byte-compile-find-cl-functions ()
  (unless byte-compile-cl-functions
    (dolist (elt load-history)
      (when (and (stringp (car elt))
		 (string-match
		  "^cl\\>" (file-name-nondirectory (car elt))))
	(dolist (e (cdr elt))
	  (when (memq (car-safe e) '(autoload defun))
	    (push (cdr e) byte-compile-cl-functions)))))))

2008-03-03 Johan Bockgård <bojohan@gnu.org>

	* emacs-lisp/bytecomp.el (byte-compile-find-cl-functions):
	Simplify.  Collect `defun' and `autoload' entries.  Avoid
	side-effecting load-history.



And I see now that Martin's change wasn't checked in on the branch,
which means that the original problem in this thread exists there (the
compiler never warns about cl functions):


2007-06-10  Martin Rudalics  <rudalics@gmx.at>

        * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions):
        Match against file-name-nondirectory.


-- 
Johan Bockgård





      reply	other threads:[~2008-03-03 10:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-10 13:19 [bojohan+mail@dd.chalmers.se: The `cl-functions' byte compiler warning doesn't work] Richard Stallman
2007-06-10 16:17 ` martin rudalics
2007-06-13  0:13   ` Johan Bockgård
2008-03-03 10:08     ` Johan Bockgård [this message]

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=yoij8x106ry7.fsf@remote2.student.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=emacs-devel@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 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.