From 1777783619a6a910c5522f658fec2eaaeed10922 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sat, 11 Aug 2018 12:50:50 +0200 Subject: Problem with tabs in .mk file corrected in dir-locals.el Previously we had tried to corrected the problem that `.mk' files use space instead of TAB by setting them to be read into makefile-mode at the start. However, for some reason, this caused a problem in reading the maximum line length (the value of 75 wasn't read by Emacs). So after some playing around, I found out that the problem is that the `nil' setting (for all other files) must be defined in the end, not the start of the basic settings and this solved this problem. --- .dir-locals.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to '.dir-locals.el') diff --git a/.dir-locals.el b/.dir-locals.el index 5606ae8..c6dd4df 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -9,16 +9,15 @@ ;; ;; For more information see (info "(emacs) Directory Variables") -;; Open `.mk' files in Makefile mode -(add-to-list 'auto-mode-alist '("\\.mk$" . makefile-mode)) - ;; Basic settings. -((nil - (indent-tabs-mode . nil) ;; No tabs as indentation - (fill-column . 75)) ;; 75-character wide lines - (c-mode +((c-mode ;; C files (c-basic-offset . 2) ;; 2 spaces of indentation (c-file-style . "gnu")) ;; GNU style for braces - (makefile-mode + + (makefile-mode ;; Makefiles (indent-tabs-mode . t)) ;; Real TABs are important in makefiles + +(nil ;; All other files. + (indent-tabs-mode . nil) ;; No tabs as indentation + (fill-column . 75)) ;; 75-character wide lines ) -- cgit v1.2.1