From 013a3ff09868130c26c4515e6a1f750a67fedfe7 Mon Sep 17 00:00:00 2001 From: "Sergey Y. Afonin" Date: Sun, 23 Sep 2012 10:34:11 +0400 Subject: [PATCH 01/15] Ticket #2897: a lot of updates of mc.ext and ext.d. Ticket #2893: add support of JNG and MNG images. Signed-off-by: Andrew Borodin --- misc/mc.ext.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc/mc.ext.in b/misc/mc.ext.in index 361d962ab..961273273 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -391,6 +391,12 @@ type/^PC\ bitmap type/^PNG Include=image +type/^JNG + Include=image + +type/^MNG + Include=image + type/^TIFF Include=image From 71ca307910c2294f07e5482217b2d59182d3a332 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 23 Sep 2012 10:48:04 +0400 Subject: [PATCH 02/15] Ticket #2894: add support of Gnumeric's spreadsheets. Signed-off-by: Andrew Borodin --- misc/ext.d/doc.sh.in | 3 +++ misc/mc.ext.in | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/misc/ext.d/doc.sh.in b/misc/ext.d/doc.sh.in index d59875332..5ad8228c2 100644 --- a/misc/ext.d/doc.sh.in +++ b/misc/ext.d/doc.sh.in @@ -108,6 +108,9 @@ do_open_action() { abw) (abiword "${MC_EXT_FILENAME}" &) ;; + gnumeric) + (gnumeric "${MC_EXT_FILENAME}" &) + ;; msdoc) if [ -n "$DISPLAY" ]; then (abiword "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) diff --git a/misc/mc.ext.in b/misc/mc.ext.in index 961273273..5f5121543 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -550,6 +550,10 @@ regex/i/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|o shell/.abw Open=@EXTHELPERSDIR@/doc.sh open abw +# Gnumeric +shell/i/.gnumeric + Open=@EXTHELPERSDIR@/doc.sh open gnumeric + # Microsoft Word Document regex/i/\.(do[ct]|wri)$ Open=@EXTHELPERSDIR@/doc.sh open msdoc From b3931a032e1ff22603ab494da7c9b2b786534891 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 13:18:49 +0300 Subject: [PATCH 03/15] Ticket #2892: mc.ext: expand support of file extentions for source files * Added support of .asm file extention * Added support of .hh file extention * All file extentions for source files now case insentetive. Signed-off-by: Slava Zanko --- misc/mc.ext.in | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/misc/mc.ext.in b/misc/mc.ext.in index 5f5121543..b3d3f3f18 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -278,24 +278,20 @@ type/^ASCII\ mail\ text ### Sources ### -# C -shell/.c +# C/C++ +regex/i/\.(c|cc|cpp)$ + Include=editor + +# C/C++ header +regex/i/\.(h|hh|hpp)$ Include=editor # Fortran -shell/.f +shell/i/.f Include=editor -# Header -regex/\.(h|hpp)$ - Include=editor - -# Asm -shell/.s - Include=editor - -# C++ -regex/\.(C|cc|cpp)$ +# Assembler +regex/i/\.(s|asm)$ Include=editor include/editor From 98a1acbf8e8bb29a04605294eb82322c414776fa Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 23 Sep 2012 10:43:40 +0400 Subject: [PATCH 04/15] Ticket #2891: add support of .war archives. Signed-off-by: Andrew Borodin --- misc/mc.ext.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/mc.ext.in b/misc/mc.ext.in index b3d3f3f18..21dc14231 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -117,8 +117,8 @@ regex/^\[git\] ### Archives ### -# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk -regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk|\.gem$ +# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk, .gem, .war +regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$|\.gem$|\.war$ Open=%cd %p/utar:// View=%view{ascii} @EXTHELPERSDIR@/archive.sh view tar.gz From 2120c32b5a86cb8ce5ffacc734db19fe7bdba8c8 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 13:12:55 +0300 Subject: [PATCH 05/15] Ticket #2890: make a choice between archivers for arj. Signed-off-by: Slava Zanko --- misc/ext.d/archive.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/ext.d/archive.sh b/misc/ext.d/archive.sh index 5423a954a..b338b99f0 100644 --- a/misc/ext.d/archive.sh +++ b/misc/ext.d/archive.sh @@ -59,7 +59,8 @@ do_view_action() { lha l "${MC_EXT_FILENAME}" ;; arj) - unarj l "${MC_EXT_FILENAME}" + arj l "${MC_EXT_FILENAME}" 2>/dev/null || \ + unarj l "${MC_EXT_FILENAME}" ;; cab) cabextract -l "${MC_EXT_FILENAME}" From d1779a895df9dabaa618a76de790d534e07c2cf3 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 8 Oct 2012 15:20:36 +0400 Subject: [PATCH 06/15] Ticket #2890: make a choice between archivers for 7z. Signed-off-by: Andrew Borodin --- misc/ext.d/archive.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/ext.d/archive.sh b/misc/ext.d/archive.sh index b338b99f0..0526f54bb 100644 --- a/misc/ext.d/archive.sh +++ b/misc/ext.d/archive.sh @@ -87,7 +87,9 @@ do_view_action() { cpio -itv < "${MC_EXT_FILENAME}" 2>/dev/null ;; 7z) - 7za l "${MC_EXT_FILENAME}" 2>/dev/null + 7za l "${MC_EXT_FILENAME}" 2>/dev/null || + 7z l "${MC_EXT_FILENAME}" + ;; ace) unace l "${MC_EXT_FILENAME}" From 30cdf01d05a19273f2d3330283bef7bc9fb45437 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 23 Sep 2012 10:53:32 +0400 Subject: [PATCH 07/15] Ticket #2895: add support of SVG images. Signed-off-by: Andrew Borodin --- misc/ext.d/image.sh | 3 +++ misc/mc.ext.in | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/misc/ext.d/image.sh b/misc/ext.d/image.sh index e09f92f9e..9c691e060 100644 --- a/misc/ext.d/image.sh +++ b/misc/ext.d/image.sh @@ -32,6 +32,9 @@ do_open_action() { xcf) (gimp "${MC_EXT_FILENAME}" &) ;; + svg) + (inkscape "${MC_EXT_FILENAME}" &) + ;; *) if [ -n "$DISPLAY" ]; then (gqview "${MC_EXT_FILENAME}" &) diff --git a/misc/mc.ext.in b/misc/mc.ext.in index 21dc14231..7968b91cd 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -421,6 +421,10 @@ shell/.xpm shell/.ico Include=image +shell/i/.svg + View=%view{ascii} @EXTHELPERSDIR@/image.sh view svg + Open=@EXTHELPERSDIR@/image.sh open svg + include/image Open=@EXTHELPERSDIR@/image.sh open ALL_FORMATS View=%view{ascii} @EXTHELPERSDIR@/image.sh view ALL_FORMATS From 5738b8d8638f89d04df6b6956ee9d93903c69197 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 13:02:40 +0300 Subject: [PATCH 08/15] Ticket #2767: mc.ext: add support of ape, aac and wvm4a formats. Signed-off-by: Slava Zanko --- misc/ext.d/video.sh | 3 ++- misc/mc.ext.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/ext.d/video.sh b/misc/ext.d/video.sh index bb89cee15..3fad53138 100644 --- a/misc/ext.d/video.sh +++ b/misc/ext.d/video.sh @@ -12,7 +12,8 @@ do_view_action() { case "${filetype}" in *) - cat "${MC_EXT_FILENAME}" + mplayer -identify -vo null -ao null -frames 0 "${MC_EXT_FILENAME}" 2>&1 | \ + sed -n 's/^ID_//p' ;; esac } diff --git a/misc/mc.ext.in b/misc/mc.ext.in index 7968b91cd..4dada15a9 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -432,7 +432,7 @@ include/image ### Sound files ### -regex/i/\.(wav|snd|voc|au|smp|aiff|snd|m4a)$ +regex/i/\.(wav|snd|voc|au|smp|aiff|snd|m4a|ape|aac|wvm4a)$ Open=@EXTHELPERSDIR@/sound.sh open common regex/i/\.(mod|s3m|xm|it|mtm|669|stm|ult|far)$ From fa3c7e71a8a988a0218acf5c437adc875eb46247 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 12:44:47 +0300 Subject: [PATCH 09/15] Ticket #2739: add support of comic books. Signed-off-by: Slava Zanko --- misc/ext.d/doc.sh.in | 3 +++ misc/mc.ext.in | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/misc/ext.d/doc.sh.in b/misc/ext.d/doc.sh.in index 5ad8228c2..f4afd1a78 100644 --- a/misc/ext.d/doc.sh.in +++ b/misc/ext.d/doc.sh.in @@ -155,6 +155,9 @@ do_open_action() { djvu) djview "${MC_EXT_FILENAME}" & ;; + comic) + cbrpager "${MC_EXT_FILENAME}" & + ;; *) ;; esac diff --git a/misc/mc.ext.in b/misc/mc.ext.in index 4dada15a9..d9e492e41 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -600,6 +600,10 @@ regex/i/\.djvu?$ Open=@EXTHELPERSDIR@/doc.sh open djvu View=%view{ascii} @EXTHELPERSDIR@/doc.sh view djvu +# Comic Books +regex/i/\.cb[zr]$ + Open=@EXTHELPERSDIR@/doc.sh open comic + ### Miscellaneous ### # Compiled Java classes From 72db2096914438c278afc7c88a80e3255504fc3e Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 12:48:15 +0300 Subject: [PATCH 10/15] Ticket #2739: add support of epub format. Signed-off-by: Slava Zanko --- misc/ext.d/doc.sh.in | 6 ++++++ misc/mc.ext.in | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/misc/ext.d/doc.sh.in b/misc/ext.d/doc.sh.in index f4afd1a78..851e3583a 100644 --- a/misc/ext.d/doc.sh.in +++ b/misc/ext.d/doc.sh.in @@ -69,6 +69,9 @@ do_view_action() { djvu) djvused -e print-pure-txt "${MC_EXT_FILENAME}" ;; + epub) + einfo -v "${MC_EXT_FILENAME}" + ;; *) ;; esac @@ -158,6 +161,9 @@ do_open_action() { comic) cbrpager "${MC_EXT_FILENAME}" & ;; + epub) + lucidor "${MC_EXT_FILENAME}" >/dev/null & + ;; *) ;; esac diff --git a/misc/mc.ext.in b/misc/mc.ext.in index d9e492e41..0229fcb80 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -604,6 +604,12 @@ regex/i/\.djvu?$ regex/i/\.cb[zr]$ Open=@EXTHELPERSDIR@/doc.sh open comic +# Epub +shell/i/.epub + Open=@EXTHELPERSDIR@/doc.sh open epub + View=%view{ascii} @EXTHELPERSDIR@/doc.sh view epub + + ### Miscellaneous ### # Compiled Java classes From c44aabebe79d2f279a715896c60822bf065c71f9 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 12:51:14 +0300 Subject: [PATCH 11/15] Ticket #2739: add support of PAR archives. Signed-off-by: Slava Zanko --- misc/ext.d/archive.sh | 3 +++ misc/mc.ext.in | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/misc/ext.d/archive.sh b/misc/ext.d/archive.sh index 0526f54bb..b533f0557 100644 --- a/misc/ext.d/archive.sh +++ b/misc/ext.d/archive.sh @@ -128,6 +128,9 @@ do_open_action() { xz) xz -dc "${MC_EXT_FILENAME}" | ${pager} ;; + par2) + par2 r "${MC_EXT_FILENAME}" + ;; *) ;; esac diff --git a/misc/mc.ext.in b/misc/mc.ext.in index 0229fcb80..c8661c803 100644 --- a/misc/mc.ext.in +++ b/misc/mc.ext.in @@ -726,6 +726,10 @@ regex/\.xz$ Open=@EXTHELPERSDIR@/archive.sh view xz %var{PAGER:more} View=%view{ascii} @EXTHELPERSDIR@/archive.sh view xz +# Parity Archive +type/^Parity\ Archive\ Volume\ Set + Open=@EXTHELPERSDIR@/archive.sh open par2 + ### Default ### # Default target for anything not described above From 246c072e249738db92e5ecf43d3baa25cf253b9f Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 11:30:01 +0300 Subject: [PATCH 12/15] Ticket #2723: use libreoffice instead of ooffice, if found. Signed-off-by: Slava Zanko --- misc/ext.d/doc.sh.in | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/misc/ext.d/doc.sh.in b/misc/ext.d/doc.sh.in index 851e3583a..deae24d8d 100644 --- a/misc/ext.d/doc.sh.in +++ b/misc/ext.d/doc.sh.in @@ -23,6 +23,12 @@ staroffice_console() { rm -rf "$tmp" } +get_ooffice_executable() { + which libreoffice >/dev/null 2>&1 && \ + echo "libreoffice" || \ + echo "ooffice" +} + do_view_action() { filetype=$1 @@ -99,9 +105,10 @@ do_open_action() { ;; ooffice) if [ -n "$DISPLAY" ]; then - (ooffice "${MC_EXT_FILENAME}" &) + OOFFICE=`get_ooffice_executable` + (${OOFFICE} "${MC_EXT_FILENAME}" &) else - if [ ` echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then + if [ `echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then staroffice_console "${MC_EXT_FILENAME}" else odt2txt "${MC_EXT_FILENAME}" | ${PAGER:-more} @@ -136,7 +143,8 @@ do_open_action() { ;; msppt) if [ -n "$DISPLAY" ]; then - (ooffice %f >/dev/null 2>&1 &) + OOFFICE=`get_ooffice_executable` + (${OOFFICE} %f >/dev/null 2>&1 &) else tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` ppthtml %f > "$tmp/page.html" From 1aa122b765180e728816240b5faf914649bcc409 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 10:50:13 +0300 Subject: [PATCH 13/15] Ticket #1686: use dvicat if dvi2tty not found Signed-off-by: Slava Zanko --- misc/ext.d/doc.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/ext.d/doc.sh.in b/misc/ext.d/doc.sh.in index deae24d8d..4d7a8579a 100644 --- a/misc/ext.d/doc.sh.in +++ b/misc/ext.d/doc.sh.in @@ -70,7 +70,9 @@ do_view_action() { strings "${MC_EXT_FILENAME}" ;; dvi) - dvi2tty "${MC_EXT_FILENAME}" + which dvi2tty >/dev/null 2>&1 && \ + dvi2tty "${MC_EXT_FILENAME}" || \ + catdvi "${MC_EXT_FILENAME}" ;; djvu) djvused -e print-pure-txt "${MC_EXT_FILENAME}" From 804ccfb467e2c477bcb45963dadc9b80b11c60e0 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 10:56:41 +0300 Subject: [PATCH 14/15] Ticket #1686: use 'see' utility as default pdf viewer when found Signed-off-by: Slava Zanko --- misc/ext.d/doc.sh.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/misc/ext.d/doc.sh.in b/misc/ext.d/doc.sh.in index 4d7a8579a..9fcf32b00 100644 --- a/misc/ext.d/doc.sh.in +++ b/misc/ext.d/doc.sh.in @@ -97,10 +97,12 @@ do_open_action() { fi ;; pdf) - if [ -n "$DISPLAY" ]; then - (xpdf "${MC_EXT_FILENAME}" &) - else + if [ ! -n "$DISPLAY" ]; then pdftotext -layout -nopgbrk "${MC_EXT_FILENAME}" - | ${PAGER:-more} + elif see > /dev/null 2>&1; then + (see "${MC_EXT_FILENAME}" &) + else + (xpdf "${MC_EXT_FILENAME}" &) fi #(acroread "${MC_EXT_FILENAME}" &) #(ghostview "${MC_EXT_FILENAME}" &) From 5082d01ebd2225c0eebbcc4cb10b316f6a591e15 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 5 Oct 2012 11:24:30 +0300 Subject: [PATCH 15/15] Ticket #1686: use 'see' utility for vieweing images Signed-off-by: Slava Zanko --- misc/ext.d/image.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/ext.d/image.sh b/misc/ext.d/image.sh index 9c691e060..21fc9ecf2 100644 --- a/misc/ext.d/image.sh +++ b/misc/ext.d/image.sh @@ -38,6 +38,8 @@ do_open_action() { *) if [ -n "$DISPLAY" ]; then (gqview "${MC_EXT_FILENAME}" &) + elif see >/dev/null 2>&1; then + (see "${MC_EXT_FILENAME}" &) else zgv "${MC_EXT_FILENAME}" fi