cjohansson / emacs-ssh-deploy

A deployment plugin via Tramp for Emacs.
GNU General Public License v3.0
152 stars 6 forks source link

Multiple remote directories #35

Closed prestancedesign closed 6 years ago

prestancedesign commented 6 years ago

Hi

Is there possible to set DirectoryVariables to point two locations like a staging and production website project ?

Best regards.

cjohansson commented 6 years ago

I usually have two settings for the remote variable in my .dir-locals.el file and just toggle them by commenting / uncommenting. You need to refresh buffers before change takes place though. Would that work for you? I'm open to better ideas

prestancedesign commented 6 years ago

Yes it's suffisant for me, thx for the information. :+1: Last question, how to refresh .dir-locals buffers ? Eval ? Revert buffer ?

cjohansson commented 6 years ago

For most buffers (revert-buffer) is sufficient to reload DirectoryVariables but for some reason it doesn't work with dired-mode buffers, maybe it's a bug, for those you need to kill them and then re-open them to get new DirectoryVariables.

I think it would be nice to be able to setup different deployment hosts with different settings (including SQL) and not having to comment / uncomment entire regions but I can't think of a good solution right now. If you use the (comment-region) / (uncomment-region) in emacs-lisp it's just a keypress to toggle configurations.

cjohansson commented 6 years ago

Reverting buffers can be a hassle sometimes so it would be great to find a better solution..

prestancedesign commented 6 years ago

Reverting buffers can be a hassle sometimes so it would be great to find a better solution..

I don't know if it's better but there is an alternative find-alternative-file https://emacs.stackexchange.com/a/189

but I can't think of a good solution right now

I'm not a long date user of Emacs (Spacemacs),but if I have an idea and/or inspiration I'll come back :)