Skip to content

Commit

Permalink
meow-shims: add shim for ddskk (meow-prev)
Browse files Browse the repository at this point in the history
Adds a shim for ddskk so that meow-prev works.
meow-prev calls C-p which is overriden by ddskk.
Fixes #540. See this issue for details.
  • Loading branch information
eshrh committed Mar 20, 2024
1 parent 0d74ccf commit c693c48
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions meow-shims.el
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,27 @@ Argument ENABLE non-nil means turn on."
(advice-add 'quail-input-method :around 'meow--input-method-advice)
(advice-remove 'quail-input-method 'meow--input-method-advice)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ddskk

(defvar meow--ddskk-setup nil)
(defun meow--ddskk-skk-previous-candidate-advice (fnc &optional arg)

Check warning on line 309 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

Unused lexical argument ‘fnc’

Check warning on line 309 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

Unused lexical argument ‘fnc’

Check warning on line 309 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

Unused lexical argument `fnc'
(if (and (not (eq skk-henkan-mode 'active))

Check warning on line 310 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

reference to free variable ‘skk-henkan-mode’

Check warning on line 310 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

reference to free variable ‘skk-henkan-mode’

Check warning on line 310 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

reference to free variable ‘skk-henkan-mode’
(not (eq last-command 'skk-kakutei-henkan))
last-command-event
(eq last-command-event
(seq-first (car (where-is-internal
'meow-prev
meow-normal-state-keymap)))))

Check warning on line 316 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

‘previous-line’ is for interactive use only; use ‘forward-line’ with negative argument instead.

Check warning on line 316 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

‘previous-line’ is for interactive use only; use ‘forward-line’ with negative argument instead.

Check warning on line 316 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

‘previous-line’ is for interactive use only; use ‘forward-line’ with negative argument instead.
(previous-line)
(funcall func arg)))

Check warning on line 318 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

reference to free variable ‘func’

Check warning on line 318 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

reference to free variable ‘func’

Check warning on line 318 in meow-shims.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

reference to free variable ‘func’

(defun meow--setup-ddskk (enable)
(setq meow--ddskk-setup enable)
(if enable
(advice-add 'skk-previous-candidate :around
'meow--ddskk-skk-previous-candidate-advice)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; polymode

Expand Down Expand Up @@ -348,7 +369,8 @@ Argument ENABLE non-nil means turn on."
(eval-after-load "which-key" (lambda () (meow--setup-which-key t)))
(eval-after-load "undo-tree" (lambda () (meow--setup-undo-tree t)))
(eval-after-load "diff-hl" (lambda () (meow--setup-diff-hl t)))
(eval-after-load "quail" (lambda () (meow--setup-input-method t))))
(eval-after-load "quail" (lambda () (meow--setup-input-method t)))
(eval-after-load "skk" (lambda () (meow--setup-ddskk t))))

(defun meow--disable-shims ()
"Remove shim setups."
Expand All @@ -363,7 +385,8 @@ Argument ENABLE non-nil means turn on."
(when meow--cider-setup (meow--setup-cider nil))
(when meow--which-key-setup (meow--setup-which-key nil))
(when meow--diff-hl-setup (meow--setup-diff-hl nil))
(when meow--input-method-setup (meow--setup-input-method nil)))
(when meow--input-method-setup (meow--setup-input-method nil))
(when meow--ddskk-setup (meow--setup-ddskk nil)))

;;; meow-shims.el ends here
(provide 'meow-shims)

0 comments on commit c693c48

Please sign in to comment.