dholm / benchmark-init-el

Benchmark your Emacs initialization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extra parameter for define-obsolete-function-alias

Ergus opened this issue · comments

Hi:

Recent changes in define-obsolete-function-alias requires an extra parameter to indicate the obsoletion time.

image

Indeed, for now I use this incantation, but it's inelegant so hopefully temporary
(there's a pull already, since it's a simple change hopefully it gets merged soon):

(cl-letf (((symbol-function 'define-obsolete-function-alias) #'defalias))
  (use-package benchmark-init
    :config
    (require 'benchmark-init-modes)                                     ; explicitly required
    (add-hook 'after-init-hook #'benchmark-init/deactivate)))

Or try this advice from @yangsheng6810

(define-advice define-obsolete-function-alias (:filter-args (ll) fix-obsolete)
  (let ((obsolete-name (pop ll))
        (current-name (pop ll))
        (when (if ll (pop ll) "1"))
        (docstring (if ll (pop ll) nil)))
    (list obsolete-name current-name when docstring)))

I believe this is fixed by #16, which was merged a while ago.