No need for file size check when opening file in Emacs.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Fri, 08 Jan 2021 00:07:21 +0200
changeset 959 25d27dfee90e
parent 958 4fdd8bd3d0a4
child 960 b4b2d30f6c97
No need for file size check when opening file in Emacs. Check should be done in utility "e".
.config/mc/mc.ext
Makefile
--- a/.config/mc/mc.ext	Fri Jan 08 00:04:16 2021 +0200
+++ b/.config/mc/mc.ext	Fri Jan 08 00:07:21 2021 +0200
@@ -248,6 +248,10 @@
 ################################################################
 # Open in Emacs.
 
+default/*
+    Open=file %f
+    Edit=e %f
+
 regex/\.([cC][cC]?|[cC][pP][pP]|[cC][xX][xX])$
     Open=e %f
     # Open=sensible-editor %f
--- a/Makefile	Fri Jan 08 00:04:16 2021 +0200
+++ b/Makefile	Fri Jan 08 00:07:21 2021 +0200
@@ -157,12 +157,7 @@
 	mkdir -p $(HOME)/.config/mc $(HOME)/.local/share/mc/; \
 	umask 0117; \
 	$(INSTALL_DATA) .local/share/mc/bashrc $(HOME)/.local/share/mc/; \
-	cat .config/mc/mc.ext /etc/mc/mc.ext > $(HOME)/.config/mc/mc.ext; \
-	{ \
-		echo 'default/*'; \
-		echo '    Open=file %f'; \
-		echo '    Edit=[ `du -m %f | { read size rest; echo $$size; }` -le 4 ] && e %f || echo Too large file for Emacs...'; \
-	} >>$(HOME)/.config/mc/mc.ext
+	cat .config/mc/mc.ext /etc/mc/mc.ext > $(HOME)/.config/mc/mc.ext
 ifneq '' '$(filter $(host_os),cygwin linux)'
 	if command -v file 1>/dev/null; then \
 		$(INSTALL_DATA) .magic $(HOME); \