Initial Value: adaptive-fill-regexp is a variable defined in `fill.el'. Its value is "[ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*" Value after opening one PHP file: adaptive-fill-regexp is a variable defined in `fill.el'. Its value is "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*\\)" Local in buffer AgencyStudentController.php; global value is "[ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*" Value after opening another file (this with mixed PHP, HTML & Javascript): adaptive-fill-regexp is a variable defined in `fill.el'. Its value is "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*\\)" Local in buffer create.php; global value is "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*\\)\\)" Value after navigating into some JS: adaptive-fill-regexp is a variable defined in `fill.el'. Its value is "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*\\)\\)\\)" After this the mode would not change to nXhtml or PHP mode unless I started entering characters. Once I did that in a PHP chunk: adaptive-fill-regexp is a variable defined in `fill.el'. Its value is "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*\\)\\)\\)\\)" Local in buffer create.php; global value is "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-!|#%;>*·•‣⁃◦]+[ ]*\\)*\\)\\)\\)"