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

Stop Clobbering auto-mode-alist #105

Closed
ejmr opened this issue Jun 22, 2013 · 1 comment
Closed

Stop Clobbering auto-mode-alist #105

ejmr opened this issue Jun 22, 2013 · 1 comment
Labels
Milestone

Comments

@ejmr
Copy link
Collaborator

ejmr commented Jun 22, 2013

PHP Mode always attempts to establish itself as the major mode for various file patterns. Specifically we do this:

(dolist (pattern '("\\.php[s345t]?\\'" "\\.phtml\\'"))
  (add-to-list 'auto-mode-alist `(,pattern . php-mode)))

This creates a conflict with other modes that also support PHP, e.g. mmm-mode. Issue #32 points out how this can create problems between such modes.

A first step is to make the file patterns for PHP files configurable via defcustom. This will also require redefining php-speedbar-config, as it has a hard-coded assumption about file patterns. After that a couple of options come to mind:

  1. PHP Mode could prompt the user about what to do whenever it is about to clobber an existing auto-mode-alist entry for PHP files.
  2. We could always refrain from affecting existing auto-mode-alist associations unless the user explicitly allows PHP Mode to do so (e.g. through a customizable flag).

There are other ways we could approach this, but the overall idea is to make PHP Mode less intrusive and assuming about what it does to auto-mode-alist.

@ejmr
Copy link
Collaborator Author

ejmr commented Jun 22, 2013

Anything done about this must also take 4cbf4f6 into account.

ejmr pushed a commit that referenced this issue Oct 29, 2013
Some other modes stake a claim to PHP files, e.g. mmm-mode.  PHP Mode
blasts over auto-mode-alist and depending on the order in which a user
loads each PHP Mode may usurp association with PHP files from the
other modes, and that can be annoying to users of those other modes.
This patch appends the file patterns for PHP Mode to the end of
auto-mode-alist so that they will not over-shadow any existing
associations which may already exist.

GitHub-Issue: #32
GitHub-Issue: #105
GitHub-Issue: dgutov/mmm-mode#32
@ejmr ejmr closed this as completed Oct 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant