When I open file with C-x C-f (counsel-find-file &optional INITIAL-INPUT)
Most of the org files are opened as org-mode automatically, yet there are a few displayed as plain text as fundamental mode.
What's the problem it might be?
The example is the Chapter 5 of SICP
Issue M: and eval (cl-rassoc 'org-mode auto-mode-alist)
, get output
("\\.org\\'" . org-mode)
Emacs 26.3
GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.11) of 2019-09-23, modified by Debian
the machine info:
OS: Ubuntu 19.10 x86_64
Host: MacBookPro11,1 1.0
Kernel: 5.3.0-24-generic
Uptime: 7 hours, 54 mins
Packages: 2601 (dpkg), 2 (snap)
Shell: bash 5.0.3
Resolution: 2560x1600
DE: KDE
WM: KWin
C-h k
and then type the keyboard shortcut to see which function is bound. Also, do you have a minimal working example of a file that the behavior is exhibited? If we have that information, then we can probably do away with our crystal ball when trying to answer this question. :) – lawlist Jan 07 '20 at 07:46M-:
and thereafter in the minibuffer(cl-rassoc 'org-mode auto-mode-alist)
followed by the RETURN key. Add the value that is output to the*Messages*
buffer to your question. – Tobias Jan 07 '20 at 10:37org\\'" . org-mode)
. @Tobias – Wizard Jan 07 '20 at 13:02("\\.org$" . org-mode)
. Note that also the pattern is different in my case: you might want to check the setting ofauto-mode-alist
. – NickD Jan 07 '20 at 13:55("\\.org\\'" . org-mode)
is also fine. Actually, it is closer to what is meant. The expression$
at the end of the regexp is the match of the empty string at the end of line while\\'
is the match of the empty string at the end of input, i.e., the string. A string may contain multiple lines. Then$
and\\'
can give different results. – Tobias Jan 07 '20 at 14:03M-x emacs-version
)? Do the files with this problem have anything in common - same directory, similar name, any comments at the beginning or end of the files? – Tyler Jan 07 '20 at 14:28emacs -Q
? – Tyler Jan 07 '20 at 14:39