Skip to content
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

Add to beginning of auto-mode-alist, not end #335

Closed
wants to merge 1 commit into from

Conversation

raxod502
Copy link
Contributor

@raxod502 raxod502 commented May 7, 2018

In Emacs 26, a file called CHANGELOG.md will open in changelog-mode instead of markdown-mode, because a regexp was added to auto-mode-alist that matches the CHANGELOG part of the filename. In order for the file to correctly open in markdown-mode, the regexps for markdown-mode must be added earlier in auto-mode-alist, hence this pull request.

There should be no concern about this overriding user configuration, since it makes no sense for user configuration code to be run before the autoloads for markdown-mode are evaluated.

This solves #331 and addresses my comment at #127 (comment).

This is a breaking change, but only barely—if someone were relying on the previous behavior, I would consider it extraordinarily bad practice.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have updated the documentation in the README.md file if necessary.
  • I have added an entry to CHANGES.md.
  • I have added tests to cover my changes.
  • All new and existing tests passed (using make test).

Let me know if you think a test is required for this change.

In Emacs 26, a file called 'CHANGELOG.md' will open in
`changelog-mode' instead of `markdown-mode', because a regexp was
added to `auto-mode-alist' that matches the 'CHANGELOG' part of the
filename. In order for the file to correctly open in `markdown-mode',
the regexps for `markdown-mode' must be added earlier in
`auto-mode-alist', hence this commit.

There should be no concern about this overriding user configuration,
since it makes no sense for user configuration code to be run before
the autoloads for `markdown-mode' are evaluated.
@bbatsov
Copy link

bbatsov commented Jul 7, 2018

@jrblevin Ping :-) This fixes an extremely annoying issue on Emacs 26, so I think it's worth merging the the PR.

@jrblevin
Copy link
Owner

jrblevin commented Jul 7, 2018

Thanks for the reminder, and thanks @raxod502 for the patch! Rebased and applied as b92f00d.

@jrblevin jrblevin closed this Jul 7, 2018
@bbatsov
Copy link

bbatsov commented Jul 7, 2018 via email

raxod502 added a commit to radian-software/radian that referenced this pull request Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants