1

After starting Emacs with the following init.el file, key-chord-mode is turned on.

;; Speed up startup
(setq gc-cons-threshold 402653184
      gc-cons-percentage 0.6)
(add-hook 'after-init-hook
          `(lambda ()
             (setq gc-cons-threshold 800000
                   gc-cons-percentage 0.1)
             (garbage-collect)) t)

;; Initialize package.el
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives
             '("org" . "https://orgmode.org/elpa/") t)
(package-initialize)

;; Bootstrap `use-package'
(setq-default use-package-always-ensure t ; Auto-download package if not exists
              use-package-always-defer t ; Always defer load package to speed up startup
              use-package-verbose nil ; Don't report loading details
              use-package-expand-minimally t  ; make the expanded code as minimal as possible
              use-package-enable-imenu-support t) ; Let imenu finds use-package definitions
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(eval-when-compile
  (require 'use-package))

(use-package use-package-chords
  :ensure t
  :defer nil
  :config (key-chord-mode 1))



;;; init.el ends here

But it's not listed when I do C-h m.

So I guess my question is: in order to determine whether a certain minor mode has been enabled after starting emacs, is there something else I need to do other than C-h m?

1 Answer 1

4

key-chord-mode seems to be an older piece of source code. It works without the define-minor-mode facilities.
Those things happen with the introduction of new features, and if the author does not change its code.

To check if key-chord-mode is active, check if variable key-chord-mode is set.

Have a look at the packages source code and search for key-chord-mode to get more info.


There is (imho) not much you could do to detect all such modes. You could search for all variables whose names ends with -mode and are set to true. But even then you might miss some, because it is no requirement to name variables for modes in that way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.