Comments (7)
When I manually set the coding-system to utf-8, the completion works.
from emacs-eclim.
I think the problem is the following: Emacs transmits the encoding of the current buffer to eclim. Eclim uses that encoding in the Java-World to read the source file properly. Since Emacs know a wide array of encodings, which are not common because they have suffixes like "-unix" or "-dos" eclim does not understand the encoding.
I skimmed the emacs-eclim source and found the following variable:
(defvar eclim--file-coding-system-mapping
'(("undecided-dos" . "iso-8859-1")
("dos" . "iso-8859-1")
("undecided-unix" . "iso-8859-1")
("utf-8-dos" . "utf-8")
("utf-8-unix" . "utf-8")
("utf-8-emacs-unix" . "utf-8")))
It looks like that variable performs the mapping of Emacs encodings into encodings eclim can understand. You should be fine if you add a mapping for your encoding:
(add-to-list 'eclim--file-coding-system-mapping '("iso-latin-1-unix" . "iso-8859-1"))
Since this is a common mistake people will run into it would be nice if you make a pull-request and add the mapping to the emacs-eclim source.
from emacs-eclim.
Thanks, this works. Maybe there should be a "default" case, which maps to e.g. iso-8859-1 or utf-8 (which would probably work in a lot of cases), just like the undecided-unix case.
from emacs-eclim.
@root42 I think there should be a better error message when things go wrong but I disagree with the default case. This would swallow error messages and just supply broken completions and features. It's much harder to debug such a situation where things just don't work compared to a straight-forward error-message.
@fred-o What do you think about catching this error and printing a message, which describes how to add new mappings to emacs-eclim?
from emacs-eclim.
@senny Yes, I understand. A simple message stating that the coding is unknown to emacs-eclim would have been useful. Maybe you can make the mappings a customizable variable? Usually I just fire up customize when something goes wrong and see if I can turn some knobs to make it work.
from emacs-eclim.
Something like this? 49ff122
from emacs-eclim.
@fred-o exactly! closing this one.
from emacs-eclim.
Related Issues (20)
- Suggestion: Integration with Projectile? HOT 3
- Error in post-command-hook (global-eclim-mode-check-buffers): (void-function member-if) HOT 11
- Missing argument for option: n HOT 4
- eclim-run-java-doc fails for multiple projects HOT 1
- Eclim auto completion not working
- Why aren't the pull requests being reviewed? HOT 12
- toggle-maximize-buffer doesn't exist? HOT 2
- Mention new fork of emacs-eclim? HOT 1
- Problem with tramp when using .authinfo.gpg HOT 5
- company-emacs-eclim error: Project 'eclipse' does not have the required nature 'java' HOT 2
- url-insert-file-contents: http://melpa.org/packages/emacs-eclim-20160318.1747.tar: Not found HOT 1
- eclim freezes by auto-save-file HOT 10
- package name not compatible with use-package HOT 1
- Incorrect imports for nested classes when using company autocompletion HOT 1
- cannot open projects HOT 1
- emacs-eclim renamed to eclim in melpa HOT 7
- Directory does not exist: /home/user/eclipse/features HOT 6
- Emacs daemon startup hangs with (require 'eclim) HOT 3
- No "Create type" function? HOT 2
- Could not find or load main class org.test HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-eclim.