-
I have settings as below: (setq-default major-mode
(lambda () (if buffer-file-name
(fundamental-mode)
(let ((buffer-file-name (buffer-name)))
(set-auto-mode)))))
when it's a file-visiting buffer, set default to ;;;###autoload
(dolist (pattern '("/\\.gitconfig\\'" "/\\.git/config\\'"
"/modules/.*/config\\'" "/git/config\\'"
"/\\.gitmodules\\'" "/etc/gitconfig\\'"))
(add-to-list 'auto-mode-alist (cons pattern 'gitconfig-mode))) Of course it's no problem , but I just doubt what difference between |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I am not sure you are supposed to use the option like this but at least I didn't see anything that said otherwise.
The first only matches a file named |
Beta Was this translation helpful? Give feedback.
I am not sure you are supposed to use the option like this but at least I didn't see anything that said otherwise.
The first only matches a file named
.gitconfig
, the second also matcheswhatever.gitconfig
.