sqrtminusone's Blog

sqrtminusone's Avatar Image
Graduate student of Saint-Petersburg State Electrotechnical University.

If I'm not doing something with #Emacs, I'm probably doing something in #Emacs.

Live every day as if it were April 1st.
← All posts

How do I silence the byte-compiler here? With this code:

(eval-when-compile
(require ‘org-agenda))

;;;###autoload
(defun very-dumb-package-feature-1 ()
(interactive)
(require ‘org-agenda)
(org-agenda-show)
(message “1”))

It says:

very-dumb-package.el:10:4: Warning: the function ‘org-agenda-show’ might not

be defined at runtime.

Just (require ‘org-agenda) fixes this, but it also loads `org-agenda’ whenever the package is loaded, which I want to avoid.

(declare-function org-agenda-show “org-agenda”) also fixes that, but I don’t see why `eval-when-compile’ isn’t enough. It’s cumbersome to declare all the required functions if there are several.

#emacs #elisp

To like or reply, open original post on Emacs.ch