Skip to content

Commit

Permalink
Inhibit usage message
Browse files Browse the repository at this point in the history
  • Loading branch information
muffinmad committed Sep 23, 2020
1 parent 30fc896 commit b8ab8e3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ctrlxo.el
Expand Up @@ -37,6 +37,14 @@

;;; Code:

(defgroup ctrlxo nil
"Select most recently used window."
:group 'windows)

(defcustom ctrlxo-inhibit-usage-message nil
"Inhibit usage message on transient keymap activation."
:type 'boolean)

(defvar ctrlxo--window-list nil)
(defvar ctrlxo--selected-window nil)

Expand Down Expand Up @@ -96,9 +104,10 @@ Activate transient keymap to switch to the next recently used window."
(setq ctrlxo--selected-window (selected-window))
(ctrlxo--make-window-list)
(ctrlxo-forward)
(message
(substitute-command-keys
"Next window: \\<ctrlxo-map>\\[ctrlxo-forward], previous window: \\<ctrlxo-map>\\[ctrlxo-backward], cancel switch: \\<ctrlxo-map>\\[ctrlxo-cancel]."))
(unless ctrlxo-inhibit-usage-message
(message
(substitute-command-keys
"Next window: \\<ctrlxo-map>\\[ctrlxo-forward], previous window: \\<ctrlxo-map>\\[ctrlxo-backward], cancel switch: \\<ctrlxo-map>\\[ctrlxo-cancel].")))
(set-transient-map ctrlxo-map t #'ctrlxo--map-exit))


Expand Down

0 comments on commit b8ab8e3

Please sign in to comment.