Skip to content

Commit

Permalink
support symex implemented as a lithium mode
Browse files Browse the repository at this point in the history
  • Loading branch information
countvajhula committed Sep 3, 2024
1 parent 0e8e53e commit 35db7a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
3 changes: 1 addition & 2 deletions chimera.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ to be run by the mode provider."))
"visual"
"replace"
"operator"
"char"
"symex"))
"char"))

(defvar chimera-insertion-states
(list "insert" "emacs"))
Expand Down
29 changes: 10 additions & 19 deletions rigpa-symex-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,19 @@
(require 'symex)
(require 'chimera)

(defvar chimera-symex-mode-entry-hook nil
"Entry hook for rigpa symex mode.")

(defvar chimera-symex-mode-exit-hook nil
"Exit hook for rigpa symex mode.")

(defun rigpa--on-symex-mode-pre-entry ()
"Enable symex minor mode."
(symex-enable-editing-minor-mode))

(defun rigpa--on-symex-mode-exit ()
"Disable symex minor mode."
(symex-disable-editing-minor-mode))

(defvar chimera-symex-mode
(make-chimera-mode :name "symex"
:enter #'symex-mode-interface
:pre-entry-hook 'chimera-symex-mode-entry-hook
:post-exit-hook 'chimera-symex-mode-exit-hook
:entry-hook 'evil-symex-state-entry-hook
:exit-hook 'evil-symex-state-exit-hook))

:exit #'symex-editing-mode-exit
:pre-entry-hook 'symex-editing-mode-pre-entry-hook
:post-exit-hook 'symex-editing-mode-post-exit-hook
:entry-hook 'symex-editing-mode-post-entry-hook
:exit-hook 'symex-editing-mode-pre-exit-hook
:manage-hooks nil))

(defun rigpa--on-symex-mode-entry ()
"Actions to take upon entering symex mode."
(evil-symex-state))

(provide 'rigpa-symex-mode)
;;; rigpa-symex-mode.el ends here
3 changes: 1 addition & 2 deletions rigpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@
:post-entry #'rigpa--on-text-mode-entry
:post-exit #'rigpa--on-text-mode-post-exit)
(rigpa-register-mode chimera-symex-mode
:pre-entry #'rigpa--on-symex-mode-pre-entry
:pre-exit #'rigpa--on-symex-mode-exit))
:post-entry #'rigpa--on-symex-mode-entry))

(defun rigpa--create-editing-structures ()
"Create standard editing structures."
Expand Down

0 comments on commit 35db7a1

Please sign in to comment.