Change disabled command logic

This commit is contained in:
Case Duckworth 2021-08-25 17:38:32 -05:00
parent b777ba9f9e
commit 42c56d42fc
1 changed files with 25 additions and 5 deletions

30
init.el
View File

@ -199,6 +199,29 @@
(:straight trashed)
(:option trashed-action-confirmer #'y-or-n-p)))
(setup disabled
;; While this stuff is defined in novice.el, I'm using 'disabled' as the name
;; for easy finding.
;; Enable all disabled commands.
(mapatoms (lambda (symbol)
(when (get symbol 'disabled)
(put symbol 'disabled nil))))
;; Now, disable symbols as I wish.
(dolist (sym '(view-hello-file
suspend-frame
scroll-left
scroll-right))
(put sym 'disabled t))
;; And set the disabled function to something better than the default.
(setq disabled-command-function
(defun acdw/disabled-command-function (&optional cmd keys)
(unless cmd (setq cmd this-command))
(unless keys (setq keys (this-command-keys)))
(message "Command `%s' is disabled." cmd))))
(setup ediff
(:option ediff-window-setup-function 'ediff-setup-windows-plain
ediff-split-window-function 'split-window-horizontally))
@ -941,13 +964,10 @@ like a dumbass."
(:global "M-=" count-words
"C-w" kill-region-or-backward-word
"<help> h" nil ; HELLO takes a long time to load on Windows
"C-c c" capitalize-dwim
"C-c u" upcase-dwim
"C-c l" downcase-dwim)
(:global "C-c t" acdw/insert-iso-date
"C-z" nil))
"C-c l" downcase-dwim
"C-c t" acdw/insert-iso-date))
;;; Packages