File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -358,3 +358,18 @@ change the variable =meow-cursor-type-insert=.
358
358
359
359
Association list of symbols to their corresponding keymaps. Used
360
360
to generate =meow-*-define-key= helpers.
361
+
362
+ * Integration to other packages
363
+ ** :meow-state use-package keyword
364
+
365
+ Simple keyword ~:meow-state~ added to [[https://github.com/jwiegley/use-package][use-package]] declarations. Used to help
366
+ populate ~meow-mode-state-list~, as follows:
367
+
368
+ #+begin_src emacs-lisp
369
+ (use-package sly
370
+ :meow-state ((sly-inspector-mode . motion)
371
+ (sly-db-mode . motion)))
372
+ #+end_src
373
+
374
+ The above would make the ~sly-inspector~ and ~sly-db~ modes start in Meow's
375
+ ~motion~ state.
Original file line number Diff line number Diff line change @@ -266,6 +266,21 @@ Argument ENABLE non-nil means turn on."
266
266
; ; These vars allow us the select through the polymode chunk
267
267
(add-to-list 'polymode-move-these-vars-from-old-buffer v))))
268
268
269
+ ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
270
+ ; ; use-package
271
+
272
+ (when (fboundp #'use-package )
273
+ (add-to-list 'use-package-keywords ':meow-state 'append )
274
+ ; ; We re-use the normalize method from :hook. This way we get the parsing of
275
+ ; ; both a single cons, and a list of several.
276
+ (defalias 'use-package-normalize/:meow-state #'use-package-normalize/:hook )
277
+
278
+ (defun use-package-handler/:meow-state (name-symbol keyword args rest state )
279
+ (use-package-concat
280
+ (use-package-process-keywords name-symbol rest state)
281
+ `(,@(cl-loop for arg in args
282
+ collect `(add-to-list 'meow-mode-state-list ', arg ))))))
283
+
269
284
; ; Enable / Disable shims
270
285
271
286
(defun meow--enable-shims ()
You can’t perform that action at this time.
0 commit comments