I want to enable mode association with backup files as well. E.g., if I backup my my-markdown.md
file as my-markdown.md.orig
or my-markdown.md.lastweek
etc, I want them still be associated with the markdown mode. This is how I'm trying to fix it:
(use-package markdown-mode
- :mode ("\\.\\(txt\\|markdown\\|md\\)\\'" . markdown-mode))
+ :mode ("\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.)" . markdown-mode))
It was working fine before my hack, but now neither the .md
files nor the .md.lastweek
are associated.
UPDATE, for the record, for all my questions, I gather all the answers to here.
auto-mode-alist
and defining the backup file extension names with yourmarkdown-mode
?use-package
macro is doing exactly that -- it createsauto-mode-alist
entries based on the specific:mode
config.)
in your regex string. Maybe you meant this:\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.\\)
?use-package :mode
you don't need to specify the actual mode name unless it differs from the package. So for markdown you could just do this:(use-package markdown-mode :mode "\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.\\)")