reddit / emacs

Per project project-compile history in project.el?

paretoOptimalDev · 2022-05-18 16:05
this is a great feature from projectile I'm missing quite a lot lately, so I was curious if anyone had already done this or I perhaps missed something in `customize-group project RET`. It's alright to use M-r if I remember the command, but thats not the usual case lol.
[deleted] · 2022-05-18 16:22
One take on it here: https://gitlab.com/woolsweater/dotemacs.d/-/blob/b84f811fa36044940308bd0665e0516d7840ba6d/modules/conjecture.el (and see also [the setup](https://gitlab.com/woolsweater/dotemacs.d/-/blob/b84f811fa36044940308bd0665e0516d7840ba6d/modules/initialize.el#L7-23), and then [using that for Xcode projects](https://gitlab.com/woolsweater/dotemacs.d/-/blob/b84f811fa36044940308bd0665e0516d7840ba6d/modules/convexed.el#L143-214) and [Swift Package Manager projects](https://gitlab.com/woolsweater/dotemacs.d/-/blob/b84f811fa36044940308bd0665e0516d7840ba6d/modules/my-swift-mode.el#L188-263)). This is using a buffer-local variable for commands, since there's no built-in functionality for a project-local variable. But if you specify the values in .dir-locals the effect is per-project.
s-kostyaev · 2022-05-19 14:50
.dir-locals has no effect on subdirectories
[deleted] · 2022-05-19 17:00
I'm not sure where you got that idea. https://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Local-Variables.html > The name of the file is .dir-locals.el. A file by that name in a directory causes Emacs to apply its settings to any file in that directory **or any of its subdirectories** (optionally, you can exclude subdirectories; see below). If some of the subdirectories have their own .dir-locals.el files, Emacs uses the settings from the deepest file it finds starting from the file’s directory and moving up the directory tree.
s-kostyaev · 2022-05-20 06:12
I have this idea after trying to use .dir-locals for implementing project-local variables for dap debug adapter for go. New variable inside project was not set in new buffers during session. Maybe after setting .dir-locals I need to restart emacs for use this new value inside project. I'm glad to hear I was wrong. Thank you!
[deleted] · 2022-05-20 22:25
[removed]
paretoOptimalDev · 2022-05-22 21:52
Thanks! I'll give this a try.