mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user