Skip to content
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

Add helpers for auto enabling inf-clojure #162

Open
arichiardi opened this issue Mar 25, 2019 · 0 comments
Open

Add helpers for auto enabling inf-clojure #162

arichiardi opened this issue Mar 25, 2019 · 0 comments

Comments

@arichiardi
Copy link
Contributor

arichiardi commented Mar 25, 2019

Hi all,
I was wondering if these kind of helpers could be useful to include in inf-clojure:

(defcustom inf-clojure-auto-enable-extensions
  '("joke" "lumo")
  "List of extensions to use for auto enable of `inf-clojure-minor-mode."
  :type 'list
  :group 'clojure)

(defun inf-clojure--enable-for-known-extensions ()
  "Enable inf-clojure-minor-mode for some known extensions."
  (when (and (not (bound-and-true-p inf-clojure-minor-mode))
             (member (file-name-extension buffer-file-name) inf-clojure-auto-enable-extensions))
    (inf-clojure-minor-mode)))

(defun inf-clojure--disable-cider-for-known-extensions ()
  "Disable cider-mode for known extensions."
  (when (and (bound-and-true-p cider-mode)
             (member (file-name-extension buffer-file-name) inf-clojure-auto-enable-extensions))
    (cider-mode -1)))

They are kind of useful for me to switch between cider-mode adn inf-clojure-minor-mode depending on the extension.

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

No branches or pull requests

1 participant