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


Message #125 received at 63648 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: sbaugh <at> catern.com, 63648 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map,
 switch-project errors on non-project commands
Date: Wed, 30 Aug 2023 01:32:42 +0300
On 30/08/2023 00:47, Spencer Baugh wrote:
> Nice!
> 
> One thing at least to make it not quite so bare-bones is:
> 
> (defun project-switch-project (dir)
>    (interactive (list (funcall project-prompter)))
>    (setq project--next-dd dir)
>    (advice-add 'command-execute :around #'project--with-next-dd)
>    (message "Run next command in project %s..." (project-name (project-current nil dir))))
> 
> which matches other-window-prefix.

Definitely an improvement, but still -- any such message is likely soon 
overridden by the prefix echo (e.g. "C-x p-").

> Will try running with this for a while and see how it goes.  (I'm
> already missing the short form of project-find-files, but maybe I'll get
> used to it... or maybe we should remap C-x C-f to project-find-files
> while in this prefix, or something wacky like that)

It could also use set-transient-map to set up a given map (e.g. one with 
the fast keys), and for the rest fall back to global commands. Note that 
our current project-switch-project impl could also be augmented to do that.

Anyway, please test it out and see how you like it, and whatever 
improvements come to mind. In either case, we can add a new command 
(rather than replacing project-switch-project). E.g. call it 
project-switch-for-next-command.




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.