Skip to content

Commit

Permalink
bqn-mode.el assimilates bqn-keymap-mode.el
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonTorres committed Sep 10, 2024
1 parent 2471b5e commit 7107e14
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 61 deletions.
61 changes: 0 additions & 61 deletions bqn-keymap-mode.el

This file was deleted.

42 changes: 42 additions & 0 deletions bqn-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,48 @@ bqn-comint-process-session and echoes the result."
(setq-local comint-prompt-read-only t)
(buffer-face-set 'bqn-default))

(defvar bqn-keymap-mode-reference
"\
┌────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬─────────┐
│~ ¬ │! ⎉ │@ ⚇ │# ⍟ │$ ◶ │% ⊘ │^ ⎊ │& │* │( ⟨ │) ⟩ │_ √ │+ ⋆ │Backspace│
│` ˜ │1 ˘ │2 ¨ │3 ⁼ │4 ⌜ │5 ´ │6 ˝ │7 │8 ∞ │9 ¯ │0 • │- ÷ │= × │ │
├────┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬──────┤
│Tab │Q │W 𝕎 │E ⍷ │R 𝕣 │T ⍋ │Y │U │I ⊑ │O ⊒ │P │{ ⊣ │} ⊢ │| │
│ │q ⌽ │w 𝕨 │e ∊ │r ↑ │t ∧ │y │u ⊔ │i ⊏ │o ⊐ │p π │[ ← │] │\\
├───────┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴──────┤
│Caps │A │S 𝕊 │D │F 𝔽 │G 𝔾 │H « │J │K ⌾ │L » │: · │\" ˙ │Enter │
│Lock │a ⍉ │s 𝕤 │d ↕ │f 𝕗 │g 𝕘 │h ⊸ │j ∘ │k ○ │l ⟜ │; ⋄ │' ↩ │ │
├────────┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──────────┤
│Shift │Z ⋈ │X 𝕏 │C │V ⍒ │B ⌈ │N │M ≢ │< ≤ │> ≥ │? ⇐ │Shift │
│ │z ⥊ │x 𝕩 │c ↓ │v ∨ │b ⌊ │n │m ≡ │, ∾ │. ≍ │/ ≠ │ │
└───────────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────────────┘
Space: ‿"
"Keyboard map for BQN.")

(defvar bqn-keymap-mode-*buffer-name* "*BQN keymap*"
"Name of the BQN keymap buffer.")

(defun bqn-keymap-mode-show-keyboard ()
"Display the keyboard help."
(interactive)
(let ((keyboard-help (get-buffer bqn-keymap-mode-*buffer-name*)))
(unless (and keyboard-help (get-buffer-window keyboard-help))
;; The buffer is not displayed.
(let* ((buffer (get-buffer-create bqn-keymap-mode-*buffer-name*))
(window (split-window nil)))
(with-current-buffer buffer
(insert bqn-keymap-mode-reference)
(goto-char (point-min))
(bqn-keymap-mode))
(set-window-buffer window buffer)
(fit-window-to-buffer window)))))

(define-derived-mode bqn-keymap-mode special-mode "BQN-Keymap"
"Major mode for displaying the keymap help."
(buffer-face-set 'bqn-default)
(read-only-mode 1)
(setq truncate-lines t))

(provide 'bqn-mode)

;;; bqn-mode.el ends here

0 comments on commit 7107e14

Please sign in to comment.