GNU bug report logs - #63648
29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Mon, 22 May 2023 16:29:02 UTC

Severity: normal

Found in version 29.0.90

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Spencer Baugh <sbaugh <at> janestreet.com>, 63648 <at> debbugs.gnu.org
Subject: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands
Date: Fri, 02 Jun 2023 09:40:55 +0300
>>>> 1. the current buffer should remain the same for the next command;
>>>> 2. the buffer-local value of 'default-directory' should remain the same;
>>>> 3. the next command should have a new value of 'default-directory'.
>>>>
>>>> I see no way to satisfy all these requirements.
>>>
>>> Except adding a variable like 'project-current-directory-override'
>>> somewhere inside 'command_loop_1'.
>> And indeed with the following patch replacing the current definition of
>> 'project-switch-project' with just:
>>    (defun project-switch-project (dir)
>>      (interactive (list (funcall project-prompter)))
>>      (setq next-default-directory dir))
>
> Note that we'd need to keep the previous implementation for a number of
> years anyway, to retain compatibility with older emacsen.

Then some version-depending condition could be added.

>> 'C-x p p (select project ...) RET M-& pwd RET' confirms that
>> the command runs in the selected project directory.
>> Whereas the original buffer keeps its previous buffer-local value
>> of 'default-directory'.
>
> I suggest you bring up this feature addition on emacs-devel, or otherwise
> wait for a review from Eli, at least.
>
> It's not a big addition, but it's a distinct new feature (the
> next-default-directory var).

Indeed, such code addition better to be discussed on emacs-devel.
But first need to ensure that it works with 'C-x p p'.
Currently it works with keys from the global map such as
'C-x p p M-& pwd RET', but not with keys from 'project-prefix-map', e.g.
'C-x p p f'.  Maybe in addition to (setq next-default-directory dir)
also need to use 'set-transient-map' with 'project-prefix-map'.




This bug report was last modified 1 year and 200 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.