From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#41821: 28.0.50; read-directory-name in vc commands should provide defaults from projects Date: Thu, 2 Jul 2020 17:39:25 +0300 Message-ID: <37dfad05-187b-8b14-a32f-b31df95da232@yandex.ru> References: <87r1ulxk48.fsf@mail.linkov.net> <87y2oh8fdv.fsf@mail.linkov.net> <87366ohw5z.fsf@mail.linkov.net> <878sge7jls.fsf@mail.linkov.net> <7e136435-7123-fa42-e4a8-66b82e6595da@yandex.ru> <87pn9pxris.fsf@mail.linkov.net> <83d05ottnw.fsf@gnu.org> <0b42f540-f779-446b-4411-8dae3a50d09d@yandex.ru> <837dvwtrv1.fsf@gnu.org> <835zbgtqps.fsf@gnu.org> <625de669-0715-1467-0bd1-84328b4bee5f@yandex.ru> <83wo3ws4g8.fsf@gnu.org> <83tuyzs2np.fsf@gnu.org> <87h7uuj1v3.fsf@mail.linkov.net> <87h7utjx75.fsf@mail.linkov.net> <3f9e85ba-66a9-abd0-61bf-800ea8bb4ee3@yandex.ru> <87y2o2c2l6.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24524"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: 41821@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 02 16:40:12 2020 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 1jr0No-0006Iw-99 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jul 2020 16:40:12 +0200 Original-Received: from localhost ([::1]:51590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jr0Nn-0004xs-8j for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jul 2020 10:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jr0Ne-0004wh-Sw for bug-gnu-emacs@gnu.org; Thu, 02 Jul 2020 10:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jr0Ne-0001S8-JQ for bug-gnu-emacs@gnu.org; Thu, 02 Jul 2020 10:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jr0Ne-0000hO-Fr for bug-gnu-emacs@gnu.org; Thu, 02 Jul 2020 10:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jul 2020 14:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41821 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 41821-submit@debbugs.gnu.org id=B41821.15937007762647 (code B ref 41821); Thu, 02 Jul 2020 14:40:02 +0000 Original-Received: (at 41821) by debbugs.gnu.org; 2 Jul 2020 14:39:36 +0000 Original-Received: from localhost ([127.0.0.1]:55493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jr0NE-0000gd-Bq for submit@debbugs.gnu.org; Thu, 02 Jul 2020 10:39:36 -0400 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:40916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jr0NC-0000gQ-8V for 41821@debbugs.gnu.org; Thu, 02 Jul 2020 10:39:35 -0400 Original-Received: by mail-wm1-f49.google.com with SMTP id f139so28261440wmf.5 for <41821@debbugs.gnu.org>; Thu, 02 Jul 2020 07:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VZFXJy/Ac9FO3i9NrvOtjSpjJ9kggR7ofJR74DK7b2Q=; b=la1yLF8EHwOmuyckTCfga08GgY0Ji2aDsbYajxwMFWusSf3fcTxJoUTVtfV4Tiu0Gl BaDzGF6x+RE6e8JcFthimrgLjFnUXUXlAYTerqh/92jHnuKI+q/Ee9QLD8/SoJ7qiH8G iPRAl8OVeRi+9RKkYxUGtWJCrUaLsJjzMdg/V9RyquNn9fnZd7b1mKXTNt6zj14wF6KW GimApUvQDLP67k3TrwcZOQqCGXidB4Lvau1ivqlMJLQMkSLIzGfHV3gsXl14dLnEvmLF stcLdAjGmOn3uxngeHNuje1XnVRalPuYWBN55lyXJWh4Uxge3McplanvXb16f5YcVU6I tJ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VZFXJy/Ac9FO3i9NrvOtjSpjJ9kggR7ofJR74DK7b2Q=; b=W46QNp/fMRLYxY4D6Onaq9RvEQ1UaoKFYubuMlPgZODSkyEJCTwnjV8Zl70vjc65Jw 3J6XNp8bIhj3b6fdiMPQ9al4sMvm1C/48b+gEuRKXR5pn8uL4Jme8/VQbT2DasmHEisR l3BIbkciOZkbIwTO0JpQCKxyvrr26VzoZ8j0Q9H2DzKYctTpBiolgQEL3MvnBoHho/LH tb4rnfTvxV8nIbgXqbQol9aVK2nX1hqNS7jRzlwfMb/c0oerqC4yewmn0kKEe+IdWcZJ rIR66INEdmnR++0dYkBDhEEcU7FIuPVg7zKYO2o4c7BSfFJK60Vp5XJbJkGzCkpcry6g eeag== X-Gm-Message-State: AOAM533bBG10+sEjA0a9eB1kt0ZpKdEbBJ8K2EWSaXlT4WteV2k8vu8s YcZ/40Ip2GJGTSlf3ZaX6T5Qk7lm X-Google-Smtp-Source: ABdhPJzDk7mMeyvxjtVyTLapT78hyy+0dq8U4lnFkTf1kAIGraz8pWsSdD0ExUTka+PihBZ/sWZzDQ== X-Received: by 2002:a05:600c:21ca:: with SMTP id x10mr31793756wmj.63.1593700767668; Thu, 02 Jul 2020 07:39:27 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id f14sm11967605wro.90.2020.07.02.07.39.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2020 07:39:26 -0700 (PDT) In-Reply-To: <87y2o2c2l6.fsf@mail.linkov.net> Content-Language: en-US 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:182635 Archived-At: On 02.07.2020 01:10, Juri Linkov wrote: >> we at least put this feature request on hold (and, for now, >> revert the installed patches). > > Ok, reverted the installed patches. > > It's easy to achieve the same in the init file with these > simple advises. Now this works perfectly from POV of users > who prefer to use project directories everywhere in all prompts > that ask for a directory: > > #+begin_src emacs-lisp > ;; When a prompt of some commands such as 'rgrep' or 'vc-print-log' asks for > ;; a directory name, allow 'M-n' to access the most recently used project > ;; directories saved in ~/.emacs.d/projects: > > (advice-add 'read-directory-name :around I figured you might want to define a vc-specific wrapper function for read-directory-name, for ease of advising. But now I'm not so sure. > (when (featurep 'project) > ;; Update project list with selected project dir > (let ((default-directory ret)) > (project-current t))) The 't' argument is counter-productive here. You don't want it to prompt, which will happen when the target directory is in the end outside of any detected projects. And really if you just do this in an ad-hoc advice (and recommend it to other users), it's probably better to just remove this call for simplicity. After all, you probably interact with "proper" project commands anyway. And they will put the current project at the top of the history.