benchmark-init-el icon indicating copy to clipboard operation
benchmark-init-el copied to clipboard

Extra parameter for define-obsolete-function-alias

Open Ergus opened this issue 3 years ago • 2 comments

Hi:

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

image

Ergus avatar Jan 05 '21 00:01 Ergus

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

VanLaser avatar Jan 23 '21 13:01 VanLaser

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

tshu-w avatar Jan 23 '21 13:01 tshu-w