all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* eval-when-load?
@ 2015-07-16 16:33 Stephen Leake
  2015-07-16 18:13 ` eval-when-load? Artur Malabarba
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stephen Leake @ 2015-07-16 16:33 UTC (permalink / raw)
  To: emacs-devel

A project I'm working on has a form like this at top level in a file:

(defvar jde-jdhelper-singleton (jde-jdhelper nil)
  "The JDHelper singleton instance.")

`jde-jdhelper' can throw an error, which it does during byte-compile (it
complains about not finding "wget").

We want the variable defined at load time, and we want the error at load
time, but we don't care at compile time.

So I'd like to do:

(eval-when-load
 (defvar jde-jdhelper-singleton (jde-jdhelper nil)
   "The JDHelper singleton instance."))

but `eval-when-load' is not defined.

Is there a work-around?

We could change the var to a function that checks if the initialization
is done, but that seems a heavy solution. 

-- 
-- Stephe



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

end of thread, other threads:[~2015-08-06 22:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16 16:33 eval-when-load? Stephen Leake
2015-07-16 18:13 ` eval-when-load? Artur Malabarba
2015-07-16 22:04   ` eval-when-load? Stephen Leake
2015-07-16 22:13 ` eval-when-load? Philipp Stephani
2015-07-16 23:03 ` eval-when-load? Stefan Monnier
2015-07-17 10:07   ` eval-when-load? Stephen Leake
2015-08-06 22:50     ` eval-when-load? Stefan Monnier

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.