sshaw / build-status

Emacs minor mode that monitors and shows a buffer's build status in the mode line.
27 stars 2 forks source link

Use project buffer to update build status #8

Closed porras closed 7 months ago

porras commented 5 years ago

This fixed what can be considered a bug or a missing feature :smirk: If one uses directory local variables to configure this mode, this doesn't work correctly when you're working in more than one project, because the values are being taken from the current buffer, not the one of the project being updated. This change fixes that.

Note: this change also undoes an optimization that was present on the code before, where the buffer list would be iterated to get the file names and cached, now this is done once per project, but only until the right buffer is found, not the whole list. I tried it with three projects and ~10 buffers and didn't visually notice any difference, but I didn't do any benchmarking.

It also changes the way it checks if a buffer is editing a file in a project, using string-prefix-p instead of compare-strings. I think it does the same, but to be honest I didn't fully understand the previous version, so I might be missing something.

Lastly, I think the dependency on cl-lib can be removed, I didn't do it though, also in case I'm missing something.