(eval-after-load "dired"
'(progn
(define-key dired-mode-map "c" 'dired-create-empty-file)
(define-key dired-mode-map "r" 'dired-do-compress-to)))
Why is the eval-after-load
necessary when this is an init file? From my understanding, it makes it only run when dired
is loaded, but isn't the init file also loaded once? I was getting "symbol's value as variable is void" warning for dired-mode-map
but it was working fine without.
Is this because the warning is emitted before dired
is loaded, but the symbol is resolved by the time emacs is started up?