-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating Editorconfig support into Emacs #341
Comments
🙆 |
🙆
I'll check this weekend.
Thanks!
|
I read patches you cc-ed to me. It seems we can still use your Some comments from editorconfig.patch:
FYI, editorconfig-core-handle.el already has a caching mechanism. This impl is used by default so normally .editorconfig file will not be parsed every time a file is opened.
rpm-spec-mode is not defined using define-derived-mode and calls kill-all-local-variables explicitly, which reset all editorconfig settings. So it is a matter of timing when it is called, not whether it is called or not... I also want to ask one thing to you: how the development process of editorconfig-emacs will change (or not change) after it is integrated into emacs? |
It seems we can still use your `editorconfig--get-dir-local-variables`
function for Emacs<30 if we (mainly I, maybe!) update the existing code to
use it (please tell me if it is not true), so I'm totally OK with it! 👌
Indeed, I think we can keep the two code paths unified to
a large extent. I'm working on such a patch.
> FIXME: Cache the result of `editorconfig-call-get-properties-function'?
FYI, editorconfig-core-handle.el already has a caching
mechanism(editorconfig-core-handle.el#L85-L101).
This impl is used by default so normally .editorconfig file will not be
parsed every time a file is opened.
Right. My question was whether we should try and avoid the cache lookup:
the "old" code looks up the cache once per file-visit, whereas now we
call it once for `hack-dir-local-get-variables-functions` and once for
`auto-coding-functions`.
But indeed, I'm going with "no" as the answer until proven otherwise. 🙂
> ;; FIXME: I don't understand the above comment, because
> ;; *all* major modes are supposed to call
> ;; `kill-all-local-variables' directory or indirectly.
[rpm-spec-mode](https://github.com/stigbjorlykke/rpm-spec-mode/blob/c1c38050c48ea330c7cea632b8785d66daeefb2b/rpm-spec-mode.el)
is not defined using define-derived-mode and calls kill-all-local-variables
explicitly, which reset all editorconfig settings. So it is a matter of
timing when it is called, not whether it is called or not...
At least when I wrote this code it is required, but I updated the impl
afterword. So it is possible we can remove this now (I'll check later).
I see, thanks. In any case this only affects the code for those Emacsen
without `hack-dir-local-get-variables-functions`.
I also want to ask one thing to you: how the development process of
editorconfig-emacs will change (or not change) after it is integrated
into emacs?
As you can see editorconfig-emacs is currently developed mainly on GitHub,
and also it often accept PR from users (especially [adding new
major-mode](https://github.com/editorconfig/editorconfig-emacs/pulls?q=is%3Apr+is%3Aclosed+-mode))
I'm not very familiar with the development of Emacs, is it possible to
continue developing this plugin on GitHub?
That was my question as well:
Also, I'm curious to hear what you'd like to do with that package in the
longer run: would you be interested to move the development and
maintenance to the code that will be in `emacs.git` (and basically treat
`editorconfig-emacs` as legacy code maintained only for older Emacsen),
or maintain both in parallel (in which case we'll want to be careful to
keep the two codes in sync and to make sure such sync is easy enough to
do), or would rather just keep working on `editorconfig-emacs` and let
other people deal with the copy of the code we'll install into
`emacs.git`, ... ?
So, IIUC you prefer to keep developing it in `editorconfig-emacs`?
Stefan
|
I see 🙆
Thanks! |
I pushed to To consult that branch you can do:
I have not had much luck running the tests and haven't been able to figure out yet how they work, tho, so there's probably some breakage. |
Regarding the tests: when I try to run them on the current version of the package, I get:
when running them using Emacs-29 on my new code (but still using the old hooks/advices) I get the same 3 failures plus:
and on Emacs-30 (i.e. when using the new hooks) I get two more test failures:
I don't know how to run the tests' code by hand (e.g. I can't find the [ BTW, if you could comment on issue #343, that would be helpful. ] |
Thanks!
|
`plugin-tests/test_files/` is a git submodule directory so you'll need `git
submodule update --init` first.
Aha!
|
OK, I made progress: now the new code passes all the tests when run in Emacs<30 and there are only 2 new test failures when running in Emacs-30:
|
It seems it's merged, congrats and thanks @monnier @10sr ! — a happy Emacs user who thinks |
Almost all the work for this integration was done by @monnier, and I just answered some questions from them on GitHub. |
Hi @10sr,
I sent you email discussing a possible plan for integration into Emacs (mostly focusing on replacing the two hackish advice with hooks that give us the "right" access). I have pushed the corresponding WiP patches to the
scratch/editorconfig
branches of both theemacs.git
and thenongnu.git
repositories (different patches: the ones inemacs.git
are the patches which add the hooks that let us specify additional dir-local variables and to specify the coding system to use, whereas the patches innongnu.git
are corresponding changes in the code of editorconfig-emacs to make use of those new hooks).If we want to include some support in Emacs-30, we need to move quickly (Eli is about to cut the branch for Emacs-30).
The main concern is the fact that the hack-dir-local-variables machinery manipulates lists of var settings before applying them, so we can't reuse the existing code as-is and I'd be interested in your opinion about how to go about it.
The text was updated successfully, but these errors were encountered: