Search code examples
elisp

symbol's function definition is void: after-load'


Upon cloning the codes

emacs.d/init-org.el at 9bb862b3d5f95d66506693cf1ebc685bb79d1080 · purcell/emacs.d

to the personal configuration,

;;; Org clock

;; Save the running clock and all clock history when exiting Emacs, load it on startup
(after-load 'org
  (org-clock-persistence-insinuate))
(setq org-clock-persist t)
(setq org-clock-in-resume t)

;; Save clock data and notes in the LOGBOOK drawer
(setq org-clock-into-drawer t)
;; Save state changes in the LOGBOOK drawer
(setq org-log-into-drawer t)
;; Removes clocked tasks with 0:00 duration
(setq org-clock-out-remove-zero-time-clocks t)

;; Show clock sums as hours and minutes, not "n days" etc.
(setq org-time-clocksum-format
      '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t))

It prompt that `symbol's function definition is void: after-load'

Search keyword 'afterf-load`, it return with-eval-after-load Hooks for Loading - GNU Emacs Lisp Reference Manual

Does after-load is a personal defined funtion?


Solution

  • Indeed, this is not a symbol which is defined in the standard library. The repo you have cloned defines this as a portability alias for with-eval-after-load in init-utils but of course you have to load this definition before you can use it. Probably review the repo's installation and usage instructions.