unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: How to avoid loading file when just testing if function
@ 2012-04-02 14:24 Buchs, Kevin
  2012-04-02 15:00 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Buchs, Kevin @ 2012-04-02 14:24 UTC (permalink / raw)
  To: help-gnu-emacs, wxhgmqzgwmuf

Sebastien,

For the purpose you specify, how about checking what org-mode checks to
determine if there is an active clock? In the end, it simply looks for
an org-clock-marker to exist, i.e. be non-nil. (if org-clock-marker
(...)). You may be interested in the general question for any situation,
how to test whether some autoloaded function has been loaded or not.

Kevin Buchs | Senior Engineer | SPPDG | 507-538-5459 |
buchs.kevin@mayo.edu
Mayo Clinic | 200 First Street SW | Rochester, MN 55905 |
http://www.mayo.edu/sppdg 


Date: Mon, 02 Apr 2012 11:54:15 +0200
From: "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com>
To: help-gnu-emacs@gnu.org
Subject: How to avoid loading file when just testing if function is
	bound?
Message-ID: <80limempbs.fsf@somewhere.org>
Content-Type: text/plain

Hi,

For the purpose of asking whether I eventually need to clock out (from
Org) before exiting Emacs, I've written this chunk of code:

--8<---------------cut here---------------start------------->8---
  (if (and (fboundp 'org-clocking-p)
           (org-clocking-p)
	   (y-or-n-p "You are currently clocking time, clock out? "))
      (org-clock-out)
    t))
--8<---------------cut here---------------end--------------->8---

The problem is that if Org is not yet loaded, the above code does load
it (because `org-clocking-p' is autoloaded) -- and that takes a while...
and I just wanted to exit Emacs...

How to avoid this?

Best regards,
  Seb

--
Sebastien Vauban



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

end of thread, other threads:[~2012-04-02 15:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 14:24 How to avoid loading file when just testing if function Buchs, Kevin
2012-04-02 15:00 ` Drew Adams

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