Skip to content

"charset = utf-8" setting in .editorconfig breaks opening .jar files in emacs #294

@steinarb

Description

@steinarb

.jar files in Java projects are actually .zip files, which emacs can open natively.

If I have a project with an .editorconfig file, like e.g. this project: https://github.com/steinarb/modelstore
and then builds that project with "mvn clean install"
and then tries opening the jar files in the modelstore/modelstore.services/target/ directory they fail to open correctly:
https://www.bang.priv.no/screenshots/Screenshot%20at%202023-04-03%2007-27-13.png

I bisected my .emacs and found that the offending config was the following in my ~/.emacs:

;; editorconfig formatting support
;;;================================
(when (locate-library "editorconfig")
  (editorconfig-mode 1))

Removing the above config caused jar files to open correctly in .emacs, which BTW looks like this:
https://www.bang.priv.no/screenshots/Screenshot%20at%202023-04-03%2007-54-54.png

Removing the .editorconfig from the project also made .jar files open correctly in .emacs, so I bisected the .editorconfig file and found that the offending line was

charset = utf-8

Removing that line from a project's .editorconfig made .jar files open correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions