From 42c56d42fccf751d435f869e3c0b2a8ed13e95e6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 25 Aug 2021 17:38:32 -0500 Subject: Change disabled command logic --- init.el | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/init.el b/init.el index ccb35ca..9cfa7a9 100644 --- a/init.el +++ b/init.el @@ -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 - " 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 -- cgit 1.4.1-21-gabe81