From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ioannis Kappas Newsgroups: gmane.emacs.bugs Subject: bug#49786: 28.0.50; [PATCH] package-install shouldn't change default-directory Date: Fri, 30 Jul 2021 21:50:13 +0100 Message-ID: References: <87h7gb39bt.fsf@dick> <83zgu3poh1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23092"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49786@debbugs.gnu.org, dick To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 30 22:51:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9ZTO-0005mv-Su for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Jul 2021 22:51:14 +0200 Original-Received: from localhost ([::1]:51244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9ZTN-00014H-RM for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Jul 2021 16:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9ZTC-00010m-Pm for bug-gnu-emacs@gnu.org; Fri, 30 Jul 2021 16:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9ZTC-0005H2-Gn for bug-gnu-emacs@gnu.org; Fri, 30 Jul 2021 16:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m9ZTC-0000sH-EH for bug-gnu-emacs@gnu.org; Fri, 30 Jul 2021 16:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ioannis Kappas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Jul 2021 20:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49786-submit@debbugs.gnu.org id=B49786.16276782313309 (code B ref 49786); Fri, 30 Jul 2021 20:51:02 +0000 Original-Received: (at 49786) by debbugs.gnu.org; 30 Jul 2021 20:50:31 +0000 Original-Received: from localhost ([127.0.0.1]:32807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9ZSh-0000rJ-83 for submit@debbugs.gnu.org; Fri, 30 Jul 2021 16:50:31 -0400 Original-Received: from mail-ot1-f44.google.com ([209.85.210.44]:34350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9ZSg-0000r4-1o for 49786@debbugs.gnu.org; Fri, 30 Jul 2021 16:50:30 -0400 Original-Received: by mail-ot1-f44.google.com with SMTP id 48-20020a9d0bb30000b02904cd671b911bso10905206oth.1 for <49786@debbugs.gnu.org>; Fri, 30 Jul 2021 13:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wSF5BjSpnB9FdNoc4SN56qLrnHhLlagytnwC6tZ+hA4=; b=PXoOhpBI5gBFL9rp/ClRDPw2q1vewloHay6eskhaVtoZBFPGH43/wjMsGuErhwbTJY F2GrMhzKlP/3csxrVT0OqEBNRax45SNBkDNUNnP0C8Srhi+kOcaqSyM/crOQj2htqWGg s1GTvtypsNe8Z1BVexC+sb0a4qfQxFxPZ3fb5EtEzsf9AjnzErEHkf9rEP0tph/h8tUc 9uun0w0Rz7R32IzJXBWdP62MqFgngDfyj+gto5Z9wsCMFIET4+O8bC2pgdAr/6rRb+Wf UN2gpiz1pJ+qO02RJu9rCVjkmQ6IVXb8ErXLt/f6M1mal5oaoYoS3OkhYBeOo8hVTL0D w9nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wSF5BjSpnB9FdNoc4SN56qLrnHhLlagytnwC6tZ+hA4=; b=JAUSIxgdvOueUfnoH2ont1YARX7balbdv4hFLGIj8JviYt8vjOyUtpT3+MPNoTy90Z nEYb9MCQDu3DC0/oRPhJrIpuVtU374Q2ni0JmtmtDw4N1+b8ok+4GvDagFuVgpJ74kk6 plR6891819aSCGdBS2ih44fWDEWDJVjeElxIuVHt8TR+bwrwm+r15Y6YV02JABs/1xNQ faOZVcCDmmv8duSrKohQERJeqeo0H8mHbl8/soZJ31Tt9zZYAiTHy1Z2ocptZqw5TzIj WWHGT3yU3cSSgRcn+/hm/nTuCh1/Mc2DG+Pd9Bgfa+0kgXMq9wxPQgGkZ8FZCddQ2oTN OxGg== X-Gm-Message-State: AOAM531YpEFIk+2K7+HHD7/ySTJ3bvmAPRoMycCm1t9VzuIg8bnp1Myo 09eZH2Z0ydUCKgH93G8iEv40SfPYXcOgNx4Rv64= X-Google-Smtp-Source: ABdhPJzoFmYJ+TmnuOAUz6T9ImJRk979m5Elef7BJ5gqQBEy/MvFMyHyRbsUtLubhSrHTs2CSyrFo2QHMiOLT3axqMY= X-Received: by 2002:a9d:6d8d:: with SMTP id x13mr3434901otp.192.1627678224414; Fri, 30 Jul 2021 13:50:24 -0700 (PDT) In-Reply-To: <83zgu3poh1.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210949 Archived-At: Hi On Fri, Jul 30, 2021 at 8:54 PM Eli Zaretskii wrote: > > > From: dick > > Date: Fri, 30 Jul 2021 15:12:06 -0400 > > > > Commit 606b783acb leverages a 2015 hack that extracts the > > package version from the buffer file name, only he has to > > explicitly `set-visited-file-name` to do it. > > > > `set-visited-file-name` has the adverse side effect of > > changing the default-directory, and that causes me problems. > > Ioannis, could you please tell why you needed to call > set-visited-file-name there? > We `set-visited-file-name' after we literally read the package into a buffer, so that we can extract the original filename in `package-install-from-buffer' with `buffer-file-name' and determine its original coding system with `find-operation-coding-system'. Once we determine the coding system, we can then decode the literal buffer and parse the package headers using the original encoding. Could you please elaborate a bit more what issue does this cause? thanks