emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/zig-mode b0eb489 051/104: [+] Guarantee Unix line endings


From: ELPA Syncer
Subject: [nongnu] elpa/zig-mode b0eb489 051/104: [+] Guarantee Unix line endings to avoid compiler complaining with DOS carriage return
Date: Sun, 29 Aug 2021 11:37:01 -0400 (EDT)

branch: elpa/zig-mode
commit b0eb489668d24d39841b25dede9a6359527b63eb
Author: serialdev <carlos.mariscal.melgar@gmail.com>
Commit: serialdev <carlos.mariscal.melgar@gmail.com>

    [+] Guarantee Unix line endings to avoid compiler complaining with DOS 
carriage return
---
 zig-mode.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/zig-mode.el b/zig-mode.el
index e2932cd..3b89788 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -298,6 +298,16 @@
                                  '("enum" "struct" "union"))
                  `(("Fn" ,(zig-re-definition "fn") 1))))
 
+;;; Guarantee filesystem unix line endings
+(defun zig-file-coding-system ()
+  (with-current-buffer (current-buffer)
+    (if (string-match "\\.d?zig\\'" buffer-file-name)
+        (setq buffer-file-coding-system 'utf-8-unix)
+      nil)
+))
+
+(add-hook 'zig-mode-hook 'zig-file-coding-system)
+
 ;;;###autoload
 (define-derived-mode zig-mode prog-mode "Zig"
   "A major mode for the Zig programming language."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]