fix(ui): use advice to yes-or-no-p to y-or-n-p

This feels cleaner and less hacky, and most importantly works correctly
with native-comp.
This commit is contained in:
2020-10-09 13:41:49 +01:00
parent 316a8d9fd7
commit f987f01f9a

View File

@@ -38,8 +38,12 @@
(column-number-mode t)
(size-indication-mode t)
;; enable y/n answers
(fset 'yes-or-no-p 'y-or-n-p)
;; enable y/n answers in a non-destructive and native-comp friendly manner
(defun yes-or-no-p-advice (_orig-fun &rest args)
"Advice to use `y-or-n-p' instead of `yes-or-no-p', passing along ARGS."
(apply 'y-or-n-p args))
(advice-add 'yes-or-no-p :around 'yes-or-no-p-advice)
;; more useful frame title, that show either a file or a
;; buffer name (if the buffer isn't visiting a file)