arnested / drupal-mode

Advanced Emacs minor mode for Drupal development
https://melpa.org/#/drupal-mode
GNU General Public License v3.0
32 stars 14 forks source link

Rewrite of `drupal-detect-drupal-version' needed #12

Closed arnested closed 10 years ago

arnested commented 12 years ago

The use of dir-locals (dir-locals-set-class-variables' anddir-locals-set-directory-class' in `drupal-detect-drupal-version' has proved not to be an ideal solution.

The "project local" variables is not always set correctly resulting in some buffers not entering drupal-mode and/or not having drupal-rootdir set. This limits usabilty of drupal-mode a lot.

We have to redo the handling of the project local variables. And a cleanup of the detection and parsing of drupal-rootdir, drupal-version, etc. could also be a good idea.

dhaley commented 11 years ago

@arnested, What about using 'drush dd' as a fallback method as done here:

https://github.com/kostajh/subDrush/blob/f9d8ba0c9a9d7153a883329c9bec88679cda64f8/lib/drush.py#L180

arnested commented 10 years ago

I just added a rewrite that doesn't use dir-locals.

It is definitely not the fancy cleanup of drupal-detect-drupal-version I've been dreaming of - but getting rid of dir-locals is more important than never getting around to refactoring it the right way.

I'm going to try this branch for some days before merging and releasing.

@dhaley, I have considered using drush dd but since this could be called on a lot of file visits I think it would become very slow.

arnested commented 10 years ago

I just pushed a newer version that fixes some issues with the new approach.

The current version also uses temporary buffers for finding versions so you won't have a lot of visited files around that you haven't visited yourself.

drupal-detect-drupal-version is also much cleaner to look at now.

I'll keep using this version some days before merging it.

arnested commented 10 years ago

It didn't reveal any problems today - so I just merged it to develop.