Add what-major-mode & what-minor-modes debug defuns

This commit is contained in:
Henrik Lissner 2015-12-09 01:54:49 -05:00
parent 2503232edf
commit cdd0a7534b

View File

@ -23,6 +23,24 @@
(local-key-binding key)
(global-key-binding key)))
;;;###autoload
(defun what-major-mode ()
(interactive)
(message "Mode: %s" major-mode))
;;;###autoload
(defun what-minor-modes ()
(interactive)
(let ((buf (get-buffer-create "*minor-modes*")))
(with-current-buffer buf
(insert "Active minor modes:\n + ")
(insert (s-join "\n + " (-filter
(lambda (k) (and k (not (string= k ""))))
(mapcar (lambda (mm) (symbol-name (car mm)))
minor-mode-alist)))))
(popwin:pop-to-buffer buf)))
;;;###autoload (autoload 'narf:echo "defuns-debug" nil t)
(evil-define-command narf:echo (bang message)
"Display MSG in echo-area without logging it in *Messages* buffer."