From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#5475: Archives with filenames with square brackets Date: Thu, 04 Feb 2010 01:54:59 +0200 Organization: JURTA Message-ID: <873a1h52to.fsf@mail.jurta.org> References: <874omakv2m.fsf@mail.jurta.org> <87zl3uorzn.fsf@mail.jurta.org> <83zl3th9r4.fsf@gnu.org> <87aavtw8fs.fsf@mail.jurta.org> <83wrywhh3b.fsf@gnu.org> <87y6jc5uyu.fsf@mail.jurta.org> <87k4uw2ae2.fsf@mail.jurta.org> <874olzyx3l.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1265245092 21138 80.91.229.12 (4 Feb 2010 00:58:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Feb 2010 00:58:12 +0000 (UTC) Cc: 5475@debbugs.gnu.org To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 04 01:58:09 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ncq2q-0005ib-BM for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Feb 2010 01:58:08 +0100 Original-Received: from localhost ([127.0.0.1]:48484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ncq2p-0002XR-Km for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Feb 2010 19:58:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ncq2L-0002Nz-Bw for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2010 19:57:37 -0500 Original-Received: from [199.232.76.173] (port=47570 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ncq2K-0002Np-TY for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2010 19:57:36 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ncq2J-0003GX-Cj for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2010 19:57:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57850) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ncq2J-0003GR-5g for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2010 19:57:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NcpgU-0004QK-D8; Wed, 03 Feb 2010 19:35:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Feb 2010 00:35:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5475 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5475-submit@debbugs.gnu.org id=B5475.126524366016974 (code B ref 5475); Thu, 04 Feb 2010 00:35:02 +0000 Original-Received: (at 5475) by debbugs.gnu.org; 4 Feb 2010 00:34:20 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ncpfl-0004Pj-SO for submit@debbugs.gnu.org; Wed, 03 Feb 2010 19:34:20 -0500 Original-Received: from smtp-out4.starman.ee ([85.253.0.6] helo=mx2.starman.ee) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NcpfX-0004Ox-WD for 5475@debbugs.gnu.org; Wed, 03 Feb 2010 19:34:16 -0500 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.30.224.cable.starman.ee [82.131.30.224]) by mx2.starman.ee (Postfix) with ESMTP id 069AD3F4072; Thu, 4 Feb 2010 02:33:54 +0200 (EET) In-Reply-To: <874olzyx3l.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 03 Feb 2010 02:35:57 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 03 Feb 2010 19:35:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34889 Archived-At: > Until this option is implemented we should ignore stderr. Hmm, discarding stderr is too bad. Better would be to redirect stderr to a temporary file and display it when it contains error messages (a pending patch): === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2010-02-01 22:35:04 +0000 +++ lisp/arc-mode.el 2010-02-03 23:54:00 +0000 @@ -1076,11 +1099,11 @@ (defun archive-*-extract (archive name c (archive-delete-local tmpfile) success)) -(defun archive-extract-by-stdout (archive name command) +(defun archive-extract-by-stdout (archive name command &optional stderr-file) (apply 'call-process (car command) nil - t + (if stderr-file (list t stderr-file) t) nil (append (cdr command) (list archive name)))) @@ -1999,7 +2022,65 @@ (defun archive-rar-exe-extract (archive (if tmpbuf (kill-buffer tmpbuf)) (delete-file tmpfile)))) +(defun archive-7z-extract (archive name) + (let ((tmpfile (make-temp-file "7z-stderr"))) + ;; 7z doesn't provide a `quiet' option to suppress non-essential + ;; stderr messages. So redirect stderr to a temp file and display it + ;; in the echo area when it contains error messages. + (prog1 (archive-extract-by-stdout + archive name archive-7z-extract tmpfile) + (with-temp-buffer + (insert-file-contents tmpfile) + (unless (search-forward "Everything is Ok" nil t) + (message (buffer-string))) + (delete-file tmpfile))))) -- Juri Linkov http://www.jurta.org/emacs/