From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Federico Tedin Newsgroups: gmane.emacs.bugs Subject: bug#35495: 27.0.50; Untarring an archive with a keyring.gpg inside Date: Fri, 10 May 2019 23:20:44 -0300 Message-ID: <87d0kp91fn.fsf@gmail.com> References: <87imuk4m7u.fsf@gmail.com> <871s179qsl.fsf@gmail.com> <87tve196pi.fsf@gmail.com> <87mujt9368.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="172932"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35495@debbugs.gnu.org, Daiki Ueno To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 11 04:21:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hPHdQ-000ilo-EX for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 May 2019 04:21:12 +0200 Original-Received: from localhost ([127.0.0.1]:52740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPHdP-0001If-Dd for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 May 2019 22:21:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPHdH-0001Fr-Sv for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 22:21:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPHdG-0001v2-W2 for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 22:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54241) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPHdG-0001uq-OB for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 22:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hPHdG-0004CY-E2 for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 22:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 May 2019 02:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35495 X-GNU-PR-Package: emacs Original-Received: via spool by 35495-submit@debbugs.gnu.org id=B35495.155754125516127 (code B ref 35495); Sat, 11 May 2019 02:21:02 +0000 Original-Received: (at 35495) by debbugs.gnu.org; 11 May 2019 02:20:55 +0000 Original-Received: from localhost ([127.0.0.1]:39550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPHd9-0004C3-IB for submit@debbugs.gnu.org; Fri, 10 May 2019 22:20:55 -0400 Original-Received: from mail-qk1-f170.google.com ([209.85.222.170]:41651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPHd8-0004Br-9o for 35495@debbugs.gnu.org; Fri, 10 May 2019 22:20:54 -0400 Original-Received: by mail-qk1-f170.google.com with SMTP id g190so2771254qkf.8 for <35495@debbugs.gnu.org>; Fri, 10 May 2019 19:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=3udSzVPUcFtyssG6ADQP+mFKgqOxgHQxAuhlKz0YzRY=; b=svaWbUmzfOUm4MI2if7OHoNkhxac9/Dy9HTrmN5uuOr1jhoIuJPLL3WUORzBiH2DZn s/XnA4PSRk8neR6rPLnWSyqEGxHuCAHF1ZVcKTt0QwEcX4cCbUTXpVBGFct8oRIuVS3L gyzfcOABwGWuviGRdyXeigM6wOi3BQaC8jHMTjRyNwT1mmnYhybFQdOWI3qXwCGLCoB1 Ntsq4j+ZoMPi0BvHvDB6a6rRKLUkBa8mDwJkG9LThcOHURoznu8eKK/+DKAaFeymikOR OvpzYjBam9tza2PxxQmJYrGLgaoMvjeS5XjbzLsCd9lpZ0Zi2sNWd1kJTKfQ/osWmO7V jRrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=3udSzVPUcFtyssG6ADQP+mFKgqOxgHQxAuhlKz0YzRY=; b=MpsXM4rYtgz6yvib6vlzBHEEjizqhnoYbHaaNsoqJvWvwgP+GGs5vgoIu9QT8o484i H816R4QSbmOJ6Pr6SaBR9pAKuA8HburiTnNdjn4m4VoKjRDe9R3xfGTRoKsUmoFgty9e ++x5Id6JLauqiDyrCmkO4QrCeFYnOPQQRD7FrJ2ksuho9IvG0+3EHOjMbKRUpxCBG3gl JIIkvy/TliuJklDVi90KFAvCoiE5tCk1RqS7XaKwdgpCxMrvo+qFrYMI2aB/CYZO0LZQ cmvlXY+i5QA+cohl5lFimx/KhEmTAMSbKwqyuxQCBDBGWnbcxpl0ay7d//QqUkqSmiPl qb1A== X-Gm-Message-State: APjAAAVA97eHQKS9PUUB0B7ww51JJ8wUnqYocMba/CBMntXho8qBmdlv tr7f5Tf2dRaTGod1ufwnBkM= X-Google-Smtp-Source: APXvYqzEdnKz1pcVbaY74CNkVslI9hEjZaVJ0SHLazFLcweWuHc43iNHguFHRY9Jc5z760IsASbn9w== X-Received: by 2002:a37:a5d3:: with SMTP id o202mr12264852qke.301.1557541247743; Fri, 10 May 2019 19:20:47 -0700 (PDT) Original-Received: from hideo ([181.170.211.157]) by smtp.gmail.com with ESMTPSA id k127sm3666111qkb.96.2019.05.10.19.20.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 May 2019 19:20:46 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Fri, 10 May 2019 21:54:03 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159064 Archived-At: Stefan Monnier writes: >> I realize that in this case I'm hard-coding the specific >> file name handlers that *can* be used. > > Exactly, it's no better. > >> I'm not sure how to express "only use these file handlers" without >> explicitly mentioning them. > > Instead, you should state the property you want, and then let each > file-name-handler decide how to handle that property. E.g.: > > (let ((write-region-provides-raw-file-contents t)) > (write-region ...)) > > Of course, the problem here is that by using dynamic scoping, this var > will affect all write-regions that will take place during this call, > which might lead to more problems. I see, I hadn't realized that tar-mode still used dynamic scoping (I imagine converting it to lexical is a lot of work). > Maybe it would be better to have it as an argument to `write-region`, or > to introduce a new function? > > Or maybe, not use `write-region` but `copy-file` instead (which already > provides the expected semantics (i.e. it doesn't (un)compress or > (en/de)crypt, IIUC). It looks like `copy-file` only deals with files and not buffers, so we would need to find a way to use it from tar-mode. Looking at the source in fileio.c, it also seems like it uses `find-file-name-handler` for `FILE` or `NEWNAME`, so it's possible it won't be useful for us. If we added a new argument to `write-region` like you mentioned, say `RAW`, could we then use symbol properties to decide whether the found file name handler can be used or not? Like so: (put 'jka-compr-handler 'provides-raw-file-contents nil) (put 'epa-file-handler 'provides-raw-file-contents nil) (put 'tramp-file-name-handler 'provides-raw-file-contents t) (put 'tramp-completion-file-name-handler 'provides-raw-file-contents t) (put 'file-name-non-special 'provides-raw-file-contents t) The downside being that anyone adding a new file name handler must remember to set the property to t if needed.