Fork me on GitHub
#emacs
<
2021-02-16
>
aaelony16:02:09

somehow I rediscovered hs-minor-mode recently and am enjoying code-folding in emacs greatly. It works amazingly well in Clojure, Python, R and probably other languages I have yet to try 🙂

yes 15
Mikko Koski12:02:44

Thanks for sharing! I didn't know about this but it looks handy! Definitely gonna give it a try

👍 3
vemv16:02:19

I have a little setup that always folds the ns form by default For the rest of the form personally I never use folding. IMO the need can reveal other issues (e.g. ns size)

aaelony20:02:50

I have a few colleagues that have 10,000 line python files per project. I find it useful for those and also for perusing lengthier codebases

vemv20:02:10

sure, I don't question code-folding :) I simply reflected my views for greenfield clojure development

👍 3
vemv20:02:44

curious, does emacs handle a 10kLOC file gracefully? I'd imagine the AST parsing could slow down things

aaelony20:02:56

no problems so far

aaelony20:02:17

perhaps it has more to do with the RAM on the box

kingcode23:02:56

Woaw! Thanks for sharing, I love hs-minor-mode :)

metal 4
sogaiu15:02:10

i use this to collapse comment blocks sometimes:

(add-hook 'clojure-mode-hook
              (lambda ()
                (hs-minor-mode)
                (setq hs-hide-comments-when-hiding-all nil)
                (setq hs-block-start-regexp "\\s(comment")))

👍 3
aaelony16:02:16

thought I'd share

caumond21:02:14

Hi, I have modified my test source directory to test/src instead of test . My objective was to be able to add some test/resources.... and so on. The issue I have is with projectile which projectile-between-implementation-and-testis still trying to create test file directly to testand not test/src. Is there a way to fix that? I don't find reference to that, it that a so bad practise to set directories like that?

solf03:02:54

Hmm I don't see an option to customize that (might have overlooked it), maybe you can try overriding the following function in your config:

(defun projectile-test-directory (project-type)
  "Find default test directory based on PROJECT-TYPE."
  (projectile-project-type-attribute project-type 'test-dir "test/"))

solf03:02:18

changing "test/" for "test/src"

caumond15:02:11

So if I understand the answer you gave and the lack of other answers, this use case is not a classical one. I guess people leave their test in the test directory ?