syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.67k stars 4.89k forks source link

Org File Opens Under clojure-mode #5989

Closed jupl closed 8 years ago

jupl commented 8 years ago

Description

The following Org file is being opened under clojure-mode:

* Boot

Reproduction guide

Observed behaviour: Buffer is opened under clojure-mode.

Expected behaviour: Buffer should open under org-mode.

System Info

((clojure :variables clojure-enable-fancify-symbols t)
 colors dockerfile emacs-lisp html github markdown osx react restclient shell shell-scripts syntax-checking vimscript yaml
 (auto-completion :variables auto-completion-enable-help-tooltip t)
 (git :variables git-magit-status-fullscreen t magit-push-always-verify nil)
 (javascript :variables js2-mode-show-parse-errors nil js2-mode-show-strict-warnings nil)
 (org :variables org-src-preserve-indentation t org-startup-folded 'showall)
 (version-control :variables version-control-diff-tool 'diff-hl))
TheBB commented 8 years ago

What is the value of auto-mode-alist?

jupl commented 8 years ago

I'll note that in the example the filename I have been using is README.org.

(("/tern-project.symlink$" . json-mode)
 ("/\\.tern-project$" . json-mode)
 ("/jshintrc.symlink$" . json-mode)
 ("/\\.jshintrc$" . json-mode)
 ("/jsbeautifyrc.symlink$" . json-mode)
 ("/\\.jsbeautifyrc$" . json-mode)
 ("/eslintrc.symlink$" . json-mode)
 ("/\\.eslintrc$" . json-mode)
 ("/bowerrc.symlink$" . json-mode)
 ("/\\.bowerrc$" . json-mode)
 ("/babelrc.symlink$" . json-mode)
 ("/\\.babelrc$" . json-mode)
 ("/\\vimrc.symlink$" . vimrc-mode)
 ("/\\ideavimrc.symlink$" . vimrc-mode)
 ("/\\gitignore.symlink$" . gitignore-mode)
 ("/\\editorconfig.symlink$" . conf-unix-mode)
 ("\\.npmignore$" . gitignore-mode)
 ("\\.zsh$" . sh-mode)
 ("\\.tag$" . web-mode)
 ("\\.swig$" . web-mode)
 ("/\\.spacemacs.local$" . emacs-lisp-mode)
 ("Procfile\\'" . yaml-mode)
 ("\\.\\(yml\\|yaml\\)\\'" . yaml-mode)
 ("\\.e?ya?ml\\'" . yaml-mode)
 ("\\index.ios.js\\'" . react-mode)
 ("\\index.android.js\\'" . react-mode)
 ("\\.react.js\\'" . react-mode)
 ("\\.jsx\\'" . react-mode)
 ("\\.djhtml\\'" . web-mode)
 ("\\.ejs\\'" . web-mode)
 ("\\.eco\\'" . web-mode)
 ("\\.hbs\\'" . web-mode)
 ("\\.handlebars\\'" . web-mode)
 ("\\.mustache\\'" . web-mode)
 ("\\.erb\\'" . web-mode)
 ("\\.eex\\'" . web-mode)
 ("\\.as[cp]x?\\'" . web-mode)
 ("\\.[gj]sp\\'" . web-mode)
 ("\\.htm\\'" . web-mode)
 ("\\.html\\'" . web-mode)
 ("\\.twig\\'" . web-mode)
 ("\\.tpl\\.php\\'" . web-mode)
 ("\\.phtml\\'" . web-mode)
 ("\\.vim[rc]?\\'" . vimrc-mode)
 ("_vimrc\\'" . vimrc-mode)
 ("\\.exrc\\'" . vimrc-mode)
 ("[._]?g?vimrc\\'" . vimrc-mode)
 ("\\.vim\\'" . vimrc-mode)
 ("\\.slim\\'" . slim-mode)
 ("zshrc\\'" . sh-mode)
 ("zshenv\\'" . sh-mode)
 ("zprofile\\'" . sh-mode)
 ("zpreztorc\\'" . sh-mode)
 ("zlogout\\'" . sh-mode)
 ("zlogin\\'" . sh-mode)
 ("\\.zsh\\'" . sh-mode)
 ("\\.scss\\'" . scss-mode)
 ("\\.sass\\'" . sass-mode)
 ("\\.http\\'" . restclient-mode)
 ("\\.m[k]d" . markdown-mode)
 ("\\*.el\\'" . emacs-lisp-mode)
 ("\\.less\\'" . less-css-mode)
 ("\\.plist\\'" . nxml-mode)
 ("\\.json$" . json-mode)
 ("\\.js\\'" . js2-mode)
 ("\\.pug$" . jade-mode)
 ("\\.jade\\'" . jade-mode)
 ("\\.haml\\'" . haml-mode)
 ("\\.g\\(?:ant\\|roovy\\|radle\\)\\'" . groovy-mode)
 ("/git/ignore\\'" . gitignore-mode)
 ("/info/exclude\\'" . gitignore-mode)
 ("/\\.gitignore\\'" . gitignore-mode)
 ("/etc/gitconfig\\'" . gitconfig-mode)
 ("/\\.gitmodules\\'" . gitconfig-mode)
 ("/git/config\\'" . gitconfig-mode)
 ("/modules/.*/config\\'" . gitconfig-mode)
 ("/\\.git/config\\'" . gitconfig-mode)
 ("/\\.gitconfig\\'" . gitconfig-mode)
 ("/git/attributes\\'" . gitattributes-mode)
 ("/info/attributes\\'" . gitattributes-mode)
 ("/\\.gitattributes\\'" . gitattributes-mode)
 ("/fish_funced\\..*\\'" . fish-mode)
 ("\\.fish\\'" . fish-mode)
 ("/git-rebase-todo\\'" . git-rebase-mode)
 ("/\\.editorconfig\\'" . editorconfig-conf-mode)
 ("Dockerfile.*\\'" . dockerfile-mode)
 ("pentadactylrc\\'" . dactyl-mode)
 ("\\.vimp\\'" . dactyl-mode)
 ("vimperatorrc\\'" . dactyl-mode)
 ("\\.penta\\'" . dactyl-mode)
 ("_pentadactylrc\\'" . dactyl-mode)
 ("_vimperatorrc\\'" . dactyl-mode)
 ("\\.cson\\'" . coffee-mode)
 ("Cakefile\\'" . coffee-mode)
 ("\\.iced\\'" . coffee-mode)
 ("\\.coffee\\'" . coffee-mode)
 ("\\.boot\\'" . clojure-mode)
 ("\\(?:build\\|profile\\)\\.boot\\'" . clojure-mode)
 ("\\.cljs\\'" . clojurescript-mode)
 ("\\.cljx\\'" . clojurex-mode)
 ("\\.cljc\\'" . clojurec-mode)
 ("\\.\\(clj\\|dtm\\|edn\\)\\'" . clojure-mode)
 ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file)
 ("\\.\\(?:3fr\\|arw\\|bmp\\|cr[2w]\\|d\\(?:cr\\|ng\\)\\|exr\\|gif\\|ico\\|jp\\(?:2\\|eg\\)\\|mrw\\|nef\\|orf\\|p\\(?:ef\\|ict\\|ng\\|sd\\)\\|raf\\|s\\(?:gi\\|r[2f]\\)\\|t\\(?:ga\\|iff\\)\\)\\'" . image-mode)
 ("\\.elc\\'" . emacs-lisp-byte-code-mode)
 ("\\.dz\\'" nil jka-compr)
 ("\\.xz\\'" nil jka-compr)
 ("\\.lzma\\'" nil jka-compr)
 ("\\.lz\\'" nil jka-compr)
 ("\\.g?z\\'" nil jka-compr)
 ("\\.bz2\\'" nil jka-compr)
 ("\\.Z\\'" nil jka-compr)
 ("\\.vr[hi]?\\'" . vera-mode)
 ("\\(?:\\.rb\\|ru\\|rake\\|thor\\|jbuilder\\|gemspec\\|podspec\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . ruby-mode)
 ("\\.re?st\\'" . rst-mode)
 ("\\.py\\'" . python-mode)
 ("\\.awk\\'" . awk-mode)
 ("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode)
 ("\\.idl\\'" . idl-mode)
 ("\\.java\\'" . java-mode)
 ("\\.m\\'" . objc-mode)
 ("\\.ii\\'" . c++-mode)
 ("\\.i\\'" . c-mode)
 ("\\.lex\\'" . c-mode)
 ("\\.y\\(acc\\)?\\'" . c-mode)
 ("\\.[ch]\\'" . c-mode)
 ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode)
 ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode)
 ("\\.\\(cc\\|hh\\)\\'" . c++-mode)
 ("\\.\\(bat\\|cmd\\)\\'" . bat-mode)
 ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode)
 ("\\.svgz?\\'" . image-mode)
 ("\\.svgz?\\'" . xml-mode)
 ("\\.x[bp]m\\'" . image-mode)
 ("\\.x[bp]m\\'" . c-mode)
 ("\\.p[bpgn]m\\'" . image-mode)
 ("\\.tiff?\\'" . image-mode)
 ("\\.gif\\'" . image-mode)
 ("\\.png\\'" . image-mode)
 ("\\.jpe?g\\'" . image-mode)
 ("\\.te?xt\\'" . text-mode)
 ("\\.[tT]e[xX]\\'" . tex-mode)
 ("\\.ins\\'" . tex-mode)
 ("\\.ltx\\'" . latex-mode)
 ("\\.dtx\\'" . doctex-mode)
 ("\\.org\\'" . org-mode)
 ("\\.el\\'" . emacs-lisp-mode)
 ("Project\\.ede\\'" . emacs-lisp-mode)
 ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
 ("\\.l\\'" . lisp-mode)
 ("\\.li?sp\\'" . lisp-mode)
 ("\\.[fF]\\'" . fortran-mode)
 ("\\.for\\'" . fortran-mode)
 ("\\.p\\'" . pascal-mode)
 ("\\.pas\\'" . pascal-mode)
 ("\\.\\(dpr\\|DPR\\)\\'" . delphi-mode)
 ("\\.ad[abs]\\'" . ada-mode)
 ("\\.ad[bs].dg\\'" . ada-mode)
 ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)
 ("Imakefile\\'" . makefile-imake-mode)
 ("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode)
 ("\\.makepp\\'" . makefile-makepp-mode)
 ("\\.mk\\'" . makefile-bsdmake-mode)
 ("\\.make\\'" . makefile-bsdmake-mode)
 ("GNUmakefile\\'" . makefile-gmake-mode)
 ("[Mm]akefile\\'" . makefile-bsdmake-mode)
 ("\\.am\\'" . makefile-automake-mode)
 ("\\.texinfo\\'" . texinfo-mode)
 ("\\.te?xi\\'" . texinfo-mode)
 ("\\.[sS]\\'" . asm-mode)
 ("\\.asm\\'" . asm-mode)
 ("\\.css\\'" . css-mode)
 ("\\.mixal\\'" . mixal-mode)
 ("\\.gcov\\'" . compilation-mode)
 ("/\\.[a-z0-9-]*gdbinit" . gdb-script-mode)
 ("-gdb\\.gdb" . gdb-script-mode)
 ("[cC]hange\\.?[lL]og?\\'" . change-log-mode)
 ("[cC]hange[lL]og[-.][0-9]+\\'" . change-log-mode)
 ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
 ("\\.scm\\.[0-9]*\\'" . scheme-mode)
 ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
 ("\\.bash\\'" . sh-mode)
 ("\\(/\\|\\`\\)\\.\\(bash_\\(profile\\|history\\|log\\(in\\|out\\)\\)\\|z?log\\(in\\|out\\)\\)\\'" . sh-mode)
 ("\\(/\\|\\`\\)\\.\\(shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)
 ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode)
 ("\\.m?spec\\'" . sh-mode)
 ("\\.m[mes]\\'" . nroff-mode)
 ("\\.man\\'" . nroff-mode)
 ("\\.sty\\'" . latex-mode)
 ("\\.cl[so]\\'" . latex-mode)
 ("\\.bbl\\'" . latex-mode)
 ("\\.bib\\'" . bibtex-mode)
 ("\\.bst\\'" . bibtex-style-mode)
 ("\\.sql\\'" . sql-mode)
 ("\\.m[4c]\\'" . m4-mode)
 ("\\.mf\\'" . metafont-mode)
 ("\\.mp\\'" . metapost-mode)
 ("\\.vhdl?\\'" . vhdl-mode)
 ("\\.article\\'" . text-mode)
 ("\\.letter\\'" . text-mode)
 ("\\.i?tcl\\'" . tcl-mode)
 ("\\.exp\\'" . tcl-mode)
 ("\\.itk\\'" . tcl-mode)
 ("\\.icn\\'" . icon-mode)
 ("\\.sim\\'" . simula-mode)
 ("\\.mss\\'" . scribe-mode)
 ("\\.f9[05]\\'" . f90-mode)
 ("\\.f0[38]\\'" . f90-mode)
 ("\\.indent\\.pro\\'" . fundamental-mode)
 ("\\.\\(pro\\|PRO\\)\\'" . idlwave-mode)
 ("\\.srt\\'" . srecode-template-mode)
 ("\\.prolog\\'" . prolog-mode)
 ("\\.tar\\'" . tar-mode)
 ("\\.\\(arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode)
 ("\\.oxt\\'" . archive-mode)
 ("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode)
 ("\\`/tmp/Re" . text-mode)
 ("/Message[0-9]*\\'" . text-mode)
 ("\\`/tmp/fol/" . text-mode)
 ("\\.oak\\'" . scheme-mode)
 ("\\.sgml?\\'" . sgml-mode)
 ("\\.x[ms]l\\'" . xml-mode)
 ("\\.dbk\\'" . xml-mode)
 ("\\.dtd\\'" . sgml-mode)
 ("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
 ("\\.js\\'" . javascript-mode)
 ("\\.json\\'" . javascript-mode)
 ("\\.[ds]?vh?\\'" . verilog-mode)
 ("\\.by\\'" . bovine-grammar-mode)
 ("\\.wy\\'" . wisent-grammar-mode)
 ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode)
 ("\\`\\..*emacs\\'" . emacs-lisp-mode)
 ("[:/]_emacs\\'" . emacs-lisp-mode)
 ("/crontab\\.X*[0-9]+\\'" . shell-script-mode)
 ("\\.ml\\'" . lisp-mode)
 ("\\.ld[si]?\\'" . ld-script-mode)
 ("ld\\.?script\\'" . ld-script-mode)
 ("\\.xs\\'" . c-mode)
 ("\\.x[abdsru]?[cnw]?\\'" . ld-script-mode)
 ("\\.zone\\'" . dns-mode)
 ("\\.soa\\'" . dns-mode)
 ("\\.asd\\'" . lisp-mode)
 ("\\.\\(asn\\|mib\\|smi\\)\\'" . snmp-mode)
 ("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode)
 ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)
 ("\\.\\(dif\\|pat\\)\\'" . diff-mode)
 ("\\.[eE]?[pP][sS]\\'" . ps-mode)
 ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe)
 ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode)
 ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode)
 ("BROWSE\\'" . ebrowse-tree-mode)
 ("\\.ebrowse\\'" . ebrowse-tree-mode)
 ("#\\*mail\\*" . mail-mode)
 ("\\.g\\'" . antlr-mode)
 ("\\.mod\\'" . m2-mode)
 ("\\.ses\\'" . ses-mode)
 ("\\.docbook\\'" . sgml-mode)
 ("\\.com\\'" . dcl-mode)
 ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
 ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode)
 ("\\.\\(?:desktop\\|la\\)\\'" . conf-unix-mode)
 ("\\.ppd\\'" . conf-ppd-mode)
 ("java.+\\.conf\\'" . conf-javaprop-mode)
 ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
 ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode)
 ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode)
 ("[cC]hange[lL]og[-.][-0-9a-z]+\\'" . change-log-mode)
 ("/\\.?\\(?:gnokiirc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode)
 ("/\\.\\(?:enigma\\|gltron\\|gtk\\|hxplayer\\|net\\|neverball\\|qt/.+\\|realplayer\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode)
 ("/\\.\\(?:gdbtkinit\\|grip\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-mode)
 ("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode)
 ("/X11.+app-defaults/" . conf-xdefaults-mode)
 ("/X11.+locale/.+/Compose\\'" . conf-colon-mode)
 ("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode)
 ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t)
 ("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t)
 ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode-maybe)
 ("\\.[1-9]\\'" . nroff-mode)
 ("\\.tgz\\'" . tar-mode)
 ("\\.tbz2?\\'" . tar-mode)
 ("\\.txz\\'" . tar-mode)
 ("\\.markdown\\'" . markdown-mode)
 ("\\.md\\'" . markdown-mode))
TheBB commented 8 years ago

Thanks. Maybe a pastebin would have been better though. :-)

Anyway, I can't reproduce this problem, even with your exact auto-mode-alist.

jupl commented 8 years ago

What does auto-mode-alist have to do this issue though? My understanding is auto-mode-alist is for dealing with the buffer/file name. The issue is not the file name, but the contents of the file when opened is what differentiates the major mode.

TheBB commented 8 years ago

Oh, ok, it's due to this then.

Does any clojure people know why this is here?

TheBB commented 8 years ago

https://github.com/syl20bnr/spacemacs/pull/5994 should fix it I assume.

jupl commented 8 years ago

Works. Thank you!

sooheon commented 8 years ago

You can go ahead and close this

jupl commented 8 years ago

Isn't it the convention here to close this once it's in master?

sooheon commented 8 years ago

Ah if that's the case I was unaware :)

StreakyCobra commented 8 years ago

It's left up to the user, but on our side we close it when it reaches master.

d12frosted commented 8 years ago

Fixed with released of Spacemacs v0.200. Let us know if you still have any problems with this issue.