unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* message-fetch-field vs require
@ 2015-07-23 16:28 Stephen Leake
  2015-12-24 17:25 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Leake @ 2015-07-23 16:28 UTC (permalink / raw)
  To: emacs-devel

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?

-- 
-- Stephe



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

* Re: message-fetch-field vs require
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-24 17:25 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

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...

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



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

* Re: message-fetch-field vs require
  2015-12-24 17:25 ` Lars Ingebrigtsen
@ 2015-12-24 17:47   ` Alan Mackenzie
  2015-12-24 17:56     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Mackenzie @ 2015-12-24 17:47 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Stephen Leake, emacs-devel

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).



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

* Re: message-fetch-field vs require
  2015-12-24 17:47   ` Alan Mackenzie
@ 2015-12-24 17:56     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-24 17:56 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Stephen Leake, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> 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.

Ah, right.

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



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

end of thread, other threads:[~2015-12-24 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-12-24 17:56     ` Lars Ingebrigtsen

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).