-
-
Notifications
You must be signed in to change notification settings - Fork 243
rewrite keymap system, introduce transient-like functionality #2100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mahmoodsh36
wants to merge
61
commits into
lem-project:main
Choose a base branch
from
mahmoodsh36:transient
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
06ca1cc
rewrite keymap system
mahmoodsh36 3793971
introduce keymap-activate and initialize transient.lisp
mahmoodsh36 c588bed
add simple popup
mahmoodsh36 c27b19c
make popup more informative
mahmoodsh36 78f4796
improve docstrings a little more
mahmoodsh36 155b527
slight refactor
mahmoodsh36 bdba683
make multi-choice prefix work
mahmoodsh36 ad9ce93
fix order of keymaps (hence fix priorities)
mahmoodsh36 43112dc
slight change
mahmoodsh36 ce57101
add find-prefix-by-id
mahmoodsh36 aad05cb
introduce :back, :cancel suffix values
mahmoodsh36 d42842a
rename package to lem/transient
mahmoodsh36 df5d8e4
rename package to lem/transient
mahmoodsh36 aa42f22
rename package to lem/transient and system to lem-transient
mahmoodsh36 ca27e2e
use "intern" with explicit package name
mahmoodsh36 9fe484f
introduce prefix-behavior, with-last-read-key-sequence, and handle ex…
mahmoodsh36 3d5d820
use :description instead of :name for keymaps
mahmoodsh36 674b205
introduce toggle infix, use prompt for multi-choice infix
mahmoodsh36 572be06
fix vim search
mahmoodsh36 60149a5
fix undefine-key (actually undefine-key-internal)
mahmoodsh36 f1c9db1
remvoe some redundant stuff
mahmoodsh36 6e39a90
properly parse keymap keywords in transient, change title styling
mahmoodsh36 ec7418e
small fix
mahmoodsh36 b671ff0
introduce "intermediate" prefixes
mahmoodsh36 12a4deb
introduce *transient-always-show*
mahmoodsh36 d5e0bfa
small refactor
mahmoodsh36 53793d9
introduce multi-value infix to demo
mahmoodsh36 25743b1
remove outdated comment
mahmoodsh36 a71be67
introduce variable-syncing (sync infix with var)
mahmoodsh36 971acca
add :extend keyword to make-keymap
mahmoodsh36 67ce381
add mode-transient-keymap, show extended keymap keys in transient
mahmoodsh36 bf24f9d
rename keymap-extend to keymap-base
mahmoodsh36 464ed61
export more symbols
mahmoodsh36 281dbbb
remove redundant keymap-find-keybind arg and rename it to keymap-find
mahmoodsh36 3c49131
remove "dynamic properties" and just rely on CLOS
mahmoodsh36 7172a02
small fixes
mahmoodsh36 c26b35e
make parse-transient eval values, so that quotes are needed
mahmoodsh36 69f7c4a
add bottomside-window and define transient-mode
mahmoodsh36 89c200b
add scrolling support
mahmoodsh36 81ae5da
fix horizontal scrolling
mahmoodsh36 729f2fe
set always-show to nil
mahmoodsh36 3585141
remove "dirty" redrawing technique
mahmoodsh36 794f923
separate child keymaps from prefixes
mahmoodsh36 9893fc8
handle editor-abort in suffix prompts
mahmoodsh36 61b20ec
add define-transient-key
mahmoodsh36 d0bdf76
indentation
mahmoodsh36 ce61951
add define-prefix, add post-command hook to update popup
mahmoodsh36 c316add
fix issue: self-insert was being invoked when it shouldnt have been
mahmoodsh36 f3d6401
show maps that have show-p set, regardless of mode
mahmoodsh36 06bdc4a
use defvar instead of defparameter to avoid issues on recomp
mahmoodsh36 dce4e71
fix handling of undef-hook
mahmoodsh36 95d0dae
set popup max-lines to 10 instead of 15 by default
mahmoodsh36 b595931
fix undef-hook/function-table edge case
mahmoodsh36 5eb74c7
fix popup behavior when switching buffers
mahmoodsh36 a237414
remove outdated comment
mahmoodsh36 7abc872
fix outdated argument name (:name to :description)
mahmoodsh36 9123268
rename define-transient-key, add macro for it.
mahmoodsh36 2f73fb3
add some documentation/examples
mahmoodsh36 a2cb07e
small change in docs, small fix
mahmoodsh36 797f6fa
reduce single-char namings of bindings/functions
mahmoodsh36 6526f3c
some docstrings
mahmoodsh36 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| (in-package :lem/transient) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Contractor: defpackage_rule Contract: contract AI check failed: "defpackage_rule" Reason: |
||
|
|
||
| (defvar *demo-language* | ||
| "lisp" | ||
| "a demo variable that stays in sync with an infix.") | ||
|
|
||
| (define-transient *demo-keymap* | ||
| :display-style :row | ||
| (:keymap | ||
| :display-style :column | ||
| :description "file operations" | ||
| (:key "o" :suffix 'demo-open :description "demo open") | ||
| (:key "s" :suffix 'demo-save :description "demo save (disabled)" :active-p nil) | ||
| (:key "w" :suffix 'demo-write :description "demo write") | ||
| (:key "x" | ||
| :suffix (:keymap | ||
| (:key "p" :suffix 'demo-pdf :description "pdf") | ||
| (:key "h" :suffix 'demo-html :description "html") | ||
| (:key "m" :suffix 'demo-md :description "markdown") | ||
| (:key "b" :behavior :back :description "back")) | ||
| :description "export format")) | ||
| (:keymap | ||
| :display-style :column | ||
| :description "edit operations" | ||
| (:key "c" :suffix 'demo-copy) | ||
| (:key "v" :suffix 'demo-paste) | ||
| (:key "u" :suffix 'demo-undo) | ||
| (:key "q" :behavior :cancel :description "quit")) | ||
| (:key "f" | ||
| :suffix (:keymap | ||
| (:key "g" :suffix 'demo-grep :description "grep") | ||
| (:key "f" :suffix 'demo-find :description "find") | ||
| (:key "r" :suffix 'demo-replace :description "replace")) | ||
| :description "search menu") | ||
| (:key "t" | ||
| :suffix (:keymap | ||
| :display-style :row | ||
| (:keymap | ||
| :description "languages" | ||
| (:key "l" | ||
| :type :choice | ||
| :id :mode | ||
| :choices-func (progn | ||
| ;; something meaningless | ||
| (+ 1 1) | ||
| ;; then return value | ||
| (list "lisp" "python" "js")) | ||
| :value "python" | ||
| :description "mode")) | ||
| (:keymap | ||
| :description "editor" | ||
| (:key "v" | ||
| :type :choice | ||
| :choices '("vim" "emacs") | ||
| :description "keys"))) | ||
| :description "langs demo") | ||
| (:key "a" | ||
| :type :choice | ||
| :choices '("value1" "value2" "value3") | ||
| :description "multi-value infix") | ||
| (:key "s" | ||
| :type :choice | ||
| :id :synced-infix | ||
| :choices '("lisp" "python" "js") | ||
| :variable '*demo-language* | ||
| :description "variable-synced infix") | ||
| (:key "R" :suffix 'demo-run :description "run with mode") | ||
| (:key "T" :type 'toggle :value t :suffix 'demo-toggle :description "demo toggle") | ||
| (:key "e e" :type 'toggle :value t :suffix 'demo-toggle :description "another demo toggle") | ||
| (:key "e a" :type 'toggle :value t :suffix 'demo-toggle :description "and another demo toggle")) | ||
|
|
||
| (define-command demo-run () () | ||
| (let ((mode-prefix (find-prefix-by-id *demo-keymap* :mode))) | ||
| (message "mode thing value: ~A" (prefix-value mode-prefix)) | ||
| (message "synced var value: ~A" *demo-language*))) | ||
|
|
||
| (define-key *global-keymap* "C-c t" *demo-keymap*) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor: internal_symbol_rule
Contract: contract
AI check failed: "internal_symbol_rule"
Reason:
Added code contains direct references to internal (non-exported) symbols via package double-colon qualifiers (e.g.
lem-core::other-keymaps), which violates the rule to use exported symbols fromlemorlem-coreand avoid internal symbol access.