unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Stephen Leake <stephen_leake@stephe-leake.org>, emacs-devel@gnu.org
Subject: Re: message-fetch-field vs require
Date: Thu, 24 Dec 2015 17:47:08 +0000	[thread overview]
Message-ID: <20151224174708.GB2397@acm.fritz.box> (raw)
In-Reply-To: <87ziwzsqri.fsf@gnus.org>

Hello, Lars.

On Thu, Dec 24, 2015 at 06:25:21PM +0100, Lars Ingebrigtsen wrote:
> Stephen Leake <stephen_leake@stephe-leake.org> writes:

> > I've got a function that uses message-fetch-field. The file has (require
> > 'message). But the byte compiler still complains:

> > bzr-gnus.el:155:1:Warning: the following functions might not be defined at
> >     runtime: message-fetch-field, mm-save-part-to-file

> > I've tried wrapping the require in "eval-and-compile"; no help.

> > Can anyone explain what's going on?

> No, sounds really odd to me.  `message-fetch-field' is a totally normal
> function, so if you require `message' (and your load path points to the
> version of message.el you're really using), then this shouldn't be
> happening...

There was a bug, now fixed in the emacs-25 branch: any function defined
within an `eval-when-compile' was put on the "might not be defined at
runtime" list; even when such a function was subsequently defined for
runtine, it stayed on that list, and its use in a function being
compiled caused the warning message to be output.

My guess is that Stephen's code had an `eval-when-compile' which,
directly or indirectly, `require'd 'message.

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2015-12-24 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 16:28 message-fetch-field vs require Stephen Leake
2015-12-24 17:25 ` Lars Ingebrigtsen
2015-12-24 17:47   ` Alan Mackenzie [this message]
2015-12-24 17:56     ` Lars Ingebrigtsen

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151224174708.GB2397@acm.fritz.box \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=stephen_leake@stephe-leake.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.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).