Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Javascript dictionary does not enabled as a source due to mismatched major mode name #211

Open
aethanyc opened this Issue Mar 4, 2013 · 13 comments

Comments

Projects
None yet
6 participants

aethanyc commented Mar 4, 2013

I use Emacs 24.3. Currently, ac-modes contain the following javascript mode names: ecmascript-mode, javascript-mode, js-mode, and js2-mode. However only the javascript dictionary file named "javascript-mode" is provided. If the builtin js-mode or popular js2-mode is used as the major mode, the dictionary is not enabled due to mismatched mode name even if ac-source-dictionary is in ac-sources.

yyr commented Mar 4, 2013

one workaround is making symlinks

aethanyc commented Mar 6, 2013

Yes. But there might be a better way to handle this.

Owner

m2ym commented Mar 24, 2013

Adding symlinks to the repository may solve this problem, but I don't know what happens when pulling the repository on Windows.

I have tried to add symlinks to the repository. The symlinks are not recognized after I cloned the repository on Windows while they are OK on Linux.

Owner

m2ym commented Mar 30, 2013

How about js2-mode?

I have added js2-mode, too. Please refer to request #223.

Member

tkf commented Mar 30, 2013

There is js3-mode...

I think this should be done by improving dispatch mechanism, not adding files per mode.

Owner

m2ym commented Mar 31, 2013

LOL.

@tkf I have came up with one good mechanism that dispatches the dictionaries by a meta header information of eacy dictionary. A meta header looks like:

#% javascript ecmascript js js2 js3

If the meta header is not given, the file name will be used as a mode name. By the way, the "-mode" suffix should be able to be ommited.

Member

tkf commented Mar 31, 2013

Any reason why you want to put the mode list in the dictionary file? Why not have it in some lisp variable? If you have it in a lisp variable, you don't need to parse the file.

I suggest to use dict/LANG for LANG-mode unless you have an entry in ac-mode-dictionary-alist which is something like this:

((javascript-mode . javascript)
 (js-mode . javascript)
 (js2-mode . javascript)
 (js3-mode . javascript)
 (tuareg-mode . ocaml)
 (typerex-mode . ocaml)
 ;; and so on...
 )
Owner

m2ym commented Mar 31, 2013

As long as we follow the current architecture of dictionaries, dictionaries should be self-described and extensible based on existing dictionaries. But your suggestion is still reasonable if we introduce the variable only at 1.x.

Member

tkf commented Mar 31, 2013

Hmm... I thought we can implement what I suggested without breaking backward compatibility. I don't know how AC supports extensibility of the dictionaries. I need to check that.

ddysher commented Aug 9, 2014

Is there any update on this issue? It seems AC still doesn't recognize the dictionary due to dismatched major mode name.

I use newest version of AC from elpa.

Contributor

syohex commented Aug 9, 2014

Sorry, no update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment