Skip to content

clojure-test-maybe-enable issue #13

@edgargoncalves

Description

@edgargoncalves

Hi! Is it my impression, or the current definition of the clojure-test-maybe-enable has two setbacks?

  • First, it doesn't do anything related to the directory the file is in, unlike the docstring statement.
  • Second, the check it does will search for "clojure.test" on the file - isn't that somehow limitative (despite the fact that it won't be a good detection method, if the file contains that string in a comment somewhere else besides the namespace, e.g. ...)

I propose the following change, as it works for - what i believe to be - the right way to specify tests:

(defun clojure-test-maybe-enable ()
  "Enable clojure-test-mode if the current buffer contains a namespace 
   with a \"test.\" bit on it."
  (let ((ns (clojure-find-package))) ; defined in clojure-mode.el
    (when (search "test." ns)
  (clojure-test-mode t))))

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions