diff options
-rw-r--r-- | init.el | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/init.el b/init.el index f5b9e25..163d628 100644 --- a/init.el +++ b/init.el | |||
@@ -210,15 +210,31 @@ | |||
210 | (dolist (sym '(view-hello-file | 210 | (dolist (sym '(view-hello-file |
211 | suspend-frame | 211 | suspend-frame |
212 | scroll-left | 212 | scroll-left |
213 | scroll-right)) | 213 | scroll-right |
214 | comment-set-column | ||
215 | set-fill-column)) | ||
214 | (put sym 'disabled t)) | 216 | (put sym 'disabled t)) |
215 | 217 | ||
216 | ;; And set the disabled function to something better than the default. | 218 | ;; And set the disabled function to something better than the default. |
219 | ;; Now, I can run any disabled command, but I have to use M-x to do it. | ||
217 | (setq disabled-command-function | 220 | (setq disabled-command-function |
218 | (defun acdw/disabled-command-function (&optional cmd keys) | 221 | (defun acdw/disabled-command-function (&optional cmd keys) |
219 | (unless cmd (setq cmd this-command)) | 222 | (let ((cmd (or cmd this-command)) |
220 | (unless keys (setq keys (this-command-keys))) | 223 | (keys (or keys (this-command-keys)))) |
221 | (message "Command `%s' is disabled." cmd)))) | 224 | ;; this logic stolen from original `disabled-command-function' |
225 | (if (or (eq (aref keys 0) (if (stringp keys) | ||
226 | (aref "\M-x" 0) | ||
227 | ?\M-x)) | ||
228 | (and (>= (length keys) 2) | ||
229 | (eq (aref keys 0) meta-prefix-char) | ||
230 | (eq (aref keys 1) ?x))) | ||
231 | ;; it's been run as an M-x command, we want to do it | ||
232 | (call-interactively cmd) | ||
233 | ;; else, tell the user it's disabled. | ||
234 | (message (substitute-command-keys | ||
235 | (concat "Command `%s' has been disabled. " | ||
236 | "Run with \\[execute-extended-command].")) | ||
237 | cmd)))))) | ||
222 | 238 | ||
223 | (setup ediff | 239 | (setup ediff |
224 | (:option ediff-window-setup-function 'ediff-setup-windows-plain | 240 | (:option ediff-window-setup-function 'ediff-setup-windows-plain |