Skip to content

Add clojurescript-mode and clojurec-mode to paxedit-assoc#10

Open
codeasone wants to merge 1 commit intopromethial:masterfrom
codeasone:master
Open

Add clojurescript-mode and clojurec-mode to paxedit-assoc#10
codeasone wants to merge 1 commit intopromethial:masterfrom
codeasone:master

Conversation

@codeasone
Copy link

To save Clojure-ecosystem developers some head scratching OOTB

To save Clojure-ecosystem developers some head scratching OOTB
@hkjels
Copy link

hkjels commented Apr 9, 2021

Yeah, this thing bit me. I was in Clojurescript context and just thought the package didn't work, but investigated further ones I saw it worked with Emacs lisp. Many would probably just give up, so I think your patch should be merged.
My solution:

(use-package paxedit
  :commands (paxedit-mode)
  :hook (paredit-mode . paxedit-mode)
  :bind (:map paxedit-mode-map
              ("M-<right>" . paxedit-transpose-forward)
              ("M-<left>" . paxedit-transpose-backward))
  :config
  (let ((paxedit-implicit-clojure '(paxedit-implicit-functions-clojure
                                    paxedit-implicit-structures-clojure)))
    (add-to-list 'paxedit-assoc `(clojurescript-mode . ,paxedit-implicit-clojure))
    (add-to-list 'paxedit-assoc `(clojurec-mode . ,paxedit-implicit-clojure))))

@yuhan0
Copy link

yuhan0 commented Apr 11, 2021

I think a better solution would be to use derived-mode-p since both inherit from the parent clojure-mode.

 (defun paxedit--associate-major-mode-to-implicit-sexp ()
   "Associate major mode with certain implicit functions and structures."
-  (paxedit-awhen (cl-rest (assq major-mode paxedit-assoc))
+  (paxedit-awhen (cl-rest (cl-assoc-if 'derived-mode-p paxedit-assoc))

@promethial Is this package still being maintained or accepting PRs?

@hkjels
Copy link

hkjels commented May 20, 2021

I've been using @yuhan0 fix for a while and it works flawlessly. hkjels@a7e5c9f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments