From unknown Sun Jun 22 22:42:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#63648 <63648@debbugs.gnu.org> To: bug#63648 <63648@debbugs.gnu.org> Subject: Status: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Reply-To: bug#63648 <63648@debbugs.gnu.org> Date: Mon, 23 Jun 2025 05:42:21 +0000 retitle 63648 29.0.90; project.el: with switch-use-entire-map, switch-proje= ct errors on non-project commands reassign 63648 emacs submitter 63648 Spencer Baugh severity 63648 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon May 22 12:28:02 2023 Received: (at submit) by debbugs.gnu.org; 22 May 2023 16:28:02 +0000 Received: from localhost ([127.0.0.1]:36092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q18O8-0000cH-JY for submit@debbugs.gnu.org; Mon, 22 May 2023 12:28:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:51594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q18O5-0000c8-6o for submit@debbugs.gnu.org; Mon, 22 May 2023 12:27:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q18O4-0006O0-Pf for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 12:27:56 -0400 Received: from mxout6.mail.janestreet.com ([64.215.233.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q18O1-00061D-I5 for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 12:27:56 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Date: Mon, 22 May 2023 12:27:50 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.215.233.21; envelope-from=sbaugh@janestreet.com; helo=mxout6.mail.janestreet.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 1. (setq project-switch-use-entire-map t) 2. C-x p p some/project RET 3. At the prompt, C-x C-j 4. Errors with: project-switch-project: Wrong type argument: commandp, 1 Desired behavior: commands should run with default-directory of the project-root. So C-x C-j should open dired in the project root. I specifically ran into this when doing C-x p p some/project RET C-x v + because I wanted to immediately pull that project. Intuitively it made sense to me that that should work, it would be nice if it did actually work. (Tangential further thought: I wonder if we could make C-x p work as a prefix for all commands automatically, so for example C-x p C-x C-j would open the project root, C-x p M-& would run a shell command in the root, etc. That would be neat.) In GNU Emacs 29.0.90 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-05-17 built on igm-qws-u22796a Repository revision: 4d08492296c2a6d2910f2b740c2d2508275458fc Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: CentOS Linux 7 (Core) Configured using: 'configure --with-x-toolkit=lucid --with-gif=ifavailable' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Messages Minor modes in effect: jane-fe-minor-mode: t editorconfig-mode: t which-function-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t windmove-mode: t savehist-mode: t save-place-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/project hides /home/sbaugh/.emacs.d/elpa/project-0.9.8/project /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/xref hides /home/sbaugh/.emacs.d/elpa/xref-1.6.3/xref /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/csharp-mode hides /home/sbaugh/src/emacs/emacs-29/lisp/progmodes/csharp-mode /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/xref hides /home/sbaugh/src/emacs/emacs-29/lisp/progmodes/xref /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/project hides /home/sbaugh/src/emacs/emacs-29/lisp/progmodes/project /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/eldoc hides /home/sbaugh/src/emacs/emacs-29/lisp/emacs-lisp/eldoc /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/auctex/lpath hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dictionary/lpath /home/sbaugh/src/emacs/emacs-29/lisp/net/dictionary hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dictionary/dictionary /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/caml-font hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/ocaml/caml-font /home/sbaugh/src/emacs/emacs-29/lisp/org/org-version hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-version /home/sbaugh/src/emacs/emacs-29/lisp/org/org-loaddefs hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-loaddefs /home/sbaugh/src/emacs/emacs-29/lisp/org/org-keys hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-keys /home/sbaugh/src/emacs/emacs-29/lisp/org/ol hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-perl hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-perl /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-core hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-core /home/sbaugh/src/emacs/emacs-29/lisp/org/ox hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-rmail hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-rmail /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-octave hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-octave /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-comint hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-comint /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-w3m hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-w3m /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-org /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-texinfo hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-texinfo /home/sbaugh/src/emacs/emacs-29/lisp/org/org-inlinetask hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-inlinetask /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-mhe hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-mhe /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ocaml hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ocaml /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-clojure hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-clojure /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-publish hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-publish /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-irc hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-irc /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-calc hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-calc /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-odt hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-odt /home/sbaugh/src/emacs/emacs-29/lisp/org/org-id hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-id /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-gnus hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-gnus /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-matlab hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-matlab /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-icalendar hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-icalendar /home/sbaugh/src/emacs/emacs-29/lisp/org/org-footnote hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-footnote /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-bibtex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-bibtex /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lisp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lisp /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-C hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-C /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-org /home/sbaugh/src/emacs/emacs-29/lisp/org/org-indent hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-indent /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-info hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-info /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-maxima hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-maxima /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-awk hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-awk /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-man hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-man /home/sbaugh/src/emacs/emacs-29/lisp/org/org-goto hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-goto /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-md hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-md /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-eshell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-eshell /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lua hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lua /home/sbaugh/src/emacs/emacs-29/lisp/org/org-habit hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-habit /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-R hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-R /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-eww hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-eww /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-makefile hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-makefile /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-latex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-latex /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-docview hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-docview /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lob hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lob /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-beamer hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-beamer /home/sbaugh/src/emacs/emacs-29/lisp/org/org-faces hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-faces /home/sbaugh/src/emacs/emacs-29/lisp/org/ob hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-html hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-html /home/sbaugh/src/emacs/emacs-29/lisp/org/org-feed hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-feed /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-bbdb hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-bbdb /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lilypond hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lilypond /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-ascii hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-ascii /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-latex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-latex /home/sbaugh/src/emacs/emacs-29/lisp/org/org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-tangle hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-tangle /home/sbaugh/src/emacs/emacs-29/lisp/org/org-tempo hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-tempo /home/sbaugh/src/emacs/emacs-29/lisp/org/org-duration hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-duration /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sqlite hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sqlite /home/sbaugh/src/emacs/emacs-29/lisp/org/org-entities hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-entities /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-table hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-table /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-js hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-js /home/sbaugh/src/emacs/emacs-29/lisp/org/org-table hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-table /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sql hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sql /home/sbaugh/src/emacs/emacs-29/lisp/org/org-timer hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-timer /home/sbaugh/src/emacs/emacs-29/lisp/org/org-element hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-element /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-java hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-java /home/sbaugh/src/emacs/emacs-29/lisp/org/org-ctags hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-ctags /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-shell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-shell /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-groovy hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-groovy /home/sbaugh/src/emacs/emacs-29/lisp/org/org-src hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-src /home/sbaugh/src/emacs/emacs-29/lisp/org/org-datetree hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-datetree /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-haskell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-haskell /home/sbaugh/src/emacs/emacs-29/lisp/org/org-plot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-plot /home/sbaugh/src/emacs/emacs-29/lisp/org/org-compat hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-compat /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-screen hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-screen /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-fortran hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-fortran /home/sbaugh/src/emacs/emacs-29/lisp/org/org-protocol hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-protocol /home/sbaugh/src/emacs/emacs-29/lisp/org/org-crypt hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-crypt /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sed hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sed /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-gnuplot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-gnuplot /home/sbaugh/src/emacs/emacs-29/lisp/org/org-pcomplete hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-pcomplete /home/sbaugh/src/emacs/emacs-29/lisp/org/org-colview hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-colview /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-scheme hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-scheme /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-forth hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-forth /home/sbaugh/src/emacs/emacs-29/lisp/org/org-num hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-num /home/sbaugh/src/emacs/emacs-29/lisp/org/org-clock hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-clock /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-exp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-exp /home/sbaugh/src/emacs/emacs-29/lisp/org/org-mouse hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-mouse /home/sbaugh/src/emacs/emacs-29/lisp/org/org-capture hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-capture /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sass hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sass /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-eval hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-eval /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ref hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ref /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-emacs-lisp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-emacs-lisp /home/sbaugh/src/emacs/emacs-29/lisp/org/org-mobile hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-mobile /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ruby hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ruby /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-eshell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-eshell /home/sbaugh/src/emacs/emacs-29/lisp/org/org-lint hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-lint /home/sbaugh/src/emacs/emacs-29/lisp/org/org-agenda hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-agenda /home/sbaugh/src/emacs/emacs-29/lisp/org/org-macro hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-macro /home/sbaugh/src/emacs/emacs-29/lisp/org/org-attach-git hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-attach-git /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-processing hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-processing /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-css hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-css /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-dot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-dot /home/sbaugh/src/emacs/emacs-29/lisp/org/org-list hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-list /home/sbaugh/src/emacs/emacs-29/lisp/org/org-macs hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-macs /home/sbaugh/src/emacs/emacs-29/lisp/org/org-attach hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-attach /home/sbaugh/src/emacs/emacs-29/lisp/org/org-archive hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-archive /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-python hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-python /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-plantuml hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-plantuml /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ditaa hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ditaa /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-julia hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ob-julia /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-man hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ol-man /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-koma-letter hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ox-koma-letter /home/sbaugh/.emacs.d/elpa/dash-2.19.1/dash hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dash/dash /home/sbaugh/.emacs.d/elpa/dash-2.19.1/dash-functional hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dash/dash-functional Features: (shadow sort mail-extr emacsbug cl-print cus-start cal-iso org-datetree dired-aux vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util pulse shortdoc help-fns radix-tree misearch multi-isearch tabify org-capture sh-script treesit grep find-dired executable vc-fe org-element org-persist org-id org-refile avl-tree generator oc-basic ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi goto-addr cus-edit cus-load wid-edit vc-hg vc-dir vc vc-dispatcher tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time iso8601 ls-lisp jane-project ffap jane-merlin merlin-imenu merlin-xref merlin-cap merlin jane-async-merlin jane-completion jane-common jane-fe-project xref jane-fe-menu ecaml_plugin linum view gopcaml magit-bookmark bookmark image+ advice image-file image-converter editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch whitespace jane-auto-modes vba-mode markdown-mode color jane jane-micro-features jane-diff unified-test-mode shell-file core core-buffer core-error core-util ert pp ewoc debug backtrace jane-sexp jane-ocaml jane-tuareg-theme tuareg tuareg-compat tuareg-opam skeleton flymake-proc flymake warnings thingatpt smie caml-types caml-help caml-emacs find-file compile jane-cr jane-align jane-deprecated jane-smerge gnu-elpa-keyring-update jane-ocp-indent ocp-indent cl jane-util ob-shell page-ext dired-x magit-extras project magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode git-commit log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell server magit-mode transient edmacro kmacro magit-git magit-section magit-utils crm dash cl-extra help-mode windmove org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities time-date noutline outline icons ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs format-spec gdb-mi bindat gud comint easy-mmode files-x derived ansi-osc ansi-color ring vundo pcase cyberpunk-theme savehist saveplace project-autoloads vundo-autoloads magit-autoloads xref-autoloads csv-mode-autoloads magit-section-autoloads cyberpunk-theme-autoloads url-http-ntlm-autoloads url-auth git-commit-autoloads with-editor-autoloads finder-inf info dash-autoloads vc-hgcmd-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 650875 91874) (symbols 48 45890 12) (strings 32 164696 16344) (string-bytes 1 5817957) (vectors 16 83175) (vector-slots 8 1714092 170471) (floats 8 577 249) (intervals 56 9811 200) (buffers 976 43) (heap 1024 690393 127136)) From debbugs-submit-bounces@debbugs.gnu.org Mon May 22 13:53:00 2023 Received: (at 63648) by debbugs.gnu.org; 22 May 2023 17:53:00 +0000 Received: from localhost ([127.0.0.1]:36320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q19iO-0003MF-2o for submit@debbugs.gnu.org; Mon, 22 May 2023 13:53:00 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:33969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q19iK-0003Lk-4J for 63648@debbugs.gnu.org; Mon, 22 May 2023 13:52:57 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 1682E60005; Mon, 22 May 2023 17:52:48 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Mon, 22 May 2023 12:27:50 -0400") Organization: LINKOV.NET References: Date: Mon, 22 May 2023 20:51:14 +0300 Message-ID: <86wn10e1wl.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 1. (setq project-switch-use-entire-map t) > 2. C-x p p some/project RET > 3. At the prompt, C-x C-j > 4. Errors with: > project-switch-project: Wrong type argument: commandp, 1 > > Desired behavior: commands should run with default-directory of the > project-root. So C-x C-j should open dired in the project root. > > I specifically ran into this when doing > C-x p p some/project RET C-x v + > > because I wanted to immediately pull that project. Intuitively it made > sense to me that that should work, it would be nice if it did actually > work. This should be possible to implement by using 'set-transient-map'. > (Tangential further thought: I wonder if we could make C-x p work as a > prefix for all commands automatically, so for example C-x p C-x C-j > would open the project root, C-x p M-& would run a shell command in the > root, etc. That would be neat.) IOW, like 'C-x p p' but without asking for another project. Doable as well. From debbugs-submit-bounces@debbugs.gnu.org Tue May 23 21:14:14 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 01:14:14 +0000 Received: from localhost ([127.0.0.1]:40706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1d4w-00018T-A5 for submit@debbugs.gnu.org; Tue, 23 May 2023 21:14:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:41303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1d4v-00018G-8t for 63648@debbugs.gnu.org; Tue, 23 May 2023 21:14:13 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2811F5C00F9; Tue, 23 May 2023 21:14:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 23 May 2023 21:14:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1684890848; x=1684977248; bh=5BUYO3tSDexgpcSf2riTBqgc71epbiHuRvA 7vMuCrko=; b=efRS01dUwEZ9ZU8HoKBH3/zr2UVGKACr8Oh2WyomV9ri8NL6TVf IOOvi4ZDnTPYbeCs2GYilbTMXN4x4HoVBTTTHsUC5wgzyeslkV4lSswwfBbxyfGu dVX3jgVm/oFn9A69ozTxdG9yYO/pSHVHKWgaZ4PqdJhviY+JKtVmJndDx+2Q5J3Y mP5IRxLDvvmzxB4nHOlod7sxZuVyQBGlknBmQeZxueCq7PYXiKenV+Aw6trQ5pPr lEqB+g3WedSWLlLTtG5UvxNLBu2vlBf5fuDeDf7NnX1T8uqvx/U6rGbAOrYhMaM7 4Go2ygKO5T3+tN0fPf8gzEy0lt4lWy7I9yg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684890848; x=1684977248; bh=5BUYO3tSDexgpcSf2riTBqgc71epbiHuRvA 7vMuCrko=; b=U40nSq9e7nyJkmQh0qigHITlQum0V1C53qMNEqsInpPwSMUl5Yp yqDYhC4bjL1zHgeeR6IZ/2t/d3l3o17aZKBIlccwOqKgnO3B1Hg6Ib5BAGTGGaef wteM/TpDtsnIpB7jCYoTKauZNptTzTWFSlohgvdFJkheAoSs9CUSMHyQEmZIp3AT I/V58nwkEyFNPN4FGAyhonnpiPBK7APtzsdoLUAxczk0cwBJ1nNX6QW7h98cC3ex 686LeeTwLK9Fsd2dRNTR7vij6af+wE3q6RgtwVD+gvCPwOv46ePrezUOEl1Yf7XO jq46UgY6bTXh6KbUDxuzrJiDZuRmV6vAlNg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejgedggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 May 2023 21:14:06 -0400 (EDT) Message-ID: <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> Date: Wed, 24 May 2023 04:14:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov , Spencer Baugh References: <86wn10e1wl.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86wn10e1wl.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On 22/05/2023 20:51, Juri Linkov wrote: >> 1. (setq project-switch-use-entire-map t) >> 2. C-x p p some/project RET >> 3. At the prompt, C-x C-j >> 4. Errors with: >> project-switch-project: Wrong type argument: commandp, 1 >> >> Desired behavior: commands should run with default-directory of the >> project-root. So C-x C-j should open dired in the project root. >> >> I specifically ran into this when doing >> C-x p p some/project RET C-x v + >> >> because I wanted to immediately pull that project. Intuitively it made >> sense to me that that should work, it would be nice if it did actually >> work. > This should be possible to implement by using 'set-transient-map'. > >> (Tangential further thought: I wonder if we could make C-x p work as a >> prefix for all commands automatically, so for example C-x p C-x C-j >> would open the project root, C-x p M-& would run a shell command in the >> root, etc. That would be neat.) > IOW, like 'C-x p p' but without asking for another project. Doable as well. That sounds like a cool potential addition, just we all need to keep in mind that not every command will be 100% compatible with the approach. One example is the bug#58784 where changing default-directory made project-switch-to-buffer behave incorrectly. Maybe there are some less subtle examples as well. From debbugs-submit-bounces@debbugs.gnu.org Wed May 24 02:33:20 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 06:33:20 +0000 Received: from localhost ([127.0.0.1]:40991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1i3h-0004Cc-2D for submit@debbugs.gnu.org; Wed, 24 May 2023 02:33:20 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:33007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1i3f-0004CO-5m for 63648@debbugs.gnu.org; Wed, 24 May 2023 02:33:15 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A95D11BF20A; Wed, 24 May 2023 06:33:07 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> (Dmitry Gutov's message of "Wed, 24 May 2023 04:14:05 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> Date: Wed, 24 May 2023 09:20:28 +0300 Message-ID: <86jzwyxnxb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> C-x p p some/project RET C-x v + >>> >>> because I wanted to immediately pull that project. Intuitively it made >>> sense to me that that should work, it would be nice if it did actually >>> work. >> This should be possible to implement by using 'set-transient-map'. >> >>> (Tangential further thought: I wonder if we could make C-x p work as a >>> prefix for all commands automatically, so for example C-x p C-x C-j >>> would open the project root, C-x p M-& would run a shell command in the >>> root, etc. That would be neat.) >> IOW, like 'C-x p p' but without asking for another project. Doable as well. > > That sounds like a cool potential addition, just we all need to keep in > mind that not every command will be 100% compatible with the approach. Why not every command? For example, 100% commands are compatible with 'C-x t t.' > One example is the bug#58784 where changing default-directory made > project-switch-to-buffer behave incorrectly. Maybe there are some less > subtle examples as well. 'display-buffer-override-next-command' already solved these problems. So a similar function could remember 'project-current-directory-override' for the next command. From debbugs-submit-bounces@debbugs.gnu.org Wed May 24 10:55:17 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 14:55:17 +0000 Received: from localhost ([127.0.0.1]:44367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1ptU-0004Lf-TL for submit@debbugs.gnu.org; Wed, 24 May 2023 10:55:17 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:46305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1ptT-0004LP-5z for 63648@debbugs.gnu.org; Wed, 24 May 2023 10:55:15 -0400 From: Spencer Baugh To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86wn10e1wl.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 22 May 2023 20:51:14 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> Date: Wed, 24 May 2023 10:55:09 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> (Tangential further thought: I wonder if we could make C-x p work as a >> prefix for all commands automatically, so for example C-x p C-x C-j >> would open the project root, C-x p M-& would run a shell command in the >> root, etc. That would be neat.) > > IOW, like 'C-x p p' but without asking for another project. Doable as well. I'm curious, how are you thinking this would be implemented? My thought was that C-x p would act as a prefix for any key sequence in this way, *but* also C-x p c and the other things currently in project-prefix-map would still be explicitly bound, so they can be looked up with describe-key. And also, C-x p C-h should still run describe-prefix-bindings. I don't know how one would achieve this... From debbugs-submit-bounces@debbugs.gnu.org Wed May 24 11:46:55 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 15:46:55 +0000 Received: from localhost ([127.0.0.1]:44450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1qhS-0005r7-UE for submit@debbugs.gnu.org; Wed, 24 May 2023 11:46:55 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:42525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1qhP-0005qr-FA for 63648@debbugs.gnu.org; Wed, 24 May 2023 11:46:53 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7E1303200B8C; Wed, 24 May 2023 11:46:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 24 May 2023 11:46:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1684943205; x=1685029605; bh=q0E4ZJYBXV2/zleHL8YciSwuld8A7US+0bA 08JUfZ3Q=; b=wS0hIE54pjgFEfiHnkhCFY5nov4/l4kak++7UTx+KC0N5nOEv34 +HZZgljfHotEMmUhhUMOHrAdPIzeyPbrV6zHXZ/AjlbYkDj625gIhHKoVDm/NVeS Nm6o6B8sQ11CRmNRk/ScZOnIUOMLk8ABFwxd+7k0aTlLucaNYOxHtppz/ZVuKcem 7mYIFYYOf2P9SyioPobFI+PEqX8AmWvzqniJ2oKApGk8/m1hQf1zJA9hzFal8hr1 +h3BjF+dqg33T+bnvym1tuesWtTYY+Jd0FRIqf2NpbMA85W+WRR5g21yt8gLcL5h znCP7gwsn+X0g0RYxsoF1QY7JCEWDG8/kvA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684943205; x=1685029605; bh=q0E4ZJYBXV2/zleHL8YciSwuld8A7US+0bA 08JUfZ3Q=; b=sY01+f2LmflbYyIxGlfKui8i/uRTLk7s3sJUvTApssaebB+qrMe WPm6kv2t4HZnRIw0QX0Qj2CKUydA4Bsg7Y47rksYFfUF7dk8UO4HD2BPvOGwxL8L SMIpdhXgRuMYBTmAAM+BU1usVCQ+uH9c6+3MZuOJwdPH2Hf+E1DXVnx03m8ehFHb rwOtYJjjOdlGForSGiiMxfBGBbJV0FOlIf6j5Ncso13TLcJgHeBlj7zueBjaCbGW hacNizuvrhJTHhQbuU+VL6lY03ualazTOIQPjVfmEHmv9Pcs8ZXzfB3W53HzzIgD KycOGimd7cULOOUdkrbb/wjoZLN9A0JVh8g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejhedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 May 2023 11:46:43 -0400 (EDT) Message-ID: Date: Wed, 24 May 2023 18:46:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86jzwyxnxb.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) On 24/05/2023 09:20, Juri Linkov wrote: >>>> C-x p p some/project RET C-x v + >>>> >>>> because I wanted to immediately pull that project. Intuitively it made >>>> sense to me that that should work, it would be nice if it did actually >>>> work. >>> This should be possible to implement by using 'set-transient-map'. >>> >>>> (Tangential further thought: I wonder if we could make C-x p work as a >>>> prefix for all commands automatically, so for example C-x p C-x C-j >>>> would open the project root, C-x p M-& would run a shell command in the >>>> root, etc. That would be neat.) >>> IOW, like 'C-x p p' but without asking for another project. Doable as well. >> >> That sounds like a cool potential addition, just we all need to keep in >> mind that not every command will be 100% compatible with the approach. > > Why not every command? For example, 100% commands are compatible with > 'C-x t t.' > >> One example is the bug#58784 where changing default-directory made >> project-switch-to-buffer behave incorrectly. Maybe there are some less >> subtle examples as well. > > 'display-buffer-override-next-command' already solved these problems. > So a similar function could remember 'project-current-directory-override' > for the next command. But we were talking about "regular" commands, right? Those don't know anything about project-current-directory-override. So we'd bind default-directory, and that's where the problem could come from. Hopefully, only in rare cases, though. From debbugs-submit-bounces@debbugs.gnu.org Wed May 24 12:32:04 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 16:32:05 +0000 Received: from localhost ([127.0.0.1]:44653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1rPA-0007Fp-GS for submit@debbugs.gnu.org; Wed, 24 May 2023 12:32:04 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:44207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1rP5-0007EL-G6 for 63648@debbugs.gnu.org; Wed, 24 May 2023 12:32:03 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 4A73F20004; Wed, 24 May 2023 16:31:51 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Wed, 24 May 2023 18:46:41 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> Date: Wed, 24 May 2023 19:20:21 +0300 Message-ID: <86o7m91z22.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>>> C-x p p some/project RET C-x v + >>>>> >>>>> because I wanted to immediately pull that project. Intuitively it made >>>>> sense to me that that should work, it would be nice if it did actually >>>>> work. >>>> This should be possible to implement by using 'set-transient-map'. >>>> >>>>> (Tangential further thought: I wonder if we could make C-x p work as a >>>>> prefix for all commands automatically, so for example C-x p C-x C-j >>>>> would open the project root, C-x p M-& would run a shell command in the >>>>> root, etc. That would be neat.) >>>> IOW, like 'C-x p p' but without asking for another project. Doable as well. >>> >>> That sounds like a cool potential addition, just we all need to keep in >>> mind that not every command will be 100% compatible with the approach. >> Why not every command? For example, 100% commands are compatible with >> 'C-x t t.' >> >>> One example is the bug#58784 where changing default-directory made >>> project-switch-to-buffer behave incorrectly. Maybe there are some less >>> subtle examples as well. >> 'display-buffer-override-next-command' already solved these problems. >> So a similar function could remember 'project-current-directory-override' >> for the next command. > > But we were talking about "regular" commands, right? Those don't know > anything about project-current-directory-override. Any command indeed. They should use the temporarily set default-directory. > So we'd bind default-directory, and that's where the problem could come > from. Hopefully, only in rare cases, though. Naturally, this needs more testing. From debbugs-submit-bounces@debbugs.gnu.org Wed May 24 12:32:05 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 16:32:05 +0000 Received: from localhost ([127.0.0.1]:44655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1rPA-0007Fr-U8 for submit@debbugs.gnu.org; Wed, 24 May 2023 12:32:05 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:50865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1rP8-0007EW-PO for 63648@debbugs.gnu.org; Wed, 24 May 2023 12:32:03 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D8ADDFF809; Wed, 24 May 2023 16:31:55 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Wed, 24 May 2023 10:55:09 -0400") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> Date: Wed, 24 May 2023 19:24:10 +0300 Message-ID: <864jo11yvp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> (Tangential further thought: I wonder if we could make C-x p work as a >>> prefix for all commands automatically, so for example C-x p C-x C-j >>> would open the project root, C-x p M-& would run a shell command in the >>> root, etc. That would be neat.) >> >> IOW, like 'C-x p p' but without asking for another project. Doable as well. > > I'm curious, how are you thinking this would be implemented? My thought > was that C-x p would act as a prefix for any key sequence in this way, > *but* also C-x p c and the other things currently in project-prefix-map > would still be explicitly bound, so they can be looked up with > describe-key. And also, C-x p C-h should still run > describe-prefix-bindings. I don't know how one would achieve this... Probably this is not possible. What I meant is to bind 'C-x p' to a special command that uses 'set-transient-map'. But then such command could be bound to e.g. 'C-x p /' (with mnemonics "root") to set 'default-directory' to the project root for the next command. From debbugs-submit-bounces@debbugs.gnu.org Wed May 24 13:38:04 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 17:38:04 +0000 Received: from localhost ([127.0.0.1]:45041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1sR1-0000fK-P8 for submit@debbugs.gnu.org; Wed, 24 May 2023 13:38:03 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:52123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1sQz-0000eq-KJ for 63648@debbugs.gnu.org; Wed, 24 May 2023 13:38:02 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 37D8160003; Wed, 24 May 2023 17:37:53 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86o7m91z22.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 24 May 2023 19:20:21 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> Date: Wed, 24 May 2023 20:37:15 +0300 Message-ID: <86pm6py6k4.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> So a similar function could remember 'project-current-directory-override' >>> for the next command. >> >> But we were talking about "regular" commands, right? Those don't know >> anything about project-current-directory-override. > > Any command indeed. They should use the temporarily set default-directory. Actually, instead of 'project-current-directory-override' I meant 'default-directory'. But probably this is impossible to do because of these restrictions: 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. From debbugs-submit-bounces@debbugs.gnu.org Wed May 24 13:45:27 2023 Received: (at 63648) by debbugs.gnu.org; 24 May 2023 17:45:27 +0000 Received: from localhost ([127.0.0.1]:45057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1sYB-00029s-2z for submit@debbugs.gnu.org; Wed, 24 May 2023 13:45:27 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:64331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1sY7-0001gL-4m for 63648@debbugs.gnu.org; Wed, 24 May 2023 13:45:25 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id CDFB940004; Wed, 24 May 2023 17:45:15 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86pm6py6k4.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 24 May 2023 20:37:15 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> Date: Wed, 24 May 2023 20:44:14 +0300 Message-ID: <86bki9y68h.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> So a similar function could remember 'project-current-directory-override' >>>> for the next command. >>> >>> But we were talking about "regular" commands, right? Those don't know >>> anything about project-current-directory-override. >> >> Any command indeed. They should use the temporarily set default-directory. > > Actually, instead of 'project-current-directory-override' I meant > 'default-directory'. But probably this is impossible to do > because of these restrictions: > > 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'. From debbugs-submit-bounces@debbugs.gnu.org Fri May 26 11:16:55 2023 Received: (at 63648) by debbugs.gnu.org; 26 May 2023 15:16:55 +0000 Received: from localhost ([127.0.0.1]:50573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2ZBX-0004Yl-Dn for submit@debbugs.gnu.org; Fri, 26 May 2023 11:16:55 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:60035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2ZBV-0004YP-Ri for 63648@debbugs.gnu.org; Fri, 26 May 2023 11:16:54 -0400 From: Spencer Baugh To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <864jo11yvp.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 24 May 2023 19:24:10 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> <864jo11yvp.fsf@mail.linkov.net> Date: Fri, 26 May 2023 11:16:46 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>>> (Tangential further thought: I wonder if we could make C-x p work as a >>>> prefix for all commands automatically, so for example C-x p C-x C-j >>>> would open the project root, C-x p M-& would run a shell command in the >>>> root, etc. That would be neat.) >>> >>> IOW, like 'C-x p p' but without asking for another project. Doable as well. >> >> I'm curious, how are you thinking this would be implemented? My thought >> was that C-x p would act as a prefix for any key sequence in this way, >> *but* also C-x p c and the other things currently in project-prefix-map >> would still be explicitly bound, so they can be looked up with >> describe-key. And also, C-x p C-h should still run >> describe-prefix-bindings. I don't know how one would achieve this... > > Probably this is not possible. What I meant is to bind 'C-x p' > to a special command that uses 'set-transient-map'. But then such > command could be bound to e.g. 'C-x p /' (with mnemonics "root") > to set 'default-directory' to the project root for the next command. Yes, that would make sense. It would be nice if that kind of approach didn't hurt the self-documentation capabilities of Emacs. I have an idea for how to make it work, which might be generally useful: Maybe commands/keybindings could support marking themselves as "prefix" commands, such that when you run describe-key and enter the prefix key sequence, describe-key accepts another key sequence after you finish the prefix key sequence, and interprets it with the altered keymaps that would be created by the prefix. And then the help buffer would print the help for both commands. So then (describe-key (kbd "C-x p M-&")) would print help for both the new project-prefix command and async-shell-command. And also, (describe-key (kbd "C-x p c")) would print help for both project-prefix and project-compile, the latter being bound only by the transient created by C-x p. And also, describe-prefix-bindings would be taught to describe any additional bindings added by an explicitly marked prefix command. So C-x p C-h would print all the same bindings as it currently does. This probably wouldn't be worth it just for project.el, but it could allow another very cool change: We could turn C-x 4, C-x 5, and C-x t into prefixes like this, which behave like C-x 4 4, C-x 5 5, and C-x t t do today, and turn their current bindings into a transient. If we added this explicit support for "prefix" commands, we could maybe do this without losing any features or self-documenting abilities. So then, e.g., C-x 4 M-& would run async-shell-command in another window. One less key to hit would make that a lot more convenient IMO... Probably we wouldn't want to do that by default, but it could be a nice user customization. I'd like to turn it on myself... From debbugs-submit-bounces@debbugs.gnu.org Tue May 30 14:04:13 2023 Received: (at 63648) by debbugs.gnu.org; 30 May 2023 18:04:13 +0000 Received: from localhost ([127.0.0.1]:34097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q43hc-0006BF-UJ for submit@debbugs.gnu.org; Tue, 30 May 2023 14:04:13 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:41719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q43hb-0006B1-6E for 63648@debbugs.gnu.org; Tue, 30 May 2023 14:04:11 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 3166B60003; Tue, 30 May 2023 18:04:03 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Fri, 26 May 2023 11:16:46 -0400") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <864jo11yvp.fsf@mail.linkov.net> Date: Tue, 30 May 2023 20:48:33 +0300 Message-ID: <86v8g98zw6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>>> (Tangential further thought: I wonder if we could make C-x p work >>>>> as a prefix for all commands automatically, so for example >>>>> C-x p C-x C-j would open the project root, I just noticed that 'C-x p C-x C-j' would open the parent directory of the project root, not the root itself, since 'C-x C-j' in the root jumps to its parent. > I have an idea for how to make it work, which might be generally useful: > > Maybe commands/keybindings could support marking themselves as "prefix" > commands, such that when you run describe-key and enter the prefix key > sequence, describe-key accepts another key sequence after you finish the > prefix key sequence, and interprets it with the altered keymaps that > would be created by the prefix. And then the help buffer would print > the help for both commands. > > So then (describe-key (kbd "C-x p M-&")) would print help for both the > new project-prefix command and async-shell-command. > > And also, (describe-key (kbd "C-x p c")) would print help for both > project-prefix and project-compile, the latter being bound only by the > transient created by C-x p. Before doing this for 'C-x p' and 'C-x 4' it's possible already to test this on the existing 'C-x p p' since currently (describe-key (kbd "C-x p p c")) fails to describe 'project-prefix-map'. And only prints help for 'project-switch-project' with (describe-key (kbd "C-x p p")) From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 01 12:09:53 2023 Received: (at 63648) by debbugs.gnu.org; 1 Jun 2023 16:09:53 +0000 Received: from localhost ([127.0.0.1]:38374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4ks5-00018b-8C for submit@debbugs.gnu.org; Thu, 01 Jun 2023 12:09:53 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:49633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4ks3-00018I-1U for 63648@debbugs.gnu.org; Thu, 01 Jun 2023 12:09:52 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 4A5671C0005; Thu, 1 Jun 2023 16:09:42 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86bki9y68h.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 24 May 2023 20:44:14 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> Date: Thu, 01 Jun 2023 19:05:07 +0300 Message-ID: <86cz2f7bvo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> 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)) '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'. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=next-default-directory.patch diff --git a/src/buffer.c b/src/buffer.c index 0c46b201586..ca81db21894 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5360,6 +5360,10 @@ syms_of_buffer (void) these names start with `/' or `~' and end with `/'. To interactively change the default directory, use command `cd'. */); + DEFVAR_LISP ("next-default-directory", Vnext_default_directory, + doc: /* Default directory for the next command. */); + Vnext_default_directory = Qnil; + DEFVAR_PER_BUFFER ("auto-fill-function", &BVAR (current_buffer, auto_fill_function), Qnil, doc: /* Function called (if non-nil) to perform auto-fill. diff --git a/src/keyboard.c b/src/keyboard.c index 14c55666768..dfe939750c9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1500,7 +1500,19 @@ command_loop_1 (void) update_redisplay_ticks (0, NULL); display_working_on_window_p = false; + Lisp_Object next_dir = Vnext_default_directory; + specpdl_ref count = SPECPDL_INDEX (); + if (!NILP (next_dir)) + specbind (Qdefault_directory, next_dir); + call1 (Qcommand_execute, Vthis_command); + + if (!NILP (next_dir)) + { + unbind_to (count, Qnil); + Vnext_default_directory = Qnil; + } + display_working_on_window_p = false; #ifdef HAVE_WINDOW_SYSTEM --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 01 16:31:39 2023 Received: (at 63648) by debbugs.gnu.org; 1 Jun 2023 20:31:39 +0000 Received: from localhost ([127.0.0.1]:38497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4oxO-0000Il-Us for submit@debbugs.gnu.org; Thu, 01 Jun 2023 16:31:39 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:36533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4oxL-0000IN-Ta for 63648@debbugs.gnu.org; Thu, 01 Jun 2023 16:31:37 -0400 From: Spencer Baugh To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86v8g98zw6.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 30 May 2023 20:48:33 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> <864jo11yvp.fsf@mail.linkov.net> <86v8g98zw6.fsf@mail.linkov.net> Date: Thu, 01 Jun 2023 16:31:28 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>>>>> (Tangential further thought: I wonder if we could make C-x p work >>>>>> as a prefix for all commands automatically, so for example >>>>>> C-x p C-x C-j would open the project root, > > I just noticed that 'C-x p C-x C-j' would open the parent directory > of the project root, not the root itself, since 'C-x C-j' in the root > jumps to its parent. Only in dired buffers. If not in dired, and not in a file-visiting buffer, it just goes to default-directory. That is kind of annoying for making C-x p p C-x C-j go to the root, though, because its behavior will depend on the current buffer... Maybe C-x p p can switch buffers before running the command? Or maybe we can just change how C-x C-j behaves so it works intuitively with C-x p p? From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 01 17:09:38 2023 Received: (at 63648) by debbugs.gnu.org; 1 Jun 2023 21:09:38 +0000 Received: from localhost ([127.0.0.1]:38625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4pYA-0001OP-9x for submit@debbugs.gnu.org; Thu, 01 Jun 2023 17:09:38 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:45032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4pY7-0001OF-69 for 63648@debbugs.gnu.org; Thu, 01 Jun 2023 17:09:37 -0400 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 351E4u5O008639; Thu, 1 Jun 2023 21:09:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=FmJIoYaBkALZp9NbtSlkqpA/wE87bp2yZtEoIEACEV8=; b=OKOZSAbnTJk2kfQaSsE2SMQBb+otok1OZbiiF+EYpjnizmntxlWEbWXlaXKdVrdB2vs9 A7DmHey01EypUyPClwyI8/eIa5FjDsH3RPFcCU7Fqm8K9elY/CpvUTk0NxnKobgCFR81 nHirXjTBYyJyhW/EDgwgouURRk8To8CGzqeK8GbA6jhnqXzztNSmedHYZsAn9aipS8X0 60axauMtlXKZjMzoQYRQ4HTOG7/EaNVQ2uzsY3rzVynAdEHMioWerHJtawjOypPf6Kzm lL8VKTrTVbKJfFwAwLEaCLb/l92bjIcj5RAmomCj/e5FtL4YN1Y4uhi1cBfg2ivueC6g KQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qvhjh9qrs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Jun 2023 21:09:33 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 351KDn9h014662; Thu, 1 Jun 2023 21:09:33 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qu8a7r9cg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Jun 2023 21:09:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PWkYYXod3QJLp884izkNpuGXJquU8NQ9LIEZ9yJkw2MymXLdvtlksBaJGYSG+fvFWKxHI/HH6WEKOFQ6dAxkgGUHW67OJlkeWgdF1dnzZwWiFi9SdrHCHqqrKM+D4W/CZLV7/MBUs5UsbXfBwa6IYIy1gYw7K30klXcqw6j9bI5KOnUsSZ4WsZSSBPLDC8h9aFdEEvq3k7GytRVjr5oX3nUg2lrB+1ocgKQ0buwtu7lW0nLrn3rbs5Yzv8NeaXAfmaT9PxVSh4zBDjtmoiE6AonDMN4rBVVZyrINTa9MLtYC5cEi3dyJ/0KMQ/JbYGB9lju4LlRS5pCkrRY8tDK4LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FmJIoYaBkALZp9NbtSlkqpA/wE87bp2yZtEoIEACEV8=; b=iRjHtSR3L/oErYTkhqkJbtn1i5T42F7kOy3ShR5u3EffpP/80NSeCLIBcdwNqlKLVJYUi1WMa9+9/ZHfQuk7PxzmFjZ1qyhyeEWSQoPJM2usugXGUc+XwO7FgcGNdE4OyY7xD+tV87Eg+cDgVtVPO6m6Ruds5Zgwm8doWGIe4V/4Lv2r38yd/EzOPsdgbv4CEBtvQVfVdEx+tH1inNWHxFKVWR/lXQA8k745StkSeszKTC4yTl7MlMKBxwr+X/VJpvQoks3rvfXeRY7Us8Zd5PKuHL0JX8sL1g3woV055/OmSq9wFfB7nVKvVymsDG+cpI5Ua2DEyKmpbYL7IkArYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FmJIoYaBkALZp9NbtSlkqpA/wE87bp2yZtEoIEACEV8=; b=qWyQK10QOHR15jI2sUqzfAejwNLwrjtB0FvutFjDmS+O1gawmUNkZPvn/u4YwP3QK/y94L/IPhIZNtcBjCgsfbw6TC3R2BMBIy6g82bp/QEKoRZxX3QLKr4KfhTwCslqdQdwp/js4PozHtP4l5Bin4KrARJM8hBQvgtR7GapiIg= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BLAPR10MB5059.namprd10.prod.outlook.com (2603:10b6:208:327::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.22; Thu, 1 Jun 2023 21:09:29 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a995:2ae5:2745:24ff]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a995:2ae5:2745:24ff%6]) with mapi id 15.20.6433.022; Thu, 1 Jun 2023 21:09:28 +0000 From: Drew Adams To: Spencer Baugh , Juri Linkov Subject: RE: [External] : bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Thread-Topic: [External] : bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Thread-Index: AQHZlMg3Jqe8JePML0u+XpFabANSpa92cG/A Date: Thu, 1 Jun 2023 21:09:28 +0000 Message-ID: References: <86wn10e1wl.fsf@mail.linkov.net> <864jo11yvp.fsf@mail.linkov.net> <86v8g98zw6.fsf@mail.linkov.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|BLAPR10MB5059:EE_ x-ms-office365-filtering-correlation-id: 3e2a237b-f21d-43df-d1d1-08db62e47ca9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5YTzlkH6fBSHmayO1i1S4J2a5CCD7oU4bC8kmA3gL+blofHbbkDhFmgTPmswE4RX8jsoqnTkAUZwVXDCYv7A7vxXxu3oVhXdhcSgm1N0QCdw3rjPUWMj/xuWwBTBfAvaAnv19iTWafiY22fYkzf1bvRSuRxk3a6NvZxg72GPMxPLMvWTN6d4DLsAgqaUfegjf5mWJPWXWg3ngurFI1iUTpIJ6AANWvQTXlwa+IDd2b4kfrG0rCPJb1wkXyG0VkM/nHbUMWkgQ2LQaJpCqIPjSv09Ea6H5AFFZmtcoWpRZnFDNT0Ge855jLQ/SqIDUHuEygIThD453cvc3+bi5RwqkF80m2iUC87gfuRCNmvuATkgaLIsEh+Esk+0PR2Ms0SkxWRLjR8MHGBM7y/Z2e2hr7PxdeQh0T3Lu0uAXtDhEAXyFBZF5cuDyjxRfFGiKq1PKWh37Gy9q4orntd0yeU6pf6bJ+gXsDMZ4vdSBzJuvhNM91fZ4a3pif7jdhyyfhJK55F5+jUAUSUQIM17bIiJfFmBp6353ocYivEaOUJ0a1gD3jzn7YQUlBBEfk37cYJxEDEQoYzsfsV0Up8sE8Zjnwc3c0TJqVr/NqJVqtRvRUnFDcrH05Z/MKQONEi3mDR8 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(346002)(376002)(396003)(136003)(366004)(451199021)(186003)(7696005)(33656002)(52536014)(5660300002)(71200400001)(41300700001)(55016003)(38100700002)(8676002)(9686003)(8936002)(26005)(6506007)(122000001)(38070700005)(66446008)(110136005)(4744005)(2906002)(64756008)(66476007)(66556008)(66946007)(478600001)(4326008)(44832011)(86362001)(76116006)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rZRJJpuVVv9Ptq4eeoWc75qxSGUq5ePvsFy+eyoW/uWKmexnqPBwX2pI2FYi?= =?us-ascii?Q?P9vH3jXFLYnWxv62oIkjzy5vm+C7UYUHT/2RqxBZo/Z2bLbtGF8bfu5/ummx?= =?us-ascii?Q?BwzWOoyxPj2OesdEyuPvx2vdfAZIAKeEah/+qucSibB+stahwAF+xlT6fY3p?= =?us-ascii?Q?bfh9chqD5Na7ccJ7+eu16kVBuf9wR6AreueWJ+geTwO3HHAmnRFtpKaJd2A2?= =?us-ascii?Q?AnHETgB0b1hhEb3pvkkeRclA+0G233A5WlaQTq4P/2Ts18OpQnGnaBa7sSrs?= =?us-ascii?Q?QYYEMjdiPSgz8s65MH04CTyLAzgSTO4r2KQacjga4Ca7u8gFYCle4bHaVAJv?= =?us-ascii?Q?h8kdntf3yQPcwIell9R8kAAt0Zq70djEGtm2U3uG8347vTwq3AgSETLyi6V9?= =?us-ascii?Q?Xw5PC92gpjHNJhxMTBUAeD740vpS/Ck3r8pW0eTvA4cYAuAJmWErmy4IyMTJ?= =?us-ascii?Q?mYBNi256r3oMG9PYHzrgqBVblL1dG9Gx9wf4zXevOvFXnE/qOgG5mwZT2Dlt?= =?us-ascii?Q?XQUCPcb+WQPP20cVlG3kYZtdTGImh4VaX2UWc52iRBOEGHPLeWkI5xQ8PY4z?= =?us-ascii?Q?pQSv3imi2PyTBexf3bs7y4PYQBFVhhGpuXUm2HvA7Hc87Sibuhc8zOHaScVE?= =?us-ascii?Q?gXAD2C4IjyPQ6gQGiNeRTdieOii+ANYRqzz2ocjv1UHa0PH0luVKEJsfKPUr?= =?us-ascii?Q?L6AXqitJzObPm4LO/aBEj9Q6Xma0noNKmewsVBIrpvpvZJo1PwvcPwUxFrx5?= =?us-ascii?Q?8o3caTfCh+xbfKQv2aJCmxiFOVsolhpdzKkcEIVw/nNyNnToYQgF+Tx+72zZ?= =?us-ascii?Q?sElKzYKS9wRNHDCK8JPrsBJQIpBXiQ1RcnmRsGudt2surDbp2sbl9FYFjTgQ?= =?us-ascii?Q?0ZtpIWerm5yfMlBRPl2/FcM9oDRA5CJehGGOYNLS0CRQbEdMI2FdMsNMaEbX?= =?us-ascii?Q?Bav5uAbP2KZRWCLUNJ4vwc0fd3dkzj/6hRuzGFtZ+3ue1MRCJmLRXpkLA4P6?= =?us-ascii?Q?W5pPtP+5o9aZTWzctmcFc4nY4Lvw3U6iWDlQDSgC1JOfnifkUS1Db7OhdC4p?= =?us-ascii?Q?3Rp0oaFq5cJJUX0IZ8BMe6x1qH7dAnh4MfyUP+4tpXZB6CsanU+GN91BVE4n?= =?us-ascii?Q?Op0n4+ReaUZJ7EmWRsd655grLgBMyRbNnkQnBaw/AL8DTrTrOjc65bt/T+Y9?= =?us-ascii?Q?9IWkt6sdX7FiVDcnDaxJBmr7losalDPBLYjH9zwuZ7pqZgpoJT/NmKLJJZcp?= =?us-ascii?Q?Xz2c/NwWeSDCOMpIOhWb6bHkg/L2O4C4M8i+JbZGi/jHrh0BXGUpuMbjC0R0?= =?us-ascii?Q?Tun+iKmvHxcbK0NjzOUST0tTi5pBBs7Hoxsq/3S3x/dGtMvuFOkGNCA1DQa6?= =?us-ascii?Q?xCG0PE6aCAu9DC2Z07wmNfEGThUB0V69d9UeNy+pc8S17xuHKi6L4cwdEemh?= =?us-ascii?Q?tbuojZNk7+98x0PpRVCjTxxzGGvraUm77bChSvJU2stU2ik5hwTmclvO5mbZ?= =?us-ascii?Q?IRiH7YNODIgKFYhK0Yu0l1ps0ojsaFKSp+9UuVP6sU1OO8mpP2LL7P/AGcZH?= =?us-ascii?Q?ANQdZQn/2JLEAH4AG5JPzzQIW5AvcOm04GEPbp/R?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: tSU0S4lB06SMk9zFBiOa0oxKvFBfGDFQC7ldhQ54a7L0xCepXX8tyE0Nrrqw7zlDFOogZrO83wXZE1qk1jiVZTC4Laqk9/I1nAdWyGcSOcYmo1MTaGZ3hWqjIYuHvkfx/eniq389biqrpgR5q/iDV3XrumF7jZ3xKZbPor6cCKXkTEqyHX60DJf/2v7717mDve+yylg8stCooh9aDu8e9R+fTrpWekjjUYtrn+oGnXVIW1ChmN+RQmEYZfXuStVti/1llY8/iHsNsIC5MvuzvUQqJBUxStqDH927fLWlzyyv7i0YKQOStjTCsPrtoYWILajtNf7PGEs3EhgVVavKia37eHGGb6HrVPkFOt7oUOoAkx2YSK1D00K9Ex3hxayfmtLqQsxCUhxZsWmNrt9XPcLl4dSlJg+YxZ3tGbw7qpbrXIn7cKpPyc9ww6TST3B6D0oqW48FIDZuElXi6e4KH8sIuSynqG2C/5EkkaPgedZS4i7jsa0JndQJE3mk6MD5QF981PTdTQL+Xv9vRcGoVVA6QeDtIhaMYjCMCtr6ejmGZ/kzZY7hSt0PuehAY7nT85mZtxOf9Zjsog7dL3vYyEjFbUJGkxftoa26klNDc3XbsYWG7eQ53qRmzjYNfmaf0NpF32kj2kJeQl7/qqMR1OjQwEfh2g1Sds6n/kccKwtGrAmFhoEmsyGiQlt6RedTRzOu4RRTVJsM/isduSEcG2enTdneqHQh3Qnm/GXJICXagxobYZfkobw+xIoeIfrVotVjgwp31uBa2glNshWvEoh1MP7Pk9jT2WzZYHt++HVxnUxpMqIZqbImMRqnAI5xv+aVbiz19In5aiKOcIggCg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e2a237b-f21d-43df-d1d1-08db62e47ca9 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2023 21:09:28.6418 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qtvGBk1+g8c1nTsZe+ytqM6ib7BHv4p1uLWSvtan51qFMgqBHGncg1GPzrIff7DutJ/TUEqdIaL+VU6oA4ec8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5059 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-01_08,2023-05-31_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=711 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2306010182 X-Proofpoint-GUID: jjbxQJD5VIiJMJDx9MDddr-uANvMUtV2 X-Proofpoint-ORIG-GUID: jjbxQJD5VIiJMJDx9MDddr-uANvMUtV2 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: "63648@debbugs.gnu.org" <63648@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Or maybe we can just change how C-x C-j > behaves so it works intuitively with C-x p p?=09 Please don't change C-x C-j. If you want to have another command that does whatever you want then do that. Bind that to whatever keys you like in a particular mode. But please don't change the behavior of `C-x C-j'.=20 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 01 21:40:41 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 01:40:41 +0000 Received: from localhost ([127.0.0.1]:38688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4tmT-000541-6h for submit@debbugs.gnu.org; Thu, 01 Jun 2023 21:40:41 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:58855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4tmQ-00053m-PK for 63648@debbugs.gnu.org; Thu, 01 Jun 2023 21:40:40 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7E2FD3200916; Thu, 1 Jun 2023 21:40:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 01 Jun 2023 21:40:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1685670032; x=1685756432; bh=fyRIOteyQ7YzDb4ygoVDp+sZgwnvgMxFuCO PybvTNBw=; b=N5xU6m51BGKh0pLsBbBnxU7uZqprkH6lKWKcmo3aBwZifNszXjr ipbBmj9kAnFBdHMALlk7GeI3rdWNYj/0fv3uxy66hZhJbpCq2Vm7ylCclQNWFU/5 OoalIYIt9npzPzN7gyhTUnYeYKRItVtE90YP2QJ8uocFh8XFgP7gkxtzrtn1VKnv pYFzQTV89BovVOd3J/xDQ2m7k3Fdqg86VKSkdrpBOGC32hQ/66twiSQRGqJ0o436 XHhQ+QGHJk+e3p1a5DuTr0U9DWRSZN+WtD7SNPcwtazg70nBmLqRJWgbPdqDP9P4 Fr3ZCpLvIWj+QvP46eS1+2gYwclJYBYgevQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1685670032; x=1685756432; bh=fyRIOteyQ7YzDb4ygoVDp+sZgwnvgMxFuCO PybvTNBw=; b=gFwI9qlxLUedKDTdjkYgDJB67JlpavznJPcznD6dISjpC6HM+Am snYpopeUx8HO2c8GeIdQpPUT7zNGavgOBtTio8dIub7dmOfQh73X0MV4rZfAZdTG QEe3/B1nTuJ4Zr9dbaqzSPbIwR/OBcz17WmDXZ8w+JCe3qH8khRLL3uIaAKs/74u jRXHHa3sUDQB+md20kvDhy5gWEwmm0ure4FKjp5wSpFQwSLB/Ds+u0XI95t6QlyF Lgq8IHI6OUqC0oczkEgkhbrUdbMKiAgo4XKeJnoIgANlRKjnJYDqtS7VXwv174FO E5bNXpZKOG+d9lPaGllHG9fxtbNZD0L3o3w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelvddghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jun 2023 21:40:30 -0400 (EDT) Message-ID: Date: Fri, 2 Jun 2023 04:40:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86cz2f7bvo.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) On 01/06/2023 19:05, Juri Linkov wrote: >>> 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. > '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). From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 02:32:21 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 06:32:21 +0000 Received: from localhost ([127.0.0.1]:38980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yKi-0007CC-SL for submit@debbugs.gnu.org; Fri, 02 Jun 2023 02:32:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yKe-0007Bx-Qi for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 02:32:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4yKX-0002Gn-V4; Fri, 02 Jun 2023 02:32:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xYVZ2WKHpVM1vL0KJpH0Cw4JYdaAlONzz3wibMxKajY=; b=PobKP0oapVYv 9LUAYnFrxw9dhGBVpji98ovGUw5e1bmNz4lfhL/n7WSdUhD3Qi5JBST9+lZ45D9KKov7pigdCGSQq JPMgPdk6/a9/+1LOQM82RuQHyruSmtfv6Xuob18nNhIOEwJOFVOratgsYMd9dj5agXb8XOiZAN5HG rYDryxMCnMJJKowUUMqo17huMapnwRbdq3535tSztG6SYF0O4YZnEmfaUtVXjbqhnZho3j6WFc0Nl D6qgrRirTJ9yE2g/YZIgxX4CmxniLObp1r2bCYYKOsbNUTSSTgiaVkbbNwWaEQ4ra5QYwQJPrsMMQ ssg4JpmtEYVRjSupfNUXLA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4yKX-00067Y-II; Fri, 02 Jun 2023 02:32:09 -0400 Date: Fri, 02 Jun 2023 09:32:58 +0300 Message-Id: <83ttvqbch1.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov , Stefan Monnier In-Reply-To: <86cz2f7bvo.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 01 Jun 2023 19:05:07 +0300) Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: dmitry@gutov.dev, 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Spencer Baugh , 63648@debbugs.gnu.org > From: Juri Linkov > Date: Thu, 01 Jun 2023 19:05:07 +0300 > > 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)) > > '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'. > > diff --git a/src/buffer.c b/src/buffer.c > index 0c46b201586..ca81db21894 100644 > --- a/src/buffer.c > +++ b/src/buffer.c > @@ -5360,6 +5360,10 @@ syms_of_buffer (void) > these names start with `/' or `~' and end with `/'. > To interactively change the default directory, use command `cd'. */); > > + DEFVAR_LISP ("next-default-directory", Vnext_default_directory, > + doc: /* Default directory for the next command. */); > + Vnext_default_directory = Qnil; > + > DEFVAR_PER_BUFFER ("auto-fill-function", &BVAR (current_buffer, auto_fill_function), > Qnil, > doc: /* Function called (if non-nil) to perform auto-fill. > diff --git a/src/keyboard.c b/src/keyboard.c > index 14c55666768..dfe939750c9 100644 > --- a/src/keyboard.c > +++ b/src/keyboard.c > @@ -1500,7 +1500,19 @@ command_loop_1 (void) > update_redisplay_ticks (0, NULL); > display_working_on_window_p = false; > > + Lisp_Object next_dir = Vnext_default_directory; > + specpdl_ref count = SPECPDL_INDEX (); > + if (!NILP (next_dir)) > + specbind (Qdefault_directory, next_dir); > + > call1 (Qcommand_execute, Vthis_command); > + > + if (!NILP (next_dir)) > + { > + unbind_to (count, Qnil); > + Vnext_default_directory = Qnil; > + } > + > display_working_on_window_p = false; > > #ifdef HAVE_WINDOW_SYSTEM What will this do when a command is invoked via call-interactively? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 02:33:08 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 06:33:08 +0000 Received: from localhost ([127.0.0.1]:38985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yLU-0007Dc-BT for submit@debbugs.gnu.org; Fri, 02 Jun 2023 02:33:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yLS-0007D7-Qb for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 02:33:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4yLM-0002P5-UW; Fri, 02 Jun 2023 02:33:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=bg4DszXjNuER6heKutcM7b1hhLg3XK6VgyHDFVmjn1A=; b=DGmbs+5q84cj jhSeeIjxQmOhXzwq/BNvgpYipru5ChA4c+hMdZHYEOqh3JzTg1JQUEzYVGFcv7iz4cNgtyc8GLRNP JzA0VFR1hBOSs0FPrYHBNRD61QbyiS1NS1HDRHlKO8PdIoP4/o3Tb2JAORtOV4mLN0oSP2Z6cRDeV O6yhChhoK3WexL2Qwaf4UetzmGF1CE3c1QmyIa2qXDNui9Rrfb8tpOKFINrey9h8QeSghdTmcl5s6 Mu8lEqFcPOdnL2rmak4SYfid5H+5ziNfROk1DmeUWXz8/tJjWB3RnNkWE5M4HwvKcVvuLpcTBHDEo 8d0Ngr8MY++On/EWRKSaGA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4yLK-00083p-83; Fri, 02 Jun 2023 02:32:58 -0400 Date: Fri, 02 Jun 2023 09:33:46 +0300 Message-Id: <83sfbabcfp.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-Reply-To: (message from Drew Adams on Thu, 1 Jun 2023 21:09:28 +0000) Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands References: <86wn10e1wl.fsf@mail.linkov.net> <864jo11yvp.fsf@mail.linkov.net> <86v8g98zw6.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@janestreet.com, 63648@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: "63648@debbugs.gnu.org" <63648@debbugs.gnu.org> > From: Drew Adams > Date: Thu, 1 Jun 2023 21:09:28 +0000 > > > Or maybe we can just change how C-x C-j > > behaves so it works intuitively with C-x p p? > > Please don't change C-x C-j. Don't worry, it won't change. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 03:05:34 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 07:05:34 +0000 Received: from localhost ([127.0.0.1]:39008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yqs-00085x-1w for submit@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:34 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:51905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yqp-00085W-Oo for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:32 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id C31A02000F; Fri, 2 Jun 2023 07:05:24 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Fri, 2 Jun 2023 04:40:28 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> Date: Fri, 02 Jun 2023 09:40:55 +0300 Message-ID: <86353axu48.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> 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'. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 03:05:35 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 07:05:35 +0000 Received: from localhost ([127.0.0.1]:39011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yqt-00086A-CC for submit@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:35 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:56029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yqs-00085Z-1G for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:34 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id E00F540002; Fri, 2 Jun 2023 07:05:27 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Thu, 01 Jun 2023 16:31:28 -0400") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <864jo11yvp.fsf@mail.linkov.net> <86v8g98zw6.fsf@mail.linkov.net> Date: Fri, 02 Jun 2023 09:46:25 +0300 Message-ID: <86h6rqwena.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>>>>> (Tangential further thought: I wonder if we could make C-x p work >>>>>>> as a prefix for all commands automatically, so for example >>>>>>> C-x p C-x C-j would open the project root, >> >> I just noticed that 'C-x p C-x C-j' would open the parent directory >> of the project root, not the root itself, since 'C-x C-j' in the root >> jumps to its parent. > > Only in dired buffers. If not in dired, and not in a file-visiting > buffer, it just goes to default-directory. You are right, I tried with the next-default-directory patch, and it works like you described. > That is kind of annoying for making C-x p p C-x C-j go to the root, > though, because its behavior will depend on the current buffer... Maybe > C-x p p can switch buffers before running the command? Alas, can't switch buffers because such commands as 'C-x p g' read the default value from the current buffer. > Or maybe we can just change how C-x C-j behaves so it works > intuitively with C-x p p? The problem is in 'C-x C-j'. In dired buffers it uses the value of 'dired-subdir-alist' instead of 'default-directory', so the patch with 'next-default-directory' doesn't help. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 03:05:43 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 07:05:43 +0000 Received: from localhost ([127.0.0.1]:39017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yr0-00086j-Vs for submit@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:43 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:46711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yqz-00086H-2p for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:41 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id D77B540008; Fri, 2 Jun 2023 07:05:33 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <83ttvqbch1.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Jun 2023 09:32:58 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <83ttvqbch1.fsf@gnu.org> Date: Fri, 02 Jun 2023 09:55:36 +0300 Message-ID: <86v8g6uzdj.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: dmitry@gutov.dev, Stefan Monnier , 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> @@ -1500,7 +1500,19 @@ command_loop_1 (void) >> update_redisplay_ticks (0, NULL); >> display_working_on_window_p = false; >> >> + Lisp_Object next_dir = Vnext_default_directory; >> + specpdl_ref count = SPECPDL_INDEX (); >> + if (!NILP (next_dir)) >> + specbind (Qdefault_directory, next_dir); >> + >> call1 (Qcommand_execute, Vthis_command); >> + >> + if (!NILP (next_dir)) >> + { >> + unbind_to (count, Qnil); >> + Vnext_default_directory = Qnil; >> + } >> + > > What will this do when a command is invoked via call-interactively? This is intended only for commands called interactively. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 07:38:39 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 11:38:39 +0000 Received: from localhost ([127.0.0.1]:39185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5378-0001CV-SM for submit@debbugs.gnu.org; Fri, 02 Jun 2023 07:38:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5376-0001CH-31 for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 07:38:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q536z-0008Ga-WD; Fri, 02 Jun 2023 07:38:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7AD7khTImirZJ6Oj+EUJL7Em7LpjJ3n7x7Q3YS4mTSQ=; b=ffxwuiVEVlAm Rl0IHl3l+UP+Jo/GUF61AiWrF5TjQ8CdIrjEfGb3zeNuVkU/famjyHHzKfNEQYuMyMzrFgaEr9WJo fCyNP7AOSVDjoE+hmDHFa6otT4i9eLlzw1wtTfjV2FRUZ3kfEN5DTlu3wgPxIBqARYbiK09wQXKz9 msmU/Q3JWssr+13vrYCSnDayGpT4samdoGcQ30ZkDJJMXLqjPk/edxRZIBkz/vIP3CCN6274BU4aG 8jvS4mR4Dd0sPJ6Pm9I9bRz129/O/TgXvCzmI9ulBt5VpW3PWjCzUaQYDFd/lUrLMnKb8ytlUY+zk P2IU0+RWQFXx64kD32QA6g==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q536z-0006SO-7D; Fri, 02 Jun 2023 07:38:29 -0400 Date: Fri, 02 Jun 2023 14:39:17 +0300 Message-Id: <83leh2ayai.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86v8g6uzdj.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 02 Jun 2023 09:55:36 +0300) Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <83ttvqbch1.fsf@gnu.org> <86v8g6uzdj.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: dmitry@gutov.dev, monnier@iro.umontreal.ca, 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: Stefan Monnier , dmitry@gutov.dev, > sbaugh@janestreet.com, 63648@debbugs.gnu.org > Date: Fri, 02 Jun 2023 09:55:36 +0300 > > >> @@ -1500,7 +1500,19 @@ command_loop_1 (void) > >> update_redisplay_ticks (0, NULL); > >> display_working_on_window_p = false; > >> > >> + Lisp_Object next_dir = Vnext_default_directory; > >> + specpdl_ref count = SPECPDL_INDEX (); > >> + if (!NILP (next_dir)) > >> + specbind (Qdefault_directory, next_dir); > >> + > >> call1 (Qcommand_execute, Vthis_command); > >> + > >> + if (!NILP (next_dir)) > >> + { > >> + unbind_to (count, Qnil); > >> + Vnext_default_directory = Qnil; > >> + } > >> + > > > > What will this do when a command is invoked via call-interactively? > > This is intended only for commands called interactively. Won't this violate some legitimate expectations? Namely, that invoking a command interactively and via call-interactively produces the same results? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 08:45:53 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 12:45:53 +0000 Received: from localhost ([127.0.0.1]:39285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q54AD-0008M8-Cb for submit@debbugs.gnu.org; Fri, 02 Jun 2023 08:45:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q54AA-0008Lq-QU for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 08:45:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q54A4-0003rk-Pv; Fri, 02 Jun 2023 08:45:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tdlFtzLn+PD90TnQTSyW6tpHahtVJaCRJ1YbLuHfk1Q=; b=cv/ZGKEXMOpl h/SKgbS73yza+T3EBtyehKf5+wwYNVWIJU4XUu5xzYjM5KEIEYxgZhvWx1pGsN9Zi/CPQQX4OQfDf c852LH2iRfVsXxcunYWTWwCDATNMqwkQ93Q+RUYqnizxpbQidMymI8gPT/5KR+6VUJQ/Cs7YsEq/d xN13kV7ulGo1VIrNAZCHA1O8uOt70685TyKo2c6Ly+wAfoKZTz3XcpR46GrIOpa+HDs2iCtGU2Gkd uOQNHX1OfDjvekKfpvstuVsbIBNvsdaciu2nshR9OUG1OJzgK+hGuYjhgYvFeMGOVSSKvBElmCgDN haYD0NnIaExUcTd8AAlgiA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q54A4-0008En-5V; Fri, 02 Jun 2023 08:45:44 -0400 Date: Fri, 02 Jun 2023 15:46:33 +0300 Message-Id: <838rd2av6e.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Fri, 2 Jun 2023 04:40:28 +0300) Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@janestreet.com, 63648@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Spencer Baugh , 63648@debbugs.gnu.org > Date: Fri, 2 Jun 2023 04:40:28 +0300 > From: Dmitry Gutov > > > '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). I guess I wasn't following this discussion closely enough, because I don't understand why my review is being sought. Is this something proposed for the emacs-29 branch? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 12:16:50 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 16:16:50 +0000 Received: from localhost ([127.0.0.1]:40745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q57SM-0005Wc-BD for submit@debbugs.gnu.org; Fri, 02 Jun 2023 12:16:50 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:44431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q57SK-0005WN-6c for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 12:16:49 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 72902FF805; Fri, 2 Jun 2023 16:16:39 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <838rd2av6e.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Jun 2023 15:46:33 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <838rd2av6e.fsf@gnu.org> Date: Fri, 02 Jun 2023 19:09:08 +0300 Message-ID: <86o7lxub4z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> > '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). > > I guess I wasn't following this discussion closely enough, because I > don't understand why my review is being sought. Is this something > proposed for the emacs-29 branch? Luckily this new feature is not for the emacs-29 branch. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 12:16:52 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 16:16:53 +0000 Received: from localhost ([127.0.0.1]:40748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q57SO-0005Wq-L1 for submit@debbugs.gnu.org; Fri, 02 Jun 2023 12:16:52 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:34217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q57SN-0005WS-A3 for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 12:16:51 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 04B051C0002; Fri, 2 Jun 2023 16:16:43 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <83leh2ayai.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Jun 2023 14:39:17 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <83ttvqbch1.fsf@gnu.org> <86v8g6uzdj.fsf@mail.linkov.net> <83leh2ayai.fsf@gnu.org> Date: Fri, 02 Jun 2023 19:11:39 +0300 Message-ID: <86cz2dub0s.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: dmitry@gutov.dev, monnier@iro.umontreal.ca, 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> >> @@ -1500,7 +1500,19 @@ command_loop_1 (void) >> >> update_redisplay_ticks (0, NULL); >> >> display_working_on_window_p = false; >> >> >> >> + Lisp_Object next_dir = Vnext_default_directory; >> >> + specpdl_ref count = SPECPDL_INDEX (); >> >> + if (!NILP (next_dir)) >> >> + specbind (Qdefault_directory, next_dir); >> >> + >> >> call1 (Qcommand_execute, Vthis_command); >> >> + >> >> + if (!NILP (next_dir)) >> >> + { >> >> + unbind_to (count, Qnil); >> >> + Vnext_default_directory = Qnil; >> >> + } >> >> + >> > >> > What will this do when a command is invoked via call-interactively? >> >> This is intended only for commands called interactively. > > Won't this violate some legitimate expectations? Namely, that > invoking a command interactively and via call-interactively produces > the same results? When needed this could be added to call-interactively as well if there is no common code to share between these two. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 13:07:39 2023 Received: (at 63648) by debbugs.gnu.org; 2 Jun 2023 17:07:39 +0000 Received: from localhost ([127.0.0.1]:40791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q58FX-00073E-14 for submit@debbugs.gnu.org; Fri, 02 Jun 2023 13:07:39 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q58FV-00072y-Dc for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 13:07:38 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2A8A0100097; Fri, 2 Jun 2023 13:07:31 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id EE76B10001C; Fri, 2 Jun 2023 13:07:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1685725650; bh=t4Z0rdhCuBXdlbYLfFXtkp4znfRPSjucypwCPxFWH8g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LRcQjD0B6LOU6OKDPDOTvUKyR7TGGc7UDr9gtLUfv4jXzCujOBGHmAIwUcfWZlFY5 ZPXV2P40mvMJidyVI51P+u1g65EEzYqgDwDTZaXH4iXemay3jc5mXkoJ/3zRtMY7pB oWGecr67CQ3bqoAJLgXcyOVZ6iYKbzQgNjqSKZnpgs6Ee//ohmTzh2idVzrkh3DW+N duvhL9aMlw8lhgUO7GWMHprOsygQjE4RZgQNq8biFzh0U+McSNpg820+ZDKFqh4ysR WN2wEZakxPIfNWBHBD2aYTm2wpbQu/YSVVZAoIFOeWZ2uLWxHTF8I5vjCxChQyarWq /IwaQvmMCKtMw== Received: from alfajor (unknown [184.148.243.248]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C4415120476; Fri, 2 Jun 2023 13:07:29 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86cz2f7bvo.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 01 Jun 2023 19:05:07 +0300") Message-ID: References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> Date: Fri, 02 Jun 2023 13:07:28 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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)) This would be a new "prefix command", like the `universal-argument`, `C-x RET c`, the `ofw-other-window`, vc-edit-next-command, `ofw-other-frame` from the `other-frame-window` package, and a few more. In order for this new prefix to interact correctly with those other ones, it should probably use `prefix-command-preserve-state` and it would be good to make it show some visual feedback via `prefix-command-echo-keystrokes-functions`. [ Side note: take my opinion with a grain of salt, because I can't understand why the above would Do The Right Thing wrt the command's docstring. ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 21:30:51 2023 Received: (at 63648) by debbugs.gnu.org; 3 Jun 2023 01:30:51 +0000 Received: from localhost ([127.0.0.1]:41080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5G6U-0006Ml-PO for submit@debbugs.gnu.org; Fri, 02 Jun 2023 21:30:51 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:33611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5G6R-0006MT-MI for 63648@debbugs.gnu.org; Fri, 02 Jun 2023 21:30:49 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 384313200893; Fri, 2 Jun 2023 21:30:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 02 Jun 2023 21:30:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1685755840; x=1685842240; bh=wrIrQOFIvR1WOdHvbCO9VWjJCKIwVTbi8Zc LLVCv6Q0=; b=T9eEbKvbCE6vZFB61aRb4CE9I7AvLewGrrrpmYpADWFDRGQ2Z70 TSyp1YB5bx2UT6Ru3ozbdW1pXyLHRgLj012JiDwCnnd0DkgEiwFQL4Jk5dvJtvaA RCA9+YpIOOrsXMbcPyIwQ2g+miPA4+O6ESz8s22sPAe3ttHYGHtF4bQjV3KVzFbP xWmHJxItY5G/dzziMHUBROp6Jb0JByy2G5dBhUkwZ77DUXnsKl1gwBizgJ+SY2M6 knhuBQx/eXLjis3yGzVbwJsri7LooW9BJ5IrQFCvUD8+PTyB+G0elfeTvMw4q50Y VKR9DAwsjt3nuCoTlKnJgrjMJulgLFpCeBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1685755840; x=1685842240; bh=wrIrQOFIvR1WOdHvbCO9VWjJCKIwVTbi8Zc LLVCv6Q0=; b=jV2EbJ2GzEEWlAnZc/w5TOqNoFNSIinrhLnWWKsXrBUGb4ZlvsV HHnZ+cYdtg19WMJNPxsgP6/vP88mnNfSAwCS8xHi9cNaYXvcQxl+NPAS3EGV7GnL 4tcFKBtKhvoLlFDB6hgIOuOBalzJJsKTxGp9Xx4WDnEOuKxeTsml6/IQ6k+0nX28 sJq0R0kL2uuOcR7oGxGUsUgU5m9pXuFEiiVVsuQ2so1S/0P34ipvCUPGGKsm+RkF c51y5NyIqz1ouzytVrOWHAOLSn9zWvK/dAzjWakmnvZFYsSRLpNdS6iwmXTvBIsB kV9AcDAFrMtxnPDu8wRiXjDj5mpraUMP7YA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelgedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 2 Jun 2023 21:30:39 -0400 (EDT) Message-ID: <0622239c-0b83-f982-9dfc-3045a14e6c06@gutov.dev> Date: Sat, 3 Jun 2023 04:30:37 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86353axu48.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) On 02/06/2023 09:40, Juri Linkov wrote: > 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'. Here's another question: will we be able to reimplement the current behavior? Meaning, first of all, having a loop where the user is asked to use some existing binding from the menu, or from the keymap, but when a key is typed which does not correspond to some existing command, we ask again and again until the user chooses some existing one, or pressed C-g. 'set-transient-map' seems like a viable approach, but it will only let the user try once, right? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 03:06:01 2023 Received: (at 63648) by debbugs.gnu.org; 5 Jun 2023 07:06:02 +0000 Received: from localhost ([127.0.0.1]:47885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q64Hx-0000EK-Fc for submit@debbugs.gnu.org; Mon, 05 Jun 2023 03:06:01 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:38139) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q64Hu-0000E0-CW for 63648@debbugs.gnu.org; Mon, 05 Jun 2023 03:05:59 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id D4D0EFF80E; Mon, 5 Jun 2023 07:05:49 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Stefan Monnier's message of "Fri, 02 Jun 2023 13:07:28 -0400") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> Date: Mon, 05 Jun 2023 09:50:44 +0300 Message-ID: <86jzwipf4z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> 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)) > > This would be a new "prefix command", like the `universal-argument`, > `C-x RET c`, the `ofw-other-window`, vc-edit-next-command, > `ofw-other-frame` from the `other-frame-window` package, and a few more. > > In order for this new prefix to interact correctly with those other > ones, it should probably use `prefix-command-preserve-state` and it > would be good to make it show some visual feedback via > `prefix-command-echo-keystrokes-functions`. Here is the same function turned into a prefix command, so it supports both cases: 1. 'C-x p p d' -- keys from project-prefix-map 2. 'C-x p p C-x d' -- global keybindings ``` (defun project-switch-project (dir) (interactive (list (funcall project-prompter))) (if (symbolp project-switch-commands) (let ((default-directory dir)) (call-interactively project-switch-commands)) (let* ((echofun (lambda () "[switch-project]")) (postfun (lambda () (remove-hook 'prefix-command-echo-keystrokes-functions echofun)))) (setq next-default-directory dir) (add-hook 'prefix-command-echo-keystrokes-functions echofun) (message (project--keymap-prompt)) (prefix-command-update) (set-transient-map project-prefix-map nil postfun)))) ``` If this is conceptually ok, then more customization could be ported from project--switch-project-command such as project-switch-use-entire-map. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 03:06:04 2023 Received: (at 63648) by debbugs.gnu.org; 5 Jun 2023 07:06:04 +0000 Received: from localhost ([127.0.0.1]:47889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q64Hz-0000Ex-RD for submit@debbugs.gnu.org; Mon, 05 Jun 2023 03:06:04 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:35935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q64Hy-0000E7-A8 for 63648@debbugs.gnu.org; Mon, 05 Jun 2023 03:06:02 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id C254F20005; Mon, 5 Jun 2023 07:05:54 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <83leh2ayai.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Jun 2023 14:39:17 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <83ttvqbch1.fsf@gnu.org> <86v8g6uzdj.fsf@mail.linkov.net> <83leh2ayai.fsf@gnu.org> Date: Mon, 05 Jun 2023 09:53:39 +0300 Message-ID: <86h6rmpf1s.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: dmitry@gutov.dev, monnier@iro.umontreal.ca, 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> >> @@ -1500,7 +1500,19 @@ command_loop_1 (void) >> >> update_redisplay_ticks (0, NULL); >> >> display_working_on_window_p = false; >> >> >> >> + Lisp_Object next_dir = Vnext_default_directory; >> >> + specpdl_ref count = SPECPDL_INDEX (); >> >> + if (!NILP (next_dir)) >> >> + specbind (Qdefault_directory, next_dir); >> >> + >> >> call1 (Qcommand_execute, Vthis_command); >> >> + >> >> + if (!NILP (next_dir)) >> >> + { >> >> + unbind_to (count, Qnil); >> >> + Vnext_default_directory = Qnil; >> >> + } >> >> + >> > >> > What will this do when a command is invoked via call-interactively? >> >> This is intended only for commands called interactively. > > Won't this violate some legitimate expectations? Namely, that > invoking a command interactively and via call-interactively produces > the same results? Using 'let' for 'call-interactively' works expectedly in the recent patch: (if (symbolp project-switch-commands) (let ((default-directory dir)) (call-interactively project-switch-commands)) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 10:44:27 2023 Received: (at 63648) by debbugs.gnu.org; 5 Jun 2023 14:44:27 +0000 Received: from localhost ([127.0.0.1]:50062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6BRb-0001k2-1C for submit@debbugs.gnu.org; Mon, 05 Jun 2023 10:44:27 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6BRY-0001jp-VX for 63648@debbugs.gnu.org; Mon, 05 Jun 2023 10:44:25 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3431B4426EB; Mon, 5 Jun 2023 10:44:19 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A8B354400B3; Mon, 5 Jun 2023 10:44:17 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1685976257; bh=oBh3mcHQWWDFx/JocR6hclcddhxpkxbKo7f5ATUfE4E=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hhLagaZ9LV7sfhlrq0H7PIHiGmg8sK9uuI90IPdhdVM19CVEoy7hnJ/2bNCUQrDvp YeAnqSP3y3/8qawBF8OHw0RPTiGDqoaDaW/1eX2rtgWRh7G0Grn9AdqUCFO5PwrCwI XiSGGu3+2RY4xrDAV4wYGgmCbtpQD24h4cLjsHZ5n+DsoWHp08MpeOMn+9SX2sjh0J PUTkBk1BXQkSK7yA+wO/y4tJuURb4PpuSubuiD1A5C0LcSIAyaFKFuuP4tCEd5qsdl HdwH01v5DAQadtF+8D2M9geKBvK8gvI2DhL6KIGAhizNjnzBEqD55WpG/FIg+9cYiP wkDE4ttDPQaUA== Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 88EC7120171; Mon, 5 Jun 2023 10:44:17 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86jzwipf4z.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 05 Jun 2023 09:50:44 +0300") Message-ID: References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86jzwipf4z.fsf@mail.linkov.net> Date: Mon, 05 Jun 2023 10:44:11 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.032 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov [2023-06-05 09:50:44] wrote: >>> 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)) >> >> This would be a new "prefix command", like the `universal-argument`, >> `C-x RET c`, the `ofw-other-window`, vc-edit-next-command, >> `ofw-other-frame` from the `other-frame-window` package, and a few more. >> >> In order for this new prefix to interact correctly with those other >> ones, it should probably use `prefix-command-preserve-state` and it >> would be good to make it show some visual feedback via >> `prefix-command-echo-keystrokes-functions`. > > Here is the same function turned into a prefix command, > so it supports both cases: > > 1. 'C-x p p d' -- keys from project-prefix-map > 2. 'C-x p p C-x d' -- global keybindings > > ``` > (defun project-switch-project (dir) > (interactive (list (funcall project-prompter))) > (if (symbolp project-switch-commands) > (let ((default-directory dir)) > (call-interactively project-switch-commands)) > (let* ((echofun (lambda () "[switch-project]")) > (postfun (lambda () (remove-hook > 'prefix-command-echo-keystrokes-functions > echofun)))) > (setq next-default-directory dir) > (add-hook 'prefix-command-echo-keystrokes-functions echofun) > (message (project--keymap-prompt)) > (prefix-command-update) > (set-transient-map project-prefix-map nil postfun)))) > ``` I think you need to call `prefix-command-preserve-state` as well, so that the order of prefix commands doesn't matter (e.g. user can do `C-u C-x p` instead of `C-x p C-u`). [ Note: I'm still not really happy with the way prefix commands work. I can't remember what problems are still lurking, but IIRC interaction with minibuffer is a source of problems (e.g. prefix commands from before we entered the minibuffer can affect operations within the minibuffer and prefix commands from within the minibuffer can affect the behavior after exiting the minibuffer). I think last time I looked at it, I concluded that maybe it should be reimplemented such that the state is kept in a single object to which prefix commands can add/remove properties, and the minibuffer code would automatically suspend and then reinstall that state (and could emit a warning when throwing away "unused state", such as when leaving a minibuffer). ] > If this is conceptually ok, then more customization could be ported > from project--switch-project-command such as project-switch-use-entire-map. Looks OK to me [ modulo the fact that I don't really understand what this is doing (I don't understand the `project-switch-commands` bit, nor do I understand why a prefix command which temporarily changes the `default-directory` would be called `project-switch-project`). ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 12:40:11 2023 Received: (at 63648) by debbugs.gnu.org; 5 Jun 2023 16:40:11 +0000 Received: from localhost ([127.0.0.1]:50270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6DFa-0004qC-M4 for submit@debbugs.gnu.org; Mon, 05 Jun 2023 12:40:11 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:57813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6DFY-0004pF-Ny for 63648@debbugs.gnu.org; Mon, 05 Jun 2023 12:40:09 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id DE2CA240006; Mon, 5 Jun 2023 16:40:00 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Stefan Monnier's message of "Mon, 05 Jun 2023 10:44:11 -0400") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86jzwipf4z.fsf@mail.linkov.net> Date: Mon, 05 Jun 2023 19:31:37 +0300 Message-ID: <86bkhtlvkm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> (prefix-command-update) > > I think you need to call `prefix-command-preserve-state` as well, so > that the order of prefix commands doesn't matter (e.g. user can do `C-u > C-x p` instead of `C-x p C-u`). I confirm that after replacing `prefix-command-update` with `prefix-command-preserve-state` (replacing since the latter calls the former), now `C-u C-x p p f lisp/international/emoji-labels.el` works ok (without C-u it can't find this non-registered file). > [ Note: I'm still not really happy with the way prefix commands work. > I can't remember what problems are still lurking, but IIRC interaction > with minibuffer is a source of problems (e.g. prefix commands from > before we entered the minibuffer can affect operations within the > minibuffer and prefix commands from within the minibuffer can affect > the behavior after exiting the minibuffer). I think last time > I looked at it, I concluded that maybe it should be reimplemented such > that the state is kept in a single object to which prefix commands can > add/remove properties, and the minibuffer code would automatically > suspend and then reinstall that state (and could emit a warning when > throwing away "unused state", such as when leaving a minibuffer). ] I tested this with such test command and there are no problems: ``` (defun test (arg1 arg2) (interactive (list (progn (message "%S" default-directory) (read-string "1: ") (message "%S" default-directory)) (progn (message "%S" default-directory) (read-string "2: ") (message "%S" default-directory)))) (message "%S" default-directory)) ``` `C-x p p M-x test RET` prints only the new directory. However, I found a problem with `C-x p 4 p`. To fix it, `project-other-window-command` should be completely rewritten to: ``` (defun project-other-window-command () (interactive) (other-window-prefix) (set-transient-map (make-composed-keymap project-prefix-map project-other-window-map))) ``` plus a small fix that I don't know how to generalize: ``` diff --git a/lisp/window.el b/lisp/window.el index ab7dd5ced12..52ba407d9c8 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9099,7 +9091,8 @@ display-buffer-override-next-command (> (minibuffer-depth) minibuffer-depth) ;; But don't remove immediately after ;; adding the hook by the same command below. - (eq this-command command)) + (eq this-command command) + (memq this-command '(other-project-prefix))) (funcall exitfun)))) ;; Call post-function after the next command finishes (bug#49057). (add-hook 'post-command-hook postfun) ``` Then everything works as before and even better. >> If this is conceptually ok, then more customization could be ported >> from project--switch-project-command such as project-switch-use-entire-map. > > Looks OK to me [ modulo the fact that I don't really understand what > this is doing (I don't understand the `project-switch-commands` bit, nor > do I understand why a prefix command which temporarily changes the > `default-directory` would be called `project-switch-project`). ] It's possible to create another general command that will read arbitrary directory, but this command is project-specific with `project-prompter`. `project-switch-project` really should be renamed to `other-project-prefix` like other similar prefix commands. Here is the latest version without much changes: ``` (defun other-project-prefix (dir) (interactive (list (funcall project-prompter))) (if (symbolp project-switch-commands) (let ((default-directory dir)) (call-interactively project-switch-commands)) (let* ((echofun (lambda () "[switch-project]")) (postfun (lambda () (remove-hook 'prefix-command-echo-keystrokes-functions echofun)))) (setq next-default-directory dir) (message (project--keymap-prompt)) (add-hook 'prefix-command-echo-keystrokes-functions echofun) (prefix-command-preserve-state) (set-transient-map project-prefix-map nil postfun)))) ``` From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 10 07:52:31 2023 Received: (at 63648) by debbugs.gnu.org; 10 Aug 2023 11:52:31 +0000 Received: from localhost ([127.0.0.1]:41579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU4DP-0007Kl-4b for submit@debbugs.gnu.org; Thu, 10 Aug 2023 07:52:31 -0400 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]:61012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU4DJ-0007KU-Iy for 63648@debbugs.gnu.org; Thu, 10 Aug 2023 07:52:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=RFx5wEeydEM2a7c5s0plSNauDkFBr17l+Ot8cSCk91E=; b=zW1z1ge3pTPNpcAye3KIkOi0MA0x5a9sozOpu5l1UTzHulUHOdxgNv7sS54vFZhU52Ff XAfBYbdUPeGjlsWaSwtfJ4Q7+WULUvwl893hJEyyN2qE9AsABuOr7sAfLgLwUxLBVRyEGj +DO36yT4mvN41FSz7183jIfBYVSkO8BA+jaFL8918Jc+yxu9tzQJzjRWr85IA4QSsJuoiH yL77g/Ioj58XBD4WjbdIp5scsIQ3XQ+I7QVrI/iK+khx8iC0G+YxXb/2WZN30+kJyzgUdg iF2Ipd+2zlIRyMHc9Lqeu6yiItF6nebbck/f23Ws1kxdfgI6iWsSb2uEu1cHs1kA== Received: by filterdrecv-65f68489c8-qxj4s with SMTP id filterdrecv-65f68489c8-qxj4s-1-64D4CF73-20 2023-08-10 11:52:19.644887835 +0000 UTC m=+7906576.690780058 Received: from earth.catern.com (unknown) by geopod-ismtpd-8 (SG) with ESMTP id YrZr2ykwSh6LS68yOlVeOg Thu, 10 Aug 2023 11:52:19.559 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=linkov.net Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 2C8B560155; Thu, 10 Aug 2023 07:52:19 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86h6rqwena.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 02 Jun 2023 09:46:25 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> <864jo11yvp.fsf@mail.linkov.net> <86v8g98zw6.fsf@mail.linkov.net> <86h6rqwena.fsf@mail.linkov.net> Date: Thu, 10 Aug 2023 11:52:19 +0000 (UTC) Message-ID: <87sf8ri07g.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbKLhnaci7IB7o7J6RjQ+h?= =?us-ascii?Q?mxCzwXu2GhKNyQd6qG4cZWj7ZmFMnzYKpzripTD?= =?us-ascii?Q?CD3jpiyjrNGPHmAICm0uzrOpQYJdk3bcZQg73QR?= =?us-ascii?Q?f6RE6vbJVKOJBa5FOAG9uE2mHJO49faBrNfWrT+?= =?us-ascii?Q?5idBVi=2Fw=2FK8vjMQizBmZxLXMdbuWVCOZ3=2Fg=3D=3D?= To: Juri Linkov X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Juri Linkov writes: >>>>>>>> (Tangential further thought: I wonder if we could make C-x p work >>>>>>>> as a prefix for all commands automatically, so for example >>>>>>>> C-x p C-x [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [149.72.154.232 listed in wl.mailspike.net] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Juri Linkov writes: >>>>>>>> (Tangential further thought: I wonder if we could make C-x p work >>>>>>>> as a prefix for all commands automatically, so for example >>>>>>>> C-x p C-x C-j would open the project root, >>> >>> I just noticed that 'C-x p C-x C-j' would open the parent directory >>> of the project root, not the root itself, since 'C-x C-j' in the root >>> jumps to its parent. >> >> Only in dired buffers. If not in dired, and not in a file-visiting >> buffer, it just goes to default-directory. > > You are right, I tried with the next-default-directory patch, > and it works like you described. > >> That is kind of annoying for making C-x p p C-x C-j go to the root, >> though, because its behavior will depend on the current buffer... Maybe >> C-x p p can switch buffers before running the command? > > Alas, can't switch buffers because such commands as 'C-x p g' > read the default value from the current buffer. > >> Or maybe we can just change how C-x C-j behaves so it works >> intuitively with C-x p p? > > The problem is in 'C-x C-j'. In dired buffers it uses the value of > 'dired-subdir-alist' instead of 'default-directory', so the patch with > 'next-default-directory' doesn't help. Ah, I just realized this doesn't matter. C-x C-j isn't the right command to use. The right command to use is C-x d RET, that will have consistent behavior. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 10 07:56:44 2023 Received: (at 63648) by debbugs.gnu.org; 10 Aug 2023 11:56:44 +0000 Received: from localhost ([127.0.0.1]:41584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU4HT-0007Qf-Rn for submit@debbugs.gnu.org; Thu, 10 Aug 2023 07:56:44 -0400 Received: from s.wrqvtbkv.outbound-mail.sendgrid.net ([149.72.123.24]:4844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU4HS-0007QS-Co for 63648@debbugs.gnu.org; Thu, 10 Aug 2023 07:56:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=vEAnyvyUOzuFOi+sxd89jmdxR5d03H7xjt9B48kf7Sg=; b=o3ZSBFB6+uQnJm3ViAyYwkQQfPk44sa1sItkVdPVTcvdheJiEHoIVqF197teNNqdHXD6 kfBxXtqe5VWo6baOJLVEZ4yYJNIQiOYWfxgzTBc1sOqi51cxmPOOw+n+b5V+76hvkJE/BI aflqfXpbEw39jBxGDj7nIJ02uFE21W51kBBFkNVmMYrpRLY7XPCaoWrVYQe1RmsJNRbZMc X0yfrZO1sml1KeZO1bNHvbH89uoA/63XWZ5kmv38Jx6fB030EH6tmUlE/tVmgqvVrea40j reXmQ+ZuwsWsPcLWKH/9pzsDAHpJv/M9uvPaHTCe7C1ZclgzwfeEhP6qoiaoQiyg== Received: by filterdrecv-d7bbbc8bf-nxr9l with SMTP id filterdrecv-d7bbbc8bf-nxr9l-1-64D4D074-3A 2023-08-10 11:56:36.834326247 +0000 UTC m=+7906618.920059610 Received: from earth.catern.com (unknown) by geopod-ismtpd-7 (SG) with ESMTP id DAOgYDLkRHeDX_BFj_FYPA Thu, 10 Aug 2023 11:56:36.754 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=linkov.net Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 7489860094; Thu, 10 Aug 2023 07:56:36 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86353axu48.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 02 Jun 2023 09:40:55 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> Date: Thu, 10 Aug 2023 11:56:36 +0000 (UTC) Message-ID: <87o7jfi00b.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbJqotK6NVcN+vV1sHFPZk?= =?us-ascii?Q?coyPdSypNCFPlY2VFquoyx1J8ELMK8Qrxm4VMCL?= =?us-ascii?Q?c4sLSyxigfnrriZBH18ygq4ZjfIpMBeaIwb7KW3?= =?us-ascii?Q?Ujer9cWskDs+psI3rHKqxE6ZN117se9fmvFMjiy?= =?us-ascii?Q?X1ckcJv5hSO6ix1vstcF6aTZ1=2F9mwvhHX0g=3D=3D?= To: Juri Linkov X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Juri Linkov writes: >>>>> 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 valu [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [149.72.123.24 listed in wl.mailspike.net] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Juri Linkov writes: >>>>> 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. Did this end up being discussed on emacs-devel? I am still quite interested in this feature. > 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'. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 09:53:47 2023 Received: (at 63648) by debbugs.gnu.org; 23 Aug 2023 13:53:47 +0000 Received: from localhost ([127.0.0.1]:33179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYoIt-0004Ci-Dz for submit@debbugs.gnu.org; Wed, 23 Aug 2023 09:53:47 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:54141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYoIo-0004CS-RK for 63648@debbugs.gnu.org; Wed, 23 Aug 2023 09:53:46 -0400 From: Spencer Baugh To: sbaugh@catern.com Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <87o7jfi00b.fsf@catern.com> (sbaugh@catern.com's message of "Thu, 10 Aug 2023 11:56:36 +0000 (UTC)") References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> Date: Wed, 23 Aug 2023 09:53:33 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) sbaugh@catern.com writes: > Juri Linkov writes: > >>>>>> 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. > > Did this end up being discussed on emacs-devel? I am still quite > interested in this feature. Oh, another thought (which maybe should be discussed on emacs-devel): maybe we don't need to make this specific next-default-directory var. Instead, maybe what we want is a way to bind a dynamic variable *without* changing the buffer-local value. It would shadow the existing binding, but if we explicitly switched buffer we'd get back to the old value. So we'd have: (special-let ((default-directory newval)) (assert default-directory newval)) and (special-let ((default-directory newval)) (set-buffer (current-buffer)) (assert default-directory oldval)) Ignore any complexities of implementing this and any complexities of the semantics which I haven't covered. If we had this, would it work as an alternative to next-default-directory? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 14:17:25 2023 Received: (at 63648) by debbugs.gnu.org; 23 Aug 2023 18:17:25 +0000 Received: from localhost ([127.0.0.1]:35157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYsQ1-0006O8-52 for submit@debbugs.gnu.org; Wed, 23 Aug 2023 14:17:25 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYsPw-0006Na-Vy for 63648@debbugs.gnu.org; Wed, 23 Aug 2023 14:17:22 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 8C07FE0009; Wed, 23 Aug 2023 18:17:09 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Wed, 23 Aug 2023 09:53:33 -0400") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> Date: Wed, 23 Aug 2023 20:54:11 +0300 Message-ID: <86msyhwrrg.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> 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. >> >> Did this end up being discussed on emacs-devel? I am still quite >> interested in this feature. > > Oh, another thought (which maybe should be discussed on emacs-devel): > maybe we don't need to make this specific next-default-directory var. > > Instead, maybe what we want is a way to bind a dynamic variable > *without* changing the buffer-local value. It would shadow the existing > binding, but if we explicitly switched buffer we'd get back to the old > value. So we'd have: > > (special-let ((default-directory newval)) > (assert default-directory newval)) > > and > > (special-let ((default-directory newval)) > (set-buffer (current-buffer)) > (assert default-directory oldval)) > > Ignore any complexities of implementing this and any complexities of the > semantics which I haven't covered. If we had this, would it work as an > alternative to next-default-directory? There is no code where to bind a dynamic variable, because its value should be available for the next command in the command loop. If you agree there is no other way to implement this than next-default-directory, then I could bring up the discussion on emacs-devel. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 28 18:44:39 2023 Received: (at 63648) by debbugs.gnu.org; 28 Aug 2023 22:44:39 +0000 Received: from localhost ([127.0.0.1]:49139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qakyM-0002BF-L3 for submit@debbugs.gnu.org; Mon, 28 Aug 2023 18:44:38 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:43913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qakyJ-00029M-P6 for 63648@debbugs.gnu.org; Mon, 28 Aug 2023 18:44:36 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6E5E75C0206; Mon, 28 Aug 2023 18:44:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 28 Aug 2023 18:44:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693262663; x=1693349063; bh=USutwyLdDT83zMcbUqK9vim8QLRzXxHzQ7A /X/hndX4=; b=RtKgvV/qzs6gEopJA4O8Vn1nWcJNEQAYjWLlS4ni5BcgiHp0gk3 ADtBPryMT3W7I9bpiFOQXTD0Iim4Q5FIYliaER8ZZQVeZWCjx0q5Uz+0THoTw8Ac nRxCwoirfJ43p6PxvVDqqFRU1WdRuBmHmqQWBHFmqcEdlh8z3LfiD3m+OaOkUh3U UsQ5/HotuZXTbn2QcB6xtvCoGxfp9pzaQF90FtMs8CETgm82YT4gVGcgndDxwAdM HEkC/cj/QC9peaAWG1VWHPF4ycmfJssKmRIrK/sf8gc7qEGceKwrlKR5Je3GlCis NLJ6lf6sX4C6M/SM9lKtgOhsqRxhilqE3mA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693262663; x=1693349063; bh=USutwyLdDT83zMcbUqK9vim8QLRzXxHzQ7A /X/hndX4=; b=baU8VyaIJHCmZawz0JRb2SjePH/Fv1erQqk0aEFGs9WN6cNd13q vmctXHwUga1Qvx+n33diSYXAgSA84/hPVftRp0VLMyWTt6243KywOmSEbbiVfJYG U2eNZ1lPrpsX7WU4eXTeq+7zA5Fybk6v8lmJrJpU9LNOTa9a86fXkzAfTqJ0btRx ffGBRcx8qsY0KZ9gW+Z/NV43LsikE0jxM2sYPV5RqpagNn3nEMLDbUd3BiUGEMet HpdKzCBDXE9JVw3hnM+2A7L6FvtEsmtUwW91vhSswgFDaThYC3P/KFqj6S3WFkt4 U997VCz9hNs9XdkVr73BfwaeSj3qP/lw9WQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefhedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Aug 2023 18:44:21 -0400 (EDT) Message-ID: <6480ead5-b89b-82bd-9e1e-66016ba4520c@gutov.dev> Date: Tue, 29 Aug 2023 01:44:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Spencer Baugh , sbaugh@catern.com References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 63648 Cc: 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) On 23/08/2023 16:53, Spencer Baugh wrote: > Oh, another thought (which maybe should be discussed on emacs-devel): > maybe we don't need to make this specific next-default-directory var. > > Instead, maybe what we want is a way to bind a dynamic variable > *without* changing the buffer-local value. It would shadow the existing > binding, but if we explicitly switched buffer we'd get back to the old > value. So we'd have: > > (special-let ((default-directory newval)) > (assert default-directory newval)) > > and > > (special-let ((default-directory newval)) > (set-buffer (current-buffer)) > (assert default-directory oldval)) Where does the main logic run in this case? If we call set-buffer before the main logic is ran, the old value of dd will be used. If we call set-buffer after the main logic is ran, we could as well use plain 'let' because that's what it does: restores the previous values at the end (and we know that it doesn't suit our purpose). I was also considering rebinding the global value of dd instead, but that turned out to be even sillier, since any new buffer inherits the local value of this var from the previous buffer, the global one isn't used anywhere (or doesn't seem to be). (cl-letf (((default-value 'default-directory) "~/Documents/")) (with-temp-buffer (message "dv %s" (default-value 'default-directory)) (message "lv %s" default-directory))) So to make use of this, every relevant spot would have to look up the global value of this var manually. Might as well use the special var that we already have (...-override). From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 16:34:17 2023 Received: (at 63648) by debbugs.gnu.org; 29 Aug 2023 20:34:17 +0000 Received: from localhost ([127.0.0.1]:51677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb5Pl-0007Ia-1C for submit@debbugs.gnu.org; Tue, 29 Aug 2023 16:34:17 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:43351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb5Pj-0007IN-Dv for 63648@debbugs.gnu.org; Tue, 29 Aug 2023 16:34:16 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <6480ead5-b89b-82bd-9e1e-66016ba4520c@gutov.dev> (Dmitry Gutov's message of "Tue, 29 Aug 2023 01:44:19 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <6480ead5-b89b-82bd-9e1e-66016ba4520c@gutov.dev> Date: Tue, 29 Aug 2023 16:34:02 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 23/08/2023 16:53, Spencer Baugh wrote: >> Oh, another thought (which maybe should be discussed on emacs-devel): >> maybe we don't need to make this specific next-default-directory var. >> Instead, maybe what we want is a way to bind a dynamic variable >> *without* changing the buffer-local value. It would shadow the existing >> binding, but if we explicitly switched buffer we'd get back to the old >> value. So we'd have: >> (special-let ((default-directory newval)) >> (assert default-directory newval)) >> and >> (special-let ((default-directory newval)) >> (set-buffer (current-buffer)) >> (assert default-directory oldval)) > > Where does the main logic run in this case? > > If we call set-buffer before the main logic is ran, the old value of > dd will be used. > > If we call set-buffer after the main logic is ran, we could as well > use plain 'let' because that's what it does: restores the previous > values at the end (and we know that it doesn't suit our purpose). Sorry, I was unclear - our logic wouldn't use set-buffer at all, it's just that things would work fine if user code used set-buffer. So this would work: (project-current) ;; -> (vc . oldval) (special-let ((default-directory newval)) (project-current) ;; -> (vc . newval) (with-current-buffer (current-buffer) (project-current))) ;; -> (vc . oldval) (project-current) ;; -> (vc . newval) The actual logic of project-switch-project would be: (defun project-switch-project (dir) (interactive (list (funcall project-prompter))) (let ((command (if (symbolp project-switch-commands) project-switch-commands (project--switch-project-command)))) (special-let ((default-directory dir)) (call-interactively command)))) (well, as long as (project--switch-project-command) could support reading arbitrary commands) > I was also considering rebinding the global value of dd instead, but > that turned out to be even sillier, since any new buffer inherits the > local value of this var from the previous buffer, the global one isn't > used anywhere (or doesn't seem to be). > > (cl-letf (((default-value 'default-directory) "~/Documents/")) > (with-temp-buffer > (message "dv %s" (default-value 'default-directory)) > (message "lv %s" default-directory))) > > So to make use of this, every relevant spot would have to look up the > global value of this var manually. Might as well use the special var > that we already have (...-override). Sad! From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 16:36:30 2023 Received: (at 63648) by debbugs.gnu.org; 29 Aug 2023 20:36:31 +0000 Received: from localhost ([127.0.0.1]:51681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb5Ru-0007Ls-JW for submit@debbugs.gnu.org; Tue, 29 Aug 2023 16:36:30 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:40763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb5Rs-0007Lf-KN for 63648@debbugs.gnu.org; Tue, 29 Aug 2023 16:36:29 -0400 From: Spencer Baugh To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86msyhwrrg.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 23 Aug 2023 20:54:11 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> Date: Tue, 29 Aug 2023 16:36:15 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>>>> 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. >>> >>> Did this end up being discussed on emacs-devel? I am still quite >>> interested in this feature. >> >> Oh, another thought (which maybe should be discussed on emacs-devel): >> maybe we don't need to make this specific next-default-directory var. >> >> Instead, maybe what we want is a way to bind a dynamic variable >> *without* changing the buffer-local value. It would shadow the existing >> binding, but if we explicitly switched buffer we'd get back to the old >> value. So we'd have: >> >> (special-let ((default-directory newval)) >> (assert default-directory newval)) >> >> and >> >> (special-let ((default-directory newval)) >> (set-buffer (current-buffer)) >> (assert default-directory oldval)) >> >> Ignore any complexities of implementing this and any complexities of the >> semantics which I haven't covered. If we had this, would it work as an >> alternative to next-default-directory? > > There is no code where to bind a dynamic variable, because its value > should be available for the next command in the command loop. Oh, that's true. (I guess maybe we could add a way to do that, and other prefix commands could work that way too. But that would be a big effort - and worth talking about on emacs-devel) > If you agree there is no other way to implement this than next-default-directory, > then I could bring up the discussion on emacs-devel. Yes, seems like that's the only way. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 16:40:40 2023 Received: (at 63648) by debbugs.gnu.org; 29 Aug 2023 20:40:40 +0000 Received: from localhost ([127.0.0.1]:51686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb5Vw-0007Rv-9C for submit@debbugs.gnu.org; Tue, 29 Aug 2023 16:40:40 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:58489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb5Vr-0007Rd-Hm for 63648@debbugs.gnu.org; Tue, 29 Aug 2023 16:40:38 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2F1A83200938; Tue, 29 Aug 2023 16:40:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 29 Aug 2023 16:40:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1693341621; x=1693428021; bh=UR ZvWw4loq48ktZl7O81mQO+WfDi8KJJLjVtOb053eA=; b=eB70/u+DltduLMyPEX 5E75k6uGDJtmdQECqEitn2TkaFHdYjp+3sEQMYifCpPuGn/WSIIlQYRaEKqsIHZu CSC8ZfIHXSGPvP2kvhTqIqaqNZQ5jPqC6RaKdvCwcvgsOKKgyIW7azYd/Q7M+0LJ SEpGi00tou2YIfWLGyTAmeDKJhAQxmWvc/h9ZOZmFMM2zjQ79t3lkJMnSy4b3T4N wr7K/YaGu3zLiFRwfPhMKqzxtVv6ZqtrtYXefRQtRt/4jHBr6zCEDz0zCeq3VqUV gDZigBZPLty33LS3QoVQ270A78Emz7FE2IGWmVdG5tCoV5G1t6UUtFRm7w8qGzc3 xXRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1693341621; x=1693428021; bh=URZvWw4loq48k tZl7O81mQO+WfDi8KJJLjVtOb053eA=; b=lLZ5m+o6ewdyKnnmpfGQWsmFzS/6B /L77OtGi2NZ9O1JV3X7RZLEP0t1SQGZgtVD2P6Xzqvg4XVjymBWSX2Q5YNjMUBkv Ot8yK+H3EnESPM77YXrh4gTpeFzXVzk81yrdwmWWUi+UfKbiiAmSr8aveNupeFuJ g7AuBf5IG474Pg8bXLomgciIA+tDOVaeaWydX2nMhdRPaZ4fFzcODzab8jDuPJdl 74TdTc2n1puyQHq0ja3c/m/zakmHaIIVO2b0dFtM+b83sBg/edv91/rXUQiL06Ge EoKruSAXbq+WzU7m7AJLWSOHmsDztI2mJZOOuQiXFyPTafnMKxUZbAAxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefiedgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfhffuvfevfhgjsehmtderredtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfeuieefvdehuddthfejueegfeethffhueetjedtiedvvefgjeefgedtleej feefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Aug 2023 16:40:20 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------0UHUOdqSmTCyD0GQ89kCHUbR" Message-ID: Date: Tue, 29 Aug 2023 23:40:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands To: Juri Linkov , Spencer Baugh References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> Content-Language: en-US In-Reply-To: <86msyhwrrg.fsf@mail.linkov.net> X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) This is a multi-part message in MIME format. --------------0UHUOdqSmTCyD0GQ89kCHUbR Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sorry for the possible duplicate, but it seems this message didn't reach the bug tracker, or other recipients. Resending contents below. On 23/08/2023 20:54, Juri Linkov wrote: > There is no code where to bind a dynamic variable, because its value > should be available for the next command in the command loop. > If you agree there is no other way to implement this than next-default-directory, > then I could bring up the discussion on emacs-devel. Before we dive into all that, why not try advice on 'command-execute'? For the PoC code at least. It's in Lisp since 2013. The comment in its body does say "Called directly from the C code", but I'm not sure if that has any direct implications for us. This attached piece of code implements the project-switch-project as you outlined. Does it work well for you/others? Careful when testing or modifying: a typo can break the command loop (and thus the session). To me it seems a little too bare-bones, lacking the instructive hints project-switch-project currently has. --------------0UHUOdqSmTCyD0GQ89kCHUbR Content-Type: text/x-emacs-lisp; charset=UTF-8; name="next-dd.el" Content-Disposition: attachment; filename="next-dd.el" Content-Transfer-Encoding: base64 KGRlZnZhciBwcm9qZWN0LS1uZXh0LWRkIG5pbCkKCihkZWZ1biBwcm9qZWN0LS13aXRoLW5l eHQtZGQgKGZ1biAmcmVzdCBhcmdzKQogIChhZHZpY2UtcmVtb3ZlICdjb21tYW5kLWV4ZWN1 dGUgIydwcm9qZWN0LS13aXRoLW5leHQtZGQpCiAgKGxldCAoKGRlZmF1bHQtZGlyZWN0b3J5 IHByb2plY3QtLW5leHQtZGQpKQogICAgKGFwcGx5IGZ1biBhcmdzKSkpCgooZGVmdW4gcHJv amVjdC1zd2l0Y2gtcHJvamVjdCAoZGlyKQogIChpbnRlcmFjdGl2ZSAobGlzdCAoZnVuY2Fs bCBwcm9qZWN0LXByb21wdGVyKSkpCiAgKHNldHEgcHJvamVjdC0tbmV4dC1kZCBkaXIpCiAg KGFkdmljZS1hZGQgJ2NvbW1hbmQtZXhlY3V0ZSA6YXJvdW5kICMncHJvamVjdC0td2l0aC1u ZXh0LWRkKSkK --------------0UHUOdqSmTCyD0GQ89kCHUbR-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 17:47:40 2023 Received: (at 63648) by debbugs.gnu.org; 29 Aug 2023 21:47:41 +0000 Received: from localhost ([127.0.0.1]:51742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb6Yi-0000tL-VV for submit@debbugs.gnu.org; Tue, 29 Aug 2023 17:47:40 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:51841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb6Yd-0000t0-PQ for 63648@debbugs.gnu.org; Tue, 29 Aug 2023 17:47:35 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Tue, 29 Aug 2023 23:40:19 +0300") References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> Date: Tue, 29 Aug 2023 17:47:18 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > Sorry for the possible duplicate, but it seems this message didn't > reach the bug tracker, or other recipients. Resending contents below. > > On 23/08/2023 20:54, Juri Linkov wrote: >> There is no code where to bind a dynamic variable, because its value >> should be available for the next command in the command loop. >> If you agree there is no other way to implement this than next-default-directory, >> then I could bring up the discussion on emacs-devel. > > Before we dive into all that, why not try advice on 'command-execute'? > For the PoC code at least. It's in Lisp since 2013. > > The comment in its body does say "Called directly from the C code", > but I'm not sure if that has any direct implications for us. > > This attached piece of code implements the project-switch-project as > you outlined. Does it work well for you/others? Careful when testing > or modifying: a typo can break the command loop (and thus the > session). > > To me it seems a little too bare-bones, lacking the instructive hints > project-switch-project currently has. 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. 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) > (defvar project--next-dd nil) > > (defun project--with-next-dd (fun &rest args) > (advice-remove 'command-execute #'project--with-next-dd) > (let ((default-directory project--next-dd)) > (apply fun args))) > > (defun project-switch-project (dir) > (interactive (list (funcall project-prompter))) > (setq project--next-dd dir) > (advice-add 'command-execute :around #'project--with-next-dd)) From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 18:33:05 2023 Received: (at 63648) by debbugs.gnu.org; 29 Aug 2023 22:33:05 +0000 Received: from localhost ([127.0.0.1]:51766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb7Gi-00022r-MH for submit@debbugs.gnu.org; Tue, 29 Aug 2023 18:33:04 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:33127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb7Gd-00022J-HB for 63648@debbugs.gnu.org; Tue, 29 Aug 2023 18:33:03 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id ED7BB3200258; Tue, 29 Aug 2023 18:32:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 29 Aug 2023 18:32:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693348365; x=1693434765; bh=RC9Q5gpk+3UGBt6i93hLr5jSgLJoEUdIS2j tNHePHh0=; b=Ez6nteh7gzuhlC4fQBil9Oagh/xcumWTQnTYb5bzRtlBXWNyRFq i8V82Nt4QUObKgczqDs9doGteIWxwEwzdjoa3g3JoYrLCzlN40Uwq1nNsKogsDR8 x9iw0PihD9YdxRrGpZkPgmbcuixbiVJksrar+tooShaHPRel2+OdDlGxW0J0m82V MXMrH6QFUBFclvXACVsVdUY5ejRN9D9NRT+/ofOkeoeS/FuoGFGb0hk30+x6Nh2q AfcRFTT+vSFTz9PqHFepcxcaDhlbFfyZO9uUTi2jp7JvEXHXz265ExFocyLsd0g0 wjuKQhhByaXI/316icN6zpZwL0BR4+jrxlQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693348365; x=1693434765; bh=RC9Q5gpk+3UGBt6i93hLr5jSgLJoEUdIS2j tNHePHh0=; b=C1lXNPRQZs3o4KzH36hMkmlH9Ymah0cfq539PJvdbK498Gs7HB/ C70cnm23sMj648fSiivw5zumfz6KHWyexurOgLWbhC4yxuCeX1NU0rTfC8hpE/8W Ge/LE0b2iSslhXshFlRs7NoQQlKYbt+BZ1BPfKXu95RBDfBZHabVDRcP3Ag04CLU iQBQOukRTv+rd4uBtrgE14tM1IOK7dcxJe+Oz233+vzD8Tzh73cJSY6v9Nq+7T5l 4YfxSwweITXpKm2eaAq2G2Bjt3t1X9VKNR9Bp1hh1OBlceZA35AUx0sfRLjCH1Gf jtT0Iu/a6lBBz9K9FvKSWQuK9PD4jLi08WQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefjedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Aug 2023 18:32:44 -0400 (EDT) Message-ID: <1e2d9a65-16bb-3f2f-dfbc-5e043f93b78e@gutov.dev> Date: Wed, 30 Aug 2023 01:32:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Spencer Baugh References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 30 12:40:50 2023 Received: (at 63648) by debbugs.gnu.org; 30 Aug 2023 16:40:50 +0000 Received: from localhost ([127.0.0.1]:53854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbOFN-0007Uh-KP for submit@debbugs.gnu.org; Wed, 30 Aug 2023 12:40:50 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]:36099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbOFL-0007UQ-BC for 63648@debbugs.gnu.org; Wed, 30 Aug 2023 12:40:48 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id CBBEDC000A; Wed, 30 Aug 2023 16:40:29 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Tue, 29 Aug 2023 23:40:19 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> Date: Wed, 30 Aug 2023 19:27:27 +0300 Message-ID: <86y1hs4kkg.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> There is no code where to bind a dynamic variable, because its value >> should be available for the next command in the command loop. >> If you agree there is no other way to implement this than next-default-directory, >> then I could bring up the discussion on emacs-devel. > > Before we dive into all that, why not try advice on 'command-execute'? For > the PoC code at least. It's in Lisp since 2013. Thanks for bringing up 'command-execute'. I forgot it was moved from C to Lisp, so the change is simpler and not needed to discuss on emacs-devel. Then advice on 'command-execute' will be required to support older Emacs versions in project.el. But for Emacs 30 I modified my previous patch, and the next version is below: > The comment in its body does say "Called directly from the C code", but I'm > not sure if that has any direct implications for us. Also interesting how 'command-execute' handles 'debug-on-next-call' similar to 'next-default-directory'. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=next-default-directory.patch diff --git a/lisp/simple.el b/lisp/simple.el index 05a3c4b93d6..ff665111a5d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2752,6 +2752,9 @@ oclosure-interactive-form (let ((if (cconv--interactive-helper--if f))) `(interactive ,(if (functionp if) `(funcall ',if) if)))) +(defvar next-default-directory nil + "Default directory for the next command.") + (defun command-execute (cmd &optional record-flag keys special) ;; BEWARE: Called directly from the C code. "Execute CMD as an editor command. @@ -2803,7 +2806,11 @@ command-execute (execute-kbd-macro final prefixarg)) (t ;; Pass `cmd' rather than `final', for the backtrace's sake. - (prog1 (call-interactively cmd record-flag keys) + (prog1 (if next-default-directory + (let ((default-directory next-default-directory)) + (prog1 (call-interactively cmd record-flag keys) + (setq next-default-directory nil))) + (call-interactively cmd record-flag keys)) (when-let ((info (and (symbolp cmd) (not (get cmd 'command-execute-obsolete-warned)) diff --git a/lisp/window.el b/lisp/window.el index b9b032c33e9..006531ab017 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9122,7 +9114,8 @@ display-buffer-override-next-command (> (minibuffer-depth) minibuffer-depth) ;; But don't remove immediately after ;; adding the hook by the same command below. - (eq this-command command)) + (eq this-command command) + (eq this-command 'project-switch-project)) (funcall exitfun)))) ;; Call post-function after the next command finishes (bug#49057). (add-hook 'post-command-hook postfun) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7aaf7a9f9fb..f87bb750e23 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -193,9 +193,10 @@ project-find-functions 'project-current-directory-override "29.1") -(defvar project-current-directory-override nil - "Value to use instead of `default-directory' when detecting the project. -When it is non-nil, `project-current' will always skip prompting too.") +(define-obsolete-variable-alias + 'project-current-directory-override + 'next-default-directory + "30.1") (defcustom project-prompter #'project-prompt-project-dir "Function to call to prompt for a project. @@ -227,12 +228,11 @@ project-current See the doc string of `project-find-functions' for the general form of the project instance object." - (unless directory (setq directory (or project-current-directory-override - default-directory))) + (unless directory (setq directory default-directory)) (let ((pr (project--find-in-directory directory))) (cond (pr) - ((unless project-current-directory-override + ((unless next-default-directory maybe-prompt) (setq directory (funcall project-prompter) pr (project--find-in-directory directory)))) @@ -846,8 +846,8 @@ project-prefix-map ;;;###autoload (define-key ctl-x-map "p" project-prefix-map) -;; We can't have these place-specific maps inherit from -;; project-prefix-map because project--other-place-command needs to +;; Maybe we can have these place-specific maps inherit from +;; project-prefix-map because set-transient-map maybe needs to ;; know which map the key binding came from, as if it came from one of ;; these maps, we don't want to set display-buffer-overriding-action @@ -863,16 +863,6 @@ project-other-frame-map map) "Keymap for project commands that display buffers in other frames.") -(defun project--other-place-command (action &optional map) - (let* ((key (read-key-sequence-vector nil t)) - (place-cmd (lookup-key map key)) - (generic-cmd (lookup-key project-prefix-map key)) - (switch-to-buffer-obey-display-actions t) - (display-buffer-overriding-action (unless place-cmd action))) - (if-let ((cmd (or place-cmd generic-cmd))) - (call-interactively cmd) - (user-error "%s is undefined" (key-description key))))) - ;;;###autoload (defun project-other-window-command () "Run project command, displaying resultant buffer in another window. @@ -882,9 +872,10 @@ project-other-window-command \\{project-prefix-map} \\{project-other-window-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-window) - (inhibit-same-window . t)) - project-other-window-map)) + (let ((inhibit-message t)) (other-window-prefix)) + (message "Display next project command buffer in a new window...") + (set-transient-map (make-composed-keymap project-prefix-map + project-other-window-map))) ;;;###autoload (define-key ctl-x-4-map "p" #'project-other-window-command) @@ -897,8 +888,10 @@ project-other-frame-command \\{project-prefix-map} \\{project-other-frame-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-frame)) - project-other-frame-map)) + (let ((inhibit-message t)) (other-frame-prefix)) + (message "Display next project command buffer in a new frame...") + (set-transient-map (make-composed-keymap project-prefix-map + project-other-frame-map))) ;;;###autoload (define-key ctl-x-5-map "p" #'project-other-frame-command) @@ -910,7 +903,9 @@ project-other-tab-command \\{project-prefix-map}" (interactive) - (project--other-place-command '((display-buffer-in-new-tab)))) + (let ((inhibit-message t)) (other-tab-prefix)) + (message "Display next project command buffer in a new tab...") + (set-transient-map project-prefix-map)) ;;;###autoload (when (bound-and-true-p tab-prefix-map) @@ -993,13 +988,13 @@ project--find-default-from "Ensure FILENAME is in PROJECT. Usually, just return FILENAME. But if -`project-current-directory-override' is set, adjust it to be +`next-default-directory' is set, adjust it to be relative to PROJECT instead. This supports using a relative file name from the current buffer when switching projects with `project-switch-project' and then using a command like `project-find-file'." - (if-let (filename-proj (and project-current-directory-override + (if-let (filename-proj (and next-default-directory (project-current nil default-directory))) ;; file-name-concat requires Emacs 28+ (concat (file-name-as-directory (project-root project)) @@ -1893,16 +1888,17 @@ project-switch-commands (character :tag "Explicit key")))) (symbol :tag "Single command"))) -(defcustom project-switch-use-entire-map nil - "Whether `project-switch-project' will use the entire `project-prefix-map'. -If nil, `project-switch-project' will only recognize commands -listed in `project-switch-commands', and will signal an error -when other commands are invoked. If this is non-nil, all the -keys in `project-prefix-map' are valid even if they aren't -listed in the dispatch menu produced from `project-switch-commands'." - :type 'boolean - :group 'project - :version "28.1") +;; OBSOLETE? +;; (defcustom project-switch-use-entire-map nil +;; "Whether `project-switch-project' will use the entire `project-prefix-map'. +;; If nil, `project-switch-project' will only recognize commands +;; listed in `project-switch-commands', and will signal an error +;; when other commands are invoked. If this is non-nil, all the +;; keys in `project-prefix-map' are valid even if they aren't +;; listed in the dispatch menu produced from `project-switch-commands'." +;; :type 'boolean +;; :group 'project +;; :version "28.1") (defcustom project-key-prompt-style (if (facep 'help-key-binding) t @@ -1938,39 +1934,6 @@ project--keymap-prompt project-switch-commands " ")) -(defun project--switch-project-command () - (let* ((commands-menu - (mapcar - (lambda (row) - (if (characterp (car row)) - ;; Deprecated format. - ;; XXX: Add a warning about it? - (reverse row) - row)) - project-switch-commands)) - (commands-map - (let ((temp-map (make-sparse-keymap))) - (set-keymap-parent temp-map project-prefix-map) - (dolist (row commands-menu temp-map) - (when-let ((cmd (nth 0 row)) - (keychar (nth 2 row))) - (define-key temp-map (vector keychar) cmd))))) - command) - (while (not command) - (let* ((overriding-local-map commands-map) - (choice (read-key-sequence (project--keymap-prompt)))) - (when (setq command (lookup-key commands-map choice)) - (unless (or project-switch-use-entire-map - (assq command commands-menu)) - ;; TODO: Add some hint to the prompt, like "key not - ;; recognized" or something. - (setq command nil))) - (let ((global-command (lookup-key (current-global-map) choice))) - (when (memq global-command - '(keyboard-quit keyboard-escape-quit)) - (call-interactively global-command))))) - command)) - ;;;###autoload (defun project-switch-project (dir) "\"Switch\" to another project by running an Emacs command. @@ -1980,11 +1943,18 @@ project-switch-project When called in a program, it will use the project corresponding to directory DIR." (interactive (list (funcall project-prompter))) - (let ((command (if (symbolp project-switch-commands) - project-switch-commands - (project--switch-project-command)))) - (let ((project-current-directory-override dir)) - (call-interactively command)))) + (if (symbolp project-switch-commands) + (let ((default-directory dir)) + (call-interactively project-switch-commands)) + (let* ((echofun (lambda () "[switch-project]")) + (postfun (lambda () (remove-hook + 'prefix-command-echo-keystrokes-functions + echofun)))) + (setq next-default-directory dir) + (message (project--keymap-prompt)) + (add-hook 'prefix-command-echo-keystrokes-functions echofun) + (prefix-command-preserve-state) + (set-transient-map project-prefix-map nil postfun)))) ;;;###autoload (defun project-uniquify-dirname-transform (dirname) diff --git a/test/lisp/progmodes/project-tests.el b/test/lisp/progmodes/project-tests.el index 5a206b67db1..bc8c0553f40 100644 --- a/test/lisp/progmodes/project-tests.el +++ b/test/lisp/progmodes/project-tests.el @@ -41,7 +41,7 @@ project/quoted-directory (skip-unless (executable-find "grep")) (ert-with-temp-directory directory (let ((default-directory directory) - (project-current-directory-override t) + (next-default-directory directory) (project-find-functions nil) (project-list-file (expand-file-name "projects" directory)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 30 22:02:05 2023 Received: (at 63648) by debbugs.gnu.org; 31 Aug 2023 02:02:05 +0000 Received: from localhost ([127.0.0.1]:54378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbX0X-00054X-5i for submit@debbugs.gnu.org; Wed, 30 Aug 2023 22:02:05 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:58147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbX0R-00053w-S2 for 63648@debbugs.gnu.org; Wed, 30 Aug 2023 22:02:03 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9D2425C003B; Wed, 30 Aug 2023 22:01:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 30 Aug 2023 22:01:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693447306; x=1693533706; bh=LMAy9m4bVQN++W5kpwPZP0oENMLV2Rab0HI pzOWh0/A=; b=m1TQ2hUCB+W3Ne8QiyA4n7canumJl0vm8QnqgGSQv7Gvf29iMfN yRdFM3HX2fr4RBdhf3Q8n2bEqqnHetWZtPv/cH1LTxP3J12U4ux2bsQlxocrQu4/ BXZIibkrTuOEkO6XabdTUHrrpQg8jlb0OyeQ2xhdYriqWrkpq4G3Emo57EYhDwiZ H54AyhmkyzZRCl0ZLA9HohdtPgOlGwSPVfFGZ1tac5KS8g7QARfOxeWoBfjiHc9a yIHn3ZVQXfiVDeAfQfv1i55hY/3PZ9Su10NyeyvBezcOCivn2he8MVH5BEh1aVfg xdy/M1wfynUd/FN6y8t61QYbVwfZt2Y2IcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693447306; x=1693533706; bh=LMAy9m4bVQN++W5kpwPZP0oENMLV2Rab0HI pzOWh0/A=; b=wfdh3BZviV0hBZe2bq6aXU2JPa6GqsXnzqxXv4S5AAz//Ewgyhl uyl/JezQs/C3IKWumt5kifHmXQUQxlnUC2ANimWsTcZuy+C3uLLv5kfJrrmSCLUv /7sVebByX1jhfOVNIWCjHILDYepg6BXHkmNUdRRo/G5bBU2aB1zggEE3swJBpncs HaZGSWVmgSCCc80geTPhOiRDeSaLcJkFFMpOBE048Wvr+e/iGZs6SG0/Epa6ZFpU mlu+IOT3Qte4BKsel4xvZFiRDbDFP3b3oxjYQDDZfakzaq0LiAt0Tcz5wAHuuUgc KUEjMwscYpJXi3aUOQutt8lnnbXl5S7AV3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefledghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfeutdekveeggeetteekfeejffegudduudfhueevleeftdffffeggeeivddv jeelnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 30 Aug 2023 22:01:45 -0400 (EDT) Message-ID: Date: Thu, 31 Aug 2023 05:01:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86y1hs4kkg.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) On 30/08/2023 19:27, Juri Linkov wrote: >>> There is no code where to bind a dynamic variable, because its value >>> should be available for the next command in the command loop. >>> If you agree there is no other way to implement this than next-default-directory, >>> then I could bring up the discussion on emacs-devel. >> Before we dive into all that, why not try advice on 'command-execute'? For >> the PoC code at least. It's in Lisp since 2013. > Thanks for bringing up 'command-execute'. I forgot it was moved from C to Lisp, > so the change is simpler and not needed to discuss on emacs-devel. Then advice > on 'command-execute' will be required to support older Emacs versions in project.el. > But for Emacs 30 I modified my previous patch, and the next version is below: > >> The comment in its body does say "Called directly from the C code", but I'm >> not sure if that has any direct implications for us. > Also interesting how 'command-execute' handles 'debug-on-next-call' > similar to 'next-default-directory'. I've tried the patch a little bit, some more impressions: - Unfortunately, using default-directory instead of the specialized variable which we added lately (project-current-directory-override) brings back the bug it was added for: https://debbugs.gnu.org/58784. The switch to a different design didn't fix the problem of the temporary binding for d-d in the buffer which is current when the command is executed. So adding the next-default-directory variable might not be the best idea after all. But the advice thingy can set a binding for any variable, including the *-override one. - I also managed to get into some transient state where some chars were doing one thing (their usual bindings), and some - invoked project commands instead, with no apparent method of quitting that state. Maybe I'll document it next time I see it. - Using (project--keymap-prompt) for just a message call is cute, but I personally like the "guardrails": if I accidentally type a wrong char when choosing the command, I won't have to choose the other project again. This is debatable, but both modes of operation are probably worth keeping available (opinions welcome). - Either way, with method with the advice should be useful for other things, like project--other-place-command. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 03:03:31 2023 Received: (at 63648) by debbugs.gnu.org; 31 Aug 2023 07:03:31 +0000 Received: from localhost ([127.0.0.1]:54742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbbiF-0004oq-0K for submit@debbugs.gnu.org; Thu, 31 Aug 2023 03:03:31 -0400 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:47277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbbi7-0004o7-0a for 63648@debbugs.gnu.org; Thu, 31 Aug 2023 03:03:25 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 7FF56FF805; Thu, 31 Aug 2023 07:03:06 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Thu, 31 Aug 2023 05:01:41 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> Date: Thu, 31 Aug 2023 09:47:00 +0300 Message-ID: <86h6of66o3.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I've tried the patch a little bit, some more impressions: > > - Unfortunately, using default-directory instead of the specialized > variable which we added lately (project-current-directory-override) > brings back the bug it was added for: https://debbugs.gnu.org/58784. The > switch to a different design didn't fix the problem of the temporary > binding for d-d in the buffer which is current when the command is > executed. So adding the next-default-directory variable might not be the > best idea after all. But the advice thingy can set a binding for any > variable, including the *-override one. I didn't test yet the cases from bug#58784. So this might require more changes. > - I also managed to get into some transient state where some chars were > doing one thing (their usual bindings), and some - invoked project > commands instead, with no apparent method of quitting that state. Maybe > I'll document it next time I see it. It would be nice to have a reproducible test case. But indeed chars in the project map invoke the project commands, and all other chars fall back to local/global keybindings. > - Using (project--keymap-prompt) for just a message call is cute, but > I personally like the "guardrails": if I accidentally type a wrong char > when choosing the command, I won't have to choose the other project > again. This is debatable, but both modes of operation are probably worth > keeping available (opinions welcome). This is easy to do with something like in 'y-or-n-p-map'. > - Either way, with method with the advice should be useful for other > things, like project--other-place-command. It's not recommended to use advice in the core packages, maybe only for providing backward-compatibility with older versions. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 07:14:07 2023 Received: (at 63648) by debbugs.gnu.org; 31 Aug 2023 11:14:07 +0000 Received: from localhost ([127.0.0.1]:55054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbfcl-0008G0-2m for submit@debbugs.gnu.org; Thu, 31 Aug 2023 07:14:07 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:60187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbfcj-0008FM-6r for 63648@debbugs.gnu.org; Thu, 31 Aug 2023 07:14:05 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C50EA5C00D6; Thu, 31 Aug 2023 07:13:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 31 Aug 2023 07:13:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693480429; x=1693566829; bh=ayDn+6bx2P8JVZOz9/gjdQEsUlD/4y03n1t eVQbIoiU=; b=gv6jiSWFW998Po56Hkpo0AhvxEX0VElfTLxq839j2QIuAJdeV2S 2O/0mVrGfZjkxLXZlrmp9ewA2M1sHsXrCELZN2VYvzFqUdy5TrlY0otomydv/R2k Au216/TMcyfdwwro90c47h3vAdpfUFovWgsXKh+Jfn8gAysOpNQpTCyiEdFwXpeU mzlw25mAQiusk2xX8dGf4eckQjHv5K5Duk71/1i25hHgaCeZ50vhaG9v2sh2e14q ZuOQOWqE8/EJUS3N+6jnEq2lYhDJlHAh1zh/uumE0ucMlMcki/YlQPWmOvmXwVzj iEpWVuMOqJDPIJpPtKNSt8miiXpG00WM1ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693480429; x=1693566829; bh=ayDn+6bx2P8JVZOz9/gjdQEsUlD/4y03n1t eVQbIoiU=; b=f4YSKvgipQ4LHiyLNH5wEDuSohP9fXSRI+PKwfL3gUs/IP+IWks JCqB6NelRDUdv3YVsn5Rzf776Sa1wIWDlKUyjiKI+aA4zbYWuX7VLvJPZy/34INY K9QXsVViqMbgHBww7E3Fpmp/SpXeeLoPqe6OdmYUhZQJFtHLNs2fcXtYLqZ6hbF+ 3mBR0fCOYK/NCQ5dwlmK909fI6XwKUGkHtgNt5UploFDqLSN910YpI2eC4Le3mBn bwIsHwWU+AFFxULzk7Vy5gFqjlTFimtvKBojwdlfYKG9ISmhFNbx04QKWB0dM4M+ lxaQmMutNiDgxx7ceucn278uXQQ+0P64QJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegtddgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfeutdekveeggeetteekfeejffegudduudfhueevleeftdffffeggeeivddv jeelnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Aug 2023 07:13:48 -0400 (EDT) Message-ID: Date: Thu, 31 Aug 2023 14:13:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86h6of66o3.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) On 31/08/2023 09:47, Juri Linkov wrote: >> I've tried the patch a little bit, some more impressions: >> >> - Unfortunately, using default-directory instead of the specialized >> variable which we added lately (project-current-directory-override) >> brings back the bug it was added for: https://debbugs.gnu.org/58784. The >> switch to a different design didn't fix the problem of the temporary >> binding for d-d in the buffer which is current when the command is >> executed. So adding the next-default-directory variable might not be the >> best idea after all. But the advice thingy can set a binding for any >> variable, including the *-override one. > > I didn't test yet the cases from bug#58784. So this might require more changes. We tried to make the default-directory binding work with a couple of different changes - it didn't work out. >> - I also managed to get into some transient state where some chars were >> doing one thing (their usual bindings), and some - invoked project >> commands instead, with no apparent method of quitting that state. Maybe >> I'll document it next time I see it. > > It would be nice to have a reproducible test case. > But indeed chars in the project map invoke the project commands, > and all other chars fall back to local/global keybindings. > >> - Using (project--keymap-prompt) for just a message call is cute, but >> I personally like the "guardrails": if I accidentally type a wrong char >> when choosing the command, I won't have to choose the other project >> again. This is debatable, but both modes of operation are probably worth >> keeping available (opinions welcome). > > This is easy to do with something like in 'y-or-n-p-map'. With setting that (or similar) keymap as a transient keymap? >> - Either way, with method with the advice should be useful for other >> things, like project--other-place-command. > > It's not recommended to use advice in the core packages, > maybe only for providing backward-compatibility with older versions. Sure, but it should also be permissible when there is no other way to do a thing. OTOH, if we're talking about new features in core, we could have a next-command-variables-alist, where we'd bind any variables that we would want. A general question regarding this approach, for me, is: is a "prefix command" a real command? And would they "swallow" these prepared variable bindings too early? From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 12:43:21 2023 Received: (at 63648) by debbugs.gnu.org; 31 Aug 2023 16:43:21 +0000 Received: from localhost ([127.0.0.1]:56935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbklM-0002uY-W6 for submit@debbugs.gnu.org; Thu, 31 Aug 2023 12:43:21 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:34159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbklJ-0002u6-KU for 63648@debbugs.gnu.org; Thu, 31 Aug 2023 12:43:18 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3D8EAC0003; Thu, 31 Aug 2023 16:43:00 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Thu, 31 Aug 2023 14:13:46 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> Date: Thu, 31 Aug 2023 19:36:29 +0300 Message-ID: <86wmxb2qvh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> - Unfortunately, using default-directory instead of the specialized >>> variable which we added lately (project-current-directory-override) >>> brings back the bug it was added for: https://debbugs.gnu.org/58784. The >>> switch to a different design didn't fix the problem of the temporary >>> binding for d-d in the buffer which is current when the command is >>> executed. So adding the next-default-directory variable might not be the >>> best idea after all. But the advice thingy can set a binding for any >>> variable, including the *-override one. >> I didn't test yet the cases from bug#58784. So this might require more >> changes. > > We tried to make the default-directory binding work with a couple of > different changes - it didn't work out. The problem is that let-binding overrides the buffer-local value: ``` (let ((default-directory "/tmp/")) (list default-directory (buffer-local-value 'default-directory (current-buffer)))) => ("/tmp/" "/tmp/") ``` Here is the shortest test case: 'C-x p p C-b' shows buffers from two projects when using let-binding for default-directory, because 'project-buffers' relies on (buffer-local-value 'default-directory buf) This could be fixed by adding special-handling of the default-directory for the current buffer in 'project-buffers'. >>> - I also managed to get into some transient state where some chars were >>> doing one thing (their usual bindings), and some - invoked project >>> commands instead, with no apparent method of quitting that state. Maybe >>> I'll document it next time I see it. >> It would be nice to have a reproducible test case. >> But indeed chars in the project map invoke the project commands, >> and all other chars fall back to local/global keybindings. >> >>> - Using (project--keymap-prompt) for just a message call is cute, but >>> I personally like the "guardrails": if I accidentally type a wrong char >>> when choosing the command, I won't have to choose the other project >>> again. This is debatable, but both modes of operation are probably worth >>> keeping available (opinions welcome). >> This is easy to do with something like in 'y-or-n-p-map'. > > With setting that (or similar) keymap as a transient keymap? Something like this. >>> - Either way, with method with the advice should be useful for other >>> things, like project--other-place-command. >> It's not recommended to use advice in the core packages, >> maybe only for providing backward-compatibility with older versions. > > Sure, but it should also be permissible when there is no other way to do > a thing. > > OTOH, if we're talking about new features in core, we could have > a next-command-variables-alist, where we'd bind any variables that we would > want. Such generalization could be added later. > A general question regarding this approach, for me, is: is a "prefix > command" a real command? It's a real command that prepares some transient values for the next command. Most existing prefix commands have no problems because they modify global values. But 'default-directory' is the first buffer-local variable used for the next command, therefore it requires special-handling. Too bad that 'default-directory' is not a function. > And would they "swallow" these prepared variable bindings too early? The scope of the modified variable depends on concrete needs. For example, set-transient-map restores its old value in pre-command-hook, but display-buffer-override-next-command does this in post-command-hook. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 21:12:01 2023 Received: (at 63648) by debbugs.gnu.org; 1 Sep 2023 01:12:01 +0000 Received: from localhost ([127.0.0.1]:59498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbshc-0001GS-TO for submit@debbugs.gnu.org; Thu, 31 Aug 2023 21:12:01 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:51301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbshb-0001GF-Fd for 63648@debbugs.gnu.org; Thu, 31 Aug 2023 21:12:00 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 2B3F3320039A; Thu, 31 Aug 2023 21:11:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 31 Aug 2023 21:11:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693530703; x=1693617103; bh=cwwxBVHoswxO4PKTx+dqSNoIXMnRklsY11j 246wypsU=; b=I8pdLgOVgRBKYLprZ6WVsnrFxhUJKrFnpcGvRsYoi5kUxGYLKPC gJWJbT8Noh3/I6dwMGqVLn5cZdWzwjTAwA0+iDFZ1ViL75hsDo89uIToz/mb/Bh6 56L7u/sMBLMTLZjDZXKvUC+5h9EElIDEqzfQfmGiK6s2vHgPgk/V9zZgBAUk/BI8 ujkpgOzjWu2Kbm0QaFrYKBstiJUvtZACl0CzgojitmTM0bN4zibGFxLSxnuDvkPj j35j8oid5aETtXOgcuMlNATVmhhY49M+O/JcfnfbBetbdQSlkb/S9/vCeD7lGBTt okbE4b6r726g6JIOUtTA9rJDbPmksvW+/oQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693530703; x=1693617103; bh=cwwxBVHoswxO4PKTx+dqSNoIXMnRklsY11j 246wypsU=; b=SKsXKHDftay17UYst3q/p2VhkYq3VelLxoG56kIY4u5K9z5zlr7 C9CXf6beWgbJLsMd1g4FX9O5RAKLv3ZzrkT7sb+RNrOcurD6wZ6BxhNCWyIjeST9 q+hDtjbbkLZ2y2ry/4iPd2FiBHxbmUFr4UFb2dNYQPjFd9oc2+2QaJPHaioKVdgz JgXWAzhB1HTrh5PPa2Dp74HN7yGXoS/j+OBAyBx5yys7LWs31adIojENvTqe1Ao8 icmNz8HkmW1epNAtFbc4foXk9g3NC2eJulJZGVj0EPOYnFdrZm5EiqCmqPlu/OZb Dn6t4KGGvjdAxrqUaEBI/OE39XBQBsCu07A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeguddggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfeutdekveeggeetteekfeejffegudduudfhueevleeftdffffeggeeivddv jeelnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Aug 2023 21:11:41 -0400 (EDT) Message-ID: Date: Fri, 1 Sep 2023 04:11:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86wmxb2qvh.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) On 31/08/2023 19:36, Juri Linkov wrote: >>>> - Unfortunately, using default-directory instead of the specialized >>>> variable which we added lately (project-current-directory-override) >>>> brings back the bug it was added for: https://debbugs.gnu.org/58784. The >>>> switch to a different design didn't fix the problem of the temporary >>>> binding for d-d in the buffer which is current when the command is >>>> executed. So adding the next-default-directory variable might not be the >>>> best idea after all. But the advice thingy can set a binding for any >>>> variable, including the *-override one. >>> I didn't test yet the cases from bug#58784. So this might require more >>> changes. >> >> We tried to make the default-directory binding work with a couple of >> different changes - it didn't work out. > > The problem is that let-binding overrides the buffer-local value: Yep. > ``` > (let ((default-directory "/tmp/")) > (list default-directory > (buffer-local-value 'default-directory (current-buffer)))) > => ("/tmp/" "/tmp/") > ``` > > Here is the shortest test case: 'C-x p p C-b' shows buffers > from two projects when using let-binding for default-directory, > because 'project-buffers' relies on > > (buffer-local-value 'default-directory buf) > > This could be fixed by adding special-handling of the default-directory > for the current buffer in 'project-buffers'. What kind of special handling? The "real" buffer-local value is hidden until the "let" exists, the global value is nil, and if the buffer is not a file-visiting one, there is no other file name to test against. Finally, whatever special handling we invent, would have to be mirrored by all subsequent new commands (built-in and third-party) which look up the value of default-directory. Especially project-related ones. How to popularize that knowledge, would be the next question for whatever solution we invent. >> A general question regarding this approach, for me, is: is a "prefix >> command" a real command? > > It's a real command that prepares some transient values for the next command. > Most existing prefix commands have no problems because they modify global > values. But 'default-directory' is the first buffer-local variable > used for the next command, therefore it requires special-handling. > Too bad that 'default-directory' is not a function. I suppose the new code could check against some property or dynamic var to distinguish prefix commands from "terminal" ones. >> And would they "swallow" these prepared variable bindings too early? > > The scope of the modified variable depends on concrete needs. > For example, set-transient-map restores its old value in pre-command-hook, > but display-buffer-override-next-command does this in post-command-hook. That can also work - though the odds of getting into an unrecoverable state (such as one I described) would be higher. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 03:04:56 2023 Received: (at 63648) by debbugs.gnu.org; 1 Sep 2023 07:04:56 +0000 Received: from localhost ([127.0.0.1]:59759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbyD9-0004fv-R5 for submit@debbugs.gnu.org; Fri, 01 Sep 2023 03:04:56 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:34897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbyD7-0004ff-OI for 63648@debbugs.gnu.org; Fri, 01 Sep 2023 03:04:54 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 289014000A; Fri, 1 Sep 2023 07:04:34 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Fri, 1 Sep 2023 04:11:40 +0300") Organization: LINKOV.NET References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> Date: Fri, 01 Sep 2023 09:46:27 +0300 Message-ID: <8634zyjt0k.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> (let ((default-directory "/tmp/")) >> (list default-directory >> (buffer-local-value 'default-directory (current-buffer)))) >> => ("/tmp/" "/tmp/") >> Here is the shortest test case: 'C-x p p C-b' shows buffers >> from two projects when using let-binding for default-directory, >> because 'project-buffers' relies on >> (buffer-local-value 'default-directory buf) >> This could be fixed by adding special-handling of the default-directory >> for the current buffer in 'project-buffers'. > > What kind of special handling? The "real" buffer-local value is hidden > until the "let" exists, the global value is nil, and if the buffer is not > a file-visiting one, there is no other file name to test against. Additional buffer-local variable like 'buffer-default-directory' could help. Or additional global variable 'global-default-directory'. Or even using the global value of the existing variable 'default-directory'. > Finally, whatever special handling we invent, would have to be mirrored by > all subsequent new commands (built-in and third-party) which look up the > value of default-directory. Especially project-related ones. How to > popularize that knowledge, would be the next question for whatever solution > we invent. Hopefully there should be not much trouble such as in 'project-buffers'. >>> A general question regarding this approach, for me, is: is a "prefix >>> command" a real command? >> It's a real command that prepares some transient values for the next >> command. >> Most existing prefix commands have no problems because they modify global >> values. But 'default-directory' is the first buffer-local variable >> used for the next command, therefore it requires special-handling. >> Too bad that 'default-directory' is not a function. > > I suppose the new code could check against some property or dynamic var to > distinguish prefix commands from "terminal" ones. Currently I see no need for this. >>> And would they "swallow" these prepared variable bindings too early? >> The scope of the modified variable depends on concrete needs. >> For example, set-transient-map restores its old value in pre-command-hook, >> but display-buffer-override-next-command does this in post-command-hook. > > That can also work - though the odds of getting into an unrecoverable state > (such as one I described) would be higher. This is strange, no one reported an unrecoverable state for set-transient-map. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 05:53:23 2023 Received: (at 63648) by debbugs.gnu.org; 1 Sep 2023 09:53:23 +0000 Received: from localhost ([127.0.0.1]:59894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc0qA-0000aI-NK for submit@debbugs.gnu.org; Fri, 01 Sep 2023 05:53:23 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:39713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc0q8-0000a3-OL for 63648@debbugs.gnu.org; Fri, 01 Sep 2023 05:53:21 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8891B3200926; Fri, 1 Sep 2023 05:53:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 01 Sep 2023 05:53:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693561985; x=1693648385; bh=ljX6vArHzwX7PPNuoN749XdGX/98fR3qO2i u4bQCck8=; b=b68Gl3kl5V3BidlSKif1GsiwoFUu2nyC37g2iGiWehKhI36EI3J rF71u09uSZFzYBkj79J1Sd3d+epe1e/hrhii8+E4lb6+9d831TeC/yLpjZcTt0pK Vut29UOLI4uwDBhF/aUJT9oUDA0aW3RFCgedeeqZ1+6m/RXisu831prziTUW076Y 9c9T5CY1oqqNcBtRynRHQ/E99e97Vw3rbO51TKC52tTQI0fjMh2oh7o7K/3kMP3G WGNHx+vC8w7xTAqb6rb9ut7AWB/YZ9W5m4xoTttJiEAJFeayx+0yeWkZ6ifs+1wK PndwimM4xyNEhtlYc1H9FTnhp5EJX0RIZWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693561985; x=1693648385; bh=ljX6vArHzwX7PPNuoN749XdGX/98fR3qO2i u4bQCck8=; b=zLyyABRcuoWPdeOOinNitkDVsz3scnDhFx14vsmSyDecyyBJMTN 0vUcijbhpM73gXe2cveYBWRnKGPp5G10dU0HqnYDAcwACbg/Smif1w7Z/tGQgl0K HdAubmADmz1lxHa4X5TpjRzR/0Cz55CTo+OssT3QM0vBrBOKEA66XPvJdYrDtXDy +J4R81AeHxOmCK7OTym1PxzQoiKaIkEUmXJkjjux1RySHLiuIL/YtG61S+tVwwJk SgnQM46+Yk60soKsPR/fPyPRsD7XYVrfZYqqnKP8KqJHffrM7kgHVC3xiSC4a3j9 TdkKY9qK6kxBpy22dj2EYl7Nol2eJudN1JA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegvddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Sep 2023 05:53:03 -0400 (EDT) Message-ID: <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> Date: Fri, 1 Sep 2023 12:53:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wn10e1wl.fsf@mail.linkov.net> <482a1ebc-165c-a0a4-98c0-5c404d1b1d0d@gutov.dev> <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <8634zyjt0k.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) On 01/09/2023 09:46, Juri Linkov wrote: >>> (let ((default-directory "/tmp/")) >>> (list default-directory >>> (buffer-local-value 'default-directory (current-buffer)))) >>> => ("/tmp/""/tmp/") >>> Here is the shortest test case: 'C-x p p C-b' shows buffers >>> from two projects when using let-binding for default-directory, >>> because 'project-buffers' relies on >>> (buffer-local-value 'default-directory buf) >>> This could be fixed by adding special-handling of the default-directory >>> for the current buffer in 'project-buffers'. >> What kind of special handling? The "real" buffer-local value is hidden >> until the "let" exists, the global value is nil, and if the buffer is not >> a file-visiting one, there is no other file name to test against. > Additional buffer-local variable like 'buffer-default-directory' could help. > Or additional global variable 'global-default-directory'. Or even > using the global value of the existing variable 'default-directory'. What code would use it instead of the local value of default-directory? Only project-related code? Or other code as well? If it's the former, we have an existing variable in the project package. If the latter, we'd need some formal description of those usage rules to proceed. >> Finally, whatever special handling we invent, would have to be mirrored by >> all subsequent new commands (built-in and third-party) which look up the >> value of default-directory. Especially project-related ones. How to >> popularize that knowledge, would be the next question for whatever solution >> we invent. > Hopefully there should be not much trouble such as in 'project-buffers'. I think there exists a class of commands (existing and potential ones) that would use default-directory with exact same purpose and expectations. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 11:59:59 2023 Received: (at 63648) by debbugs.gnu.org; 1 Sep 2023 15:59:59 +0000 Received: from localhost ([127.0.0.1]:33709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc6Yx-0006tJ-0T for submit@debbugs.gnu.org; Fri, 01 Sep 2023 11:59:59 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc6Yv-0006t3-2Q for 63648@debbugs.gnu.org; Fri, 01 Sep 2023 11:59:58 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> (Dmitry Gutov's message of "Fri, 1 Sep 2023 12:53:02 +0300") References: <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> Date: Fri, 01 Sep 2023 11:59:41 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 01/09/2023 09:46, Juri Linkov wrote: >>>> (let ((default-directory "/tmp/")) >>>> (list default-directory >>>> (buffer-local-value 'default-directory (current-buffer)))) >>>> => ("/tmp/""/tmp/") >>>> Here is the shortest test case: 'C-x p p C-b' shows buffers >>>> from two projects when using let-binding for default-directory, >>>> because 'project-buffers' relies on >>>> (buffer-local-value 'default-directory buf) >>>> This could be fixed by adding special-handling of the default-directory >>>> for the current buffer in 'project-buffers'. >>> What kind of special handling? The "real" buffer-local value is hidden >>> until the "let" exists, the global value is nil, and if the buffer is not >>> a file-visiting one, there is no other file name to test against. >> Additional buffer-local variable like 'buffer-default-directory' could help. >> Or additional global variable 'global-default-directory'. Or even >> using the global value of the existing variable 'default-directory'. > > What code would use it instead of the local value of > default-directory? Only project-related code? Or other code as well? > If it's the former, we have an existing variable in the project > package. If the latter, we'd need some formal description of those > usage rules to proceed. > >>> Finally, whatever special handling we invent, would have to be mirrored by >>> all subsequent new commands (built-in and third-party) which look up the >>> value of default-directory. Especially project-related ones. How to >>> popularize that knowledge, would be the next question for whatever solution >>> we invent. >> Hopefully there should be not much trouble such as in 'project-buffers'. > > I think there exists a class of commands (existing and potential ones) > that would use default-directory with exact same purpose and > expectations. Thinking about it, I guess there's (roughly) two classes of commands which want different things from default-directory, classes 1 and 2: 1. wants whatever the current value of default-directory is (and gets this by just using default-directory as a variable) 2. wants the value of default-directory for some specific buffer X (and gets this either with buffer-local-value or by using with-current-buffer) If we could change 1 without changing 2, then we'd be happy. This gets back to my earlier suggestion, that we have some way of binding a variable which does not change the buffer-local value. Supporting that would require fairly deep changes in C of course. (But actually, maybe it would be useful for Lisp threads? In fact, maybe Lisp threads already support this? Because when you're in a thread and you bind default-directory, you don't want that to affect any other threads, you only want it to affect code running directly under you.) --- Anyway, I'm coming around to the idea that actually the "changing the local value of default-directory" problem isn't that big of a deal. We can do something special for project-buffers, and that would make things work OK with the next-default-directory approach, and if we run into further problems in the future, we'll rethink at that time. Maybe with more time running with the code, we will come up with something new and clever. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 21:48:06 2023 Received: (at 63648) by debbugs.gnu.org; 2 Sep 2023 01:48:06 +0000 Received: from localhost ([127.0.0.1]:34592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcFk5-0001GH-PL for submit@debbugs.gnu.org; Fri, 01 Sep 2023 21:48:06 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:38751) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcFk4-0001FG-0e for 63648@debbugs.gnu.org; Fri, 01 Sep 2023 21:48:05 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 02B4B320092D; Fri, 1 Sep 2023 21:47:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 01 Sep 2023 21:47:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693619267; x=1693705667; bh=oPeP6Z1pqJ55uWj0b1bQAHmUbBeEnz3BR6W pcPY7I9Y=; b=EU829/wdgJ+H/igtOys3Jz2wl2xhcKcJS3Hnrum5GesPSZ93+xb ia/4kjsgFlC60rx9TWwX1A4E4pS5coD/LuarIhsNbPOC/BwDdoWqYgdY3yj6PnvK tB+EfIdXFHOnpLZwa1W5gHUDVt0qFldwA5rrFXtx/FuQIyHAILTW4T2c56lzkJDh 7QHeIljmXdU9Xeco8WB9UjV5Q8+JD51lXan7h3NsosDhS366p1tODMqnqgA5iH4s 0LrYlQl7XvCkmGHebRcpsCmmjCBQApogHKcgs1pIe2b3MUzoDETrWayjHhdeWA9O FdA5Cr/eImVTsJQWxvgpN34qdPiEmJ653lw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693619267; x=1693705667; bh=oPeP6Z1pqJ55uWj0b1bQAHmUbBeEnz3BR6W pcPY7I9Y=; b=HQzbEWhADBptRWxdY/nd1bmfYt6CwlVxFiuzTUAF9pa2auLDdB1 IWaCfO+Xb6FAWeQJcGfd9hMMs2bIL6/cA1bmQwPIGJg5teTlLY3U8SfzqzfvaQR5 fO7Rdu5shMnSCx10saYK1e9HsMFytmWFEXm0o8avfIXYg5v6h7GC5DaI2S+/faq5 mmtdE2biZuzQ1om+vkFErIInvdXbo0koWHCQJHlC5QkEh3NTSk14bmLu8z4CbYxy I9sGtaDSsngDtoyvTdcqMp2rlk4menKDdK4euPakJgtvYlPe/A+OwLZ9agDw/rYu C2zUJhBLLHGFl00hKzdED8rNr/hhqv6bxdQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegfedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Sep 2023 21:47:45 -0400 (EDT) Message-ID: <09a33cba-b94a-55a1-6b2a-ea5e08f751fc@gutov.dev> Date: Sat, 2 Sep 2023 04:47:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Spencer Baugh References: <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) On 01/09/2023 18:59, Spencer Baugh wrote: >>> Hopefully there should be not much trouble such as in 'project-buffers'. >> >> I think there exists a class of commands (existing and potential ones) >> that would use default-directory with exact same purpose and >> expectations. > > Thinking about it, I guess there's (roughly) two classes of commands > which want different things from default-directory, classes 1 and 2: > > 1. wants whatever the current value of default-directory is (and gets > this by just using default-directory as a variable) > > 2. wants the value of default-directory for some specific buffer X (and > gets this either with buffer-local-value or by using > with-current-buffer) > > If we could change 1 without changing 2, then we'd be happy. Yes, maybe. > This gets back to my earlier suggestion, that we have some way of > binding a variable which does not change the buffer-local value. > Supporting that would require fairly deep changes in C of course. > > (But actually, maybe it would be useful for Lisp threads? In fact, > maybe Lisp threads already support this? Because when you're in a > thread and you bind default-directory, you don't want that to affect any > other threads, you only want it to affect code running directly under > you.) It might be useful, sure. But as for how reasonable would be to have such a primitive, I'd rather defer to our language gurus (a question on emacs-devel would be a good idea). > Anyway, I'm coming around to the idea that actually the "changing the > local value of default-directory" problem isn't that big of a deal. We > can do something special for project-buffers, and that would make things > work OK with the next-default-directory approach, and if we run into > further problems in the future, we'll rethink at that time. > > Maybe with more time running with the code, we will come up with > something new and clever. It's a minor problem, but we've already went through two rounds on bug#58784 (first finding one solution, then a problem with it, and ending up with project-current-directory-override). I'd rather not throw out a solution that covers the known edge cases too eagerly. So I don't like an idea of a "special fix" in project-buffers, but if anyone has a specific patch to show, please go ahead. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 13:35:24 2023 Received: (at 63648) by debbugs.gnu.org; 3 Sep 2023 17:35:24 +0000 Received: from localhost ([127.0.0.1]:46790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcr0O-0000vZ-0X for submit@debbugs.gnu.org; Sun, 03 Sep 2023 13:35:24 -0400 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:47611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcr0K-0000uz-Bt for 63648@debbugs.gnu.org; Sun, 03 Sep 2023 13:35:22 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 28901240005; Sun, 3 Sep 2023 17:35:10 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Fri, 01 Sep 2023 11:59:41 -0400") Organization: LINKOV.NET References: <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> Date: Sun, 03 Sep 2023 20:11:57 +0300 Message-ID: <86il8r4g96.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Thinking about it, I guess there's (roughly) two classes of commands > which want different things from default-directory, classes 1 and 2: > > 1. wants whatever the current value of default-directory is (and gets > this by just using default-directory as a variable) > > 2. wants the value of default-directory for some specific buffer X (and > gets this either with buffer-local-value or by using > with-current-buffer) > > If we could change 1 without changing 2, then we'd be happy. I think we can't solve this logical paradox because it contains self-contradictory requirements. Here is the command that illustrates this paradox. What should this command print? C-x p p ... C-h v default-directory RET Like Schrödinger's cat, it belongs simultaneously to both classes: 1. wants to print the new value of default-directory because 'C-h v' is the next command for which the value of default-directory was explicitly set. 2. wants to print the original value of default-directory because 'C-h v' was invoked in the buffer where the value of default-directory should stay unchanged. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 10 11:33:06 2023 Received: (at 63648) by debbugs.gnu.org; 10 Sep 2023 15:33:06 +0000 Received: from localhost ([127.0.0.1]:51102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfMQr-0007Fk-HJ for submit@debbugs.gnu.org; Sun, 10 Sep 2023 11:33:06 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:44853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfMQp-0007FE-0l for 63648@debbugs.gnu.org; Sun, 10 Sep 2023 11:33:04 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 8A3ABE0005; Sun, 10 Sep 2023 15:32:50 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> (Dmitry Gutov's message of "Fri, 1 Sep 2023 12:53:02 +0300") Organization: LINKOV.NET References: <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> Date: Sun, 10 Sep 2023 18:30:09 +0300 Message-ID: <86edj6hyem.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >>>> This could be fixed by adding special-handling of the default-directory >>>> for the current buffer in 'project-buffers'. >>> What kind of special handling? The "real" buffer-local value is hidden >>> until the "let" exists, the global value is nil, and if the buffer is not >>> a file-visiting one, there is no other file name to test against. >> Additional buffer-local variable like 'buffer-default-directory' could help. >> Or additional global variable 'global-default-directory'. Or even >> using the global value of the existing variable 'default-directory'. > > What code would use it instead of the local value of default-directory? > Only project-related code? Or other code as well? If it's the former, we > have an existing variable in the project package. If the latter, we'd need > some formal description of those usage rules to proceed. The former. So given all the considered constraints we have to admit there is a possibility that some rare non-project command that checks default-directory in all buffers might get a wrong value for one buffer when it's called immediately after 'C-x p p'. OTOH, such a reasonable compromise can help us fix other bugs such as bug#65558. So here is a complete tested patch that maintains backward-compatibility with older versions, and is localized to project.el without the need to discuss more fundamental changes on emacs-devel, and handles 100% of known cases such as reported in bug#58784, bug#63829, etc. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=other-project-prefix.patch diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2e6ae89a443..257c0da4264 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -197,6 +197,19 @@ project-current-directory-override "Value to use instead of `default-directory' when detecting the project. When it is non-nil, `project-current' will always skip prompting too.") +(make-obsolete-variable + 'project-current-directory-override + 'project-current-directory-old + "30.1") + +(defvar-local project-current-directory-old nil + "Value to use instead of `default-directory' when detecting the project. +For the next command after switching the project, this buffer-local +variable contains the original value of `default-directory'. +Whereas the buffer-local `default-directory' is temporarily set +to the root directory of the switched project. +When it is non-nil, `project-current' will always skip prompting too.") + (defcustom project-prompter #'project-prompt-project-dir "Function to call to prompt for a project. Called with no arguments and should return a project root dir." @@ -232,7 +245,8 @@ project-current (let ((pr (project--find-in-directory directory))) (cond (pr) - ((unless project-current-directory-override + ((unless (or project-current-directory-override + project-current-directory-old) maybe-prompt) (setq directory (funcall project-prompter) pr (project--find-in-directory directory)))) @@ -397,8 +411,10 @@ project-buffers (let ((root (expand-file-name (file-name-as-directory (project-root project)))) bufs) (dolist (buf (buffer-list)) - (when (string-prefix-p root (expand-file-name - (buffer-local-value 'default-directory buf))) + (when (string-prefix-p + root (expand-file-name + (or (buffer-local-value 'project-current-directory-old buf) + (buffer-local-value 'default-directory buf)))) (push buf bufs))) (nreverse bufs))) @@ -813,7 +829,9 @@ project-buffers dd bufs) (dolist (buf (buffer-list)) - (setq dd (expand-file-name (buffer-local-value 'default-directory buf))) + (setq dd (expand-file-name + (or (buffer-local-value 'project-current-directory-old buf) + (buffer-local-value 'default-directory buf)))) (when (and (string-prefix-p root dd) (not (cl-find-if (lambda (module) (string-prefix-p module dd)) modules))) @@ -842,7 +860,9 @@ project-prefix-map (define-key map "c" 'project-compile) (define-key map "e" 'project-eshell) (define-key map "k" 'project-kill-buffers) - (define-key map "p" 'project-switch-project) + (define-key map "p" (if (< emacs-major-version 30) + 'project-switch-project + 'other-project-prefix)) (define-key map "g" 'project-find-regexp) (define-key map "G" 'project-or-external-find-regexp) (define-key map "r" 'project-query-replace-regexp) @@ -889,10 +909,16 @@ project-other-window-command \\{project-prefix-map} \\{project-other-window-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-window) - (inhibit-same-window . t)) - project-other-window-map)) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-pop-up-window) + (inhibit-same-window . t)) + project-other-window-map) + (let ((inhibit-message t)) (other-window-prefix)) + (message "Display next project command buffer in a new window...") + (set-transient-map (make-composed-keymap project-prefix-map + project-other-window-map)))) +;; TODO: maybe rename to project-other-window-prefix ;;;###autoload (define-key ctl-x-4-map "p" #'project-other-window-command) ;;;###autoload @@ -904,8 +930,13 @@ project-other-frame-command \\{project-prefix-map} \\{project-other-frame-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-frame)) - project-other-frame-map)) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-pop-up-frame)) + project-other-frame-map) + (let ((inhibit-message t)) (other-frame-prefix)) + (message "Display next project command buffer in a new frame...") + (set-transient-map (make-composed-keymap project-prefix-map + project-other-frame-map)))) ;;;###autoload (define-key ctl-x-5-map "p" #'project-other-frame-command) @@ -917,7 +948,11 @@ project-other-tab-command \\{project-prefix-map}" (interactive) - (project--other-place-command '((display-buffer-in-new-tab)))) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-in-new-tab))) + (let ((inhibit-message t)) (other-tab-prefix)) + (message "Display next project command buffer in a new tab...") + (set-transient-map project-prefix-map))) ;;;###autoload (when (bound-and-true-p tab-prefix-map) @@ -1000,14 +1035,16 @@ project--find-default-from "Ensure FILENAME is in PROJECT. Usually, just return FILENAME. But if -`project-current-directory-override' is set, adjust it to be +`project-current-directory-old' is set, adjust it to be relative to PROJECT instead. This supports using a relative file name from the current buffer when switching projects with `project-switch-project' and then using a command like `project-find-file'." - (if-let (filename-proj (and project-current-directory-override - (project-current nil default-directory))) + (if-let (filename-proj (or (and project-current-directory-override + (project-current nil default-directory)) + (and project-current-directory-old + (project-current nil project-current-directory-old)))) ;; file-name-concat requires Emacs 28+ (concat (file-name-as-directory (project-root project)) (file-relative-name filename (project-root filename-proj))) @@ -1993,6 +2030,50 @@ project-switch-project (let ((project-current-directory-override dir)) (call-interactively command)))) +;;;###autoload +(defun other-project-prefix (dir) + "\"Switch\" to another project before running an Emacs command. +The available commands are presented as a dispatch menu +made from `project-switch-commands'. + +When called in a program, it will use the project corresponding +to directory DIR." + (interactive (list (funcall project-prompter))) + (if (symbolp project-switch-commands) + (let* ((project-current-directory-old default-directory) + (default-directory dir)) + (call-interactively project-switch-commands)) + (prefix-command-preserve-state) + (letrec ((minibuffer-depth (minibuffer-depth)) + (command this-command) + (old-buffer (current-buffer)) + (echofun (lambda () "[switch-project]")) + (postfun + (lambda () + (unless (or (eq this-command command) + (> (minibuffer-depth) minibuffer-depth)) + (remove-hook 'post-command-hook postfun) + (remove-hook 'prefix-command-echo-keystrokes-functions + echofun) + (when (buffer-live-p old-buffer) + (with-current-buffer old-buffer + (when project-current-directory-old + (setq-local default-directory project-current-directory-old) + (kill-local-variable 'project-current-directory-old)))))))) + (add-hook 'post-command-hook postfun) + (add-hook 'prefix-command-echo-keystrokes-functions echofun) + (setq-local project-current-directory-old default-directory) + (setq-local default-directory dir) + (message (project--keymap-prompt)) + (let ((commands-map + (let ((temp-map (make-sparse-keymap))) + (set-keymap-parent temp-map project-prefix-map) + (dolist (row project-switch-commands temp-map) + (when-let ((cmd (nth 0 row)) + (keychar (nth 2 row))) + (define-key temp-map (vector keychar) cmd)))))) + (set-transient-map commands-map))))) + ;;;###autoload (defun project-uniquify-dirname-transform (dirname) "Uniquify name of directory DIRNAME using `project-name', if in a project. diff --git a/lisp/window.el b/lisp/window.el index b9b032c33e9..b67b3dced9c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9122,7 +9114,8 @@ display-buffer-override-next-command (> (minibuffer-depth) minibuffer-depth) ;; But don't remove immediately after ;; adding the hook by the same command below. - (eq this-command command)) + (eq this-command command) + (eq this-command 'other-project-prefix)) (funcall exitfun)))) ;; Call post-function after the next command finishes (bug#49057). (add-hook 'post-command-hook postfun) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 16:16:28 2023 Received: (at 63648) by debbugs.gnu.org; 11 Sep 2023 20:16:28 +0000 Received: from localhost ([127.0.0.1]:54920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfnKe-0003rw-5L for submit@debbugs.gnu.org; Mon, 11 Sep 2023 16:16:28 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:55191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfnKa-0003rh-Ue for 63648@debbugs.gnu.org; Mon, 11 Sep 2023 16:16:27 -0400 From: Spencer Baugh To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86il8r4g96.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 03 Sep 2023 20:11:57 +0300") References: <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86il8r4g96.fsf@mail.linkov.net> Date: Mon, 11 Sep 2023 16:16:13 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> Thinking about it, I guess there's (roughly) two classes of commands >> which want different things from default-directory, classes 1 and 2: >> >> 1. wants whatever the current value of default-directory is (and gets >> this by just using default-directory as a variable) >> >> 2. wants the value of default-directory for some specific buffer X (and >> gets this either with buffer-local-value or by using >> with-current-buffer) >> >> If we could change 1 without changing 2, then we'd be happy. > > I think we can't solve this logical paradox because it contains > self-contradictory requirements. Here is the command that > illustrates this paradox. What should this command print? > > C-x p p ... C-h v default-directory RET > > Like Schr=C3=B6dinger's cat, it belongs simultaneously to both classes: > > 1. wants to print the new value of default-directory > because 'C-h v' is the next command for which > the value of default-directory was explicitly set. > > 2. wants to print the original value of default-directory > because 'C-h v' was invoked in the buffer where > the value of default-directory should stay unchanged. I would argue that it's in class 1. Or at least, it would make sense for C-h v to print the new value. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 03:34:01 2023 Received: (at 63648) by debbugs.gnu.org; 12 Sep 2023 07:34:01 +0000 Received: from localhost ([127.0.0.1]:55977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfxuK-0006b5-SN for submit@debbugs.gnu.org; Tue, 12 Sep 2023 03:34:01 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]:60945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfxuI-0006aq-Dz for 63648@debbugs.gnu.org; Tue, 12 Sep 2023 03:33:59 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id E0A9AC0053; Tue, 12 Sep 2023 07:32:00 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Mon, 11 Sep 2023 16:16:13 -0400") Organization: LINKOV.NET References: <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86il8r4g96.fsf@mail.linkov.net> Date: Tue, 12 Sep 2023 09:55:25 +0300 Message-ID: <861qf3ontm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> 1. wants to print the new value of default-directory >> because 'C-h v' is the next command for which >> the value of default-directory was explicitly set. >> >> 2. wants to print the original value of default-directory >> because 'C-h v' was invoked in the buffer where >> the value of default-directory should stay unchanged. > > I would argue that it's in class 1. Or at least, it would make sense > for C-h v to print the new value. I agree. And the latest patch does this. It prints the new value on 'C-x p p ... C-h v'. Then you can type 'g' and it reverts to the original value. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 19:48:07 2023 Received: (at 63648) by debbugs.gnu.org; 12 Sep 2023 23:48:07 +0000 Received: from localhost ([127.0.0.1]:60308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgD71-0001Ys-4s for submit@debbugs.gnu.org; Tue, 12 Sep 2023 19:48:07 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:46927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgD6y-0001Xj-3K for 63648@debbugs.gnu.org; Tue, 12 Sep 2023 19:48:05 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 99F535C01BA; Tue, 12 Sep 2023 19:47:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 12 Sep 2023 19:47:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694562473; x=1694648873; bh=XeNsYfG9WKCynHuOxiL5exiO2OCqL3JeO4u 6PYZDsEY=; b=oVhNUC8sFOwZlROjH3bTn4Mxy4AjF/B+T/OxGZhUL7pL8+Rk1/F Lc0KcaVhF2qdQuEC1rEqF2qtQxrPM7Ny8tJZ72VqaVeRp97LjQsqjGUzBDm26oS5 mFOABDmWPVhA9ttQ5uCw0qn4C1HNIFmCyFTODVs+3QVTRYUMgs7KY4tWA88d+bVf mAX0XLQZ+4eVgkNbtKoBvM85h2rO53RzF9qkQGoSquBn0BTA/4ZV107I6IttnjVs vTRB/xoz6mKGkz2DFtC9xTRLz1F5dMNPkSxZvDBl5yUhVdeGm0AqXSR7XRi2n7SJ YBndL7utTVJk+DB/ifQZKkTEfvtI5g9Jemg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694562473; x=1694648873; bh=XeNsYfG9WKCynHuOxiL5exiO2OCqL3JeO4u 6PYZDsEY=; b=bMs5FSfQloOOpKRmpu9LtY6UF2/FhZwtasvL4dW7EQSEQw0H1zl PjfyXMurPAOs9LiW1Q3Sw8ehk+llROKHZa/crQPr07mmlC6aAAVMTkuJyTWrrR7H smVtPgE2gApwk4wOFFBW5BimE1qEme0eeZ5VwDbP9hQAzM9Xz6OvffpzS7QitTXV 06QT32G/UFM0JrqVVWB3/3XcOb3At8DcLfdhwA08wxvjIFdkfU6w866lkbQhSf0r OyA2lkSR7RSp/9LKyV6lXxd2UhMwRE/X5G9Ugo8+K5OhBxn8YajkJu2a0FDYwXVq QtvoLGMqXEusBaxpdGSjFnBzHopJ3KpVajA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeijedgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Sep 2023 19:47:51 -0400 (EDT) Message-ID: Date: Wed, 13 Sep 2023 02:47:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86jzwyxnxb.fsf@mail.linkov.net> <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86edj6hyem.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) Hi Juri, On 10/09/2023 18:30, Juri Linkov wrote: > So here is a complete tested patch that maintains backward-compatibility > with older versions, and is localized to project.el without the need to > discuss more fundamental changes on emacs-devel, and handles 100% of > known cases such as reported in bug#58784, bug#63829, etc. It sounds like a possibly concise solution, but I'm still wrapping my head around it. > +(make-obsolete-variable > + 'project-current-directory-override > + 'project-current-directory-old > + "30.1") Aren't those variables sufficiently different that making one an alias for another would confuse things? > +(defvar-local project-current-directory-old nil > + "Value to use instead of `default-directory' when detecting the project. > +For the next command after switching the project, this buffer-local > +variable contains the original value of `default-directory'. > +Whereas the buffer-local `default-directory' is temporarily set > +to the root directory of the switched project. > +When it is non-nil, `project-current' will always skip prompting too.") The docstring is valuable, but I wonder how it looks to somebody from the outside trying to write code that would use it. > + (or (buffer-local-value 'project-current-directory-old buf) > + (buffer-local-value 'default-directory buf)))) ... > + (or (buffer-local-value 'project-current-directory-old buf) > + (buffer-local-value 'default-directory buf)))) So, this part looks like what we would be paying for this solution: any code looking to decide whether a buffer "belongs" to the project, would have to reproduce this exact expression. Wouldn't it? > + (setq-local project-current-directory-old default-directory) > + (setq-local default-directory dir) Could you explain: if we can just set these here and then clean up in postfun, couldn't we likewise set (and then later clean up) the value of project-current-directory-override? > - (eq this-command command)) > + (eq this-command command) > + (eq this-command 'other-project-prefix)) Did this part of the patch get in by accident? If it's "localized to project.el". Or do we have further plans to "generalize" that place somehow? Just making sure. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 13 02:56:13 2023 Received: (at 63648) by debbugs.gnu.org; 13 Sep 2023 06:56:13 +0000 Received: from localhost ([127.0.0.1]:60578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgJnI-00011a-MQ for submit@debbugs.gnu.org; Wed, 13 Sep 2023 02:56:13 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:44915) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgJnC-00010y-8Z for 63648@debbugs.gnu.org; Wed, 13 Sep 2023 02:56:11 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 7AE861C0009; Wed, 13 Sep 2023 06:55:51 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Wed, 13 Sep 2023 02:47:49 +0300") Organization: LINKOV.NET References: <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> Date: Wed, 13 Sep 2023 09:47:09 +0300 Message-ID: <8634zitwoy.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> So here is a complete tested patch that maintains backward-compatibility >> with older versions, and is localized to project.el without the need to >> discuss more fundamental changes on emacs-devel, and handles 100% of >> known cases such as reported in bug#58784, bug#63829, etc. > > It sounds like a possibly concise solution, but I'm still wrapping my head > around it. > >> +(make-obsolete-variable >> + 'project-current-directory-override >> + 'project-current-directory-old >> + "30.1") > > Aren't those variables sufficiently different that making one an alias for > another would confuse things? Indeed, during development I mistakenly made one an alias for another with 'define-obsolete-variable-alias', and this broke both variables. So I replaced it with 'make-obsolete-variable' that doesn't make an alias. It just designates it as obsolete to show the intention to remove it in later versions. >> +(defvar-local project-current-directory-old nil >> + "Value to use instead of `default-directory' when detecting the project. >> +For the next command after switching the project, this buffer-local >> +variable contains the original value of `default-directory'. >> +Whereas the buffer-local `default-directory' is temporarily set >> +to the root directory of the switched project. >> +When it is non-nil, `project-current' will always skip prompting too.") > > The docstring is valuable, but I wonder how it looks to somebody from the > outside trying to write code that would use it. I don't believe that someone might want to use this variable in more commands than the current project commands that rely on 'project-buffers'. But we could add a few more lines with explanations for them too. >> + (or (buffer-local-value 'project-current-directory-old buf) >> + (buffer-local-value 'default-directory buf)))) > ... >> + (or (buffer-local-value 'project-current-directory-old buf) >> + (buffer-local-value 'default-directory buf)))) > > So, this part looks like what we would be paying for this solution: any > code looking to decide whether a buffer "belongs" to the project, would > have to reproduce this exact expression. Wouldn't it? Then maybe this code should be moved to a separate function? >> + (setq-local project-current-directory-old default-directory) >> + (setq-local default-directory dir) > > Could you explain: if we can just set these here and then clean up in > postfun, couldn't we likewise set (and then later clean up) the value of > project-current-directory-override? We need to set 'default-directory' to support non-project commands. I already started to use this feature, and it becomes indispensable. For example, the most often used commands are vc commands such as 'C-x p p C-x v L' to see a vc log in another project, and 'C-x p p C-x v d' to open vc-dir, etc. >> - (eq this-command command)) >> + (eq this-command command) >> + (eq this-command 'other-project-prefix)) > > Did this part of the patch get in by accident? If it's "localized to > project.el". Or do we have further plans to "generalize" that place > somehow? Just making sure. This part is optional and could be generalized later. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 17 20:12:31 2023 Received: (at 63648) by debbugs.gnu.org; 18 Sep 2023 00:12:31 +0000 Received: from localhost ([127.0.0.1]:51638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi1sN-0000zA-Df for submit@debbugs.gnu.org; Sun, 17 Sep 2023 20:12:31 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:56911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi1sK-0000yu-JZ for 63648@debbugs.gnu.org; Sun, 17 Sep 2023 20:12:30 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 2DBF03200583; Sun, 17 Sep 2023 20:12:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 17 Sep 2023 20:12:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694995932; x=1695082332; bh=c9g5SzpkQiuBToOYLBMvNb4q3Td9qUYVC1V 3EWVZRwY=; b=lYnwdGLXva49IqglFWSXvuuKhKLQ8bl1tyW5BHqReorCdPbSJ6T cu0llghfdFjFiTKDfLjz8eaPpiqh47RWIyF7EZR9Nub8Bj2wFAVTqvNLmJ4aa8Vt SNr84B0DzNeplR8Vpe3dGZl1ztTFVhQ3SFtkZbPQXjU+aqtzz/F7vA+BqFEPB2PS HL0GkMVcPlrdLVVYQDR3dC9CSyCkWsMgN30R+3zBhtuvBWbfLH/ylglclKD6RVou 0S4aAVzEnhAzj9hBrNXIQ4dHGTq3N9GeUupfUd12IHtFt4k2ukmonVAF+oTLyxZO isBKQeut8TAdskoAkL3Sl2ymcgNsS7kQPAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694995932; x=1695082332; bh=c9g5SzpkQiuBToOYLBMvNb4q3Td9qUYVC1V 3EWVZRwY=; b=PbHNfLJHoY8Z7RsesFy/JIfDO0/eHZZD+k0/4GYv8SGfcVHPom2 7Q4qLDu0hv7sJPHpTv1iF/1rvq0ofYreCZXHlfygzYVuUiQ3sF7fWrcF6suWyhD3 A2FD/tpxPQ28jQK8RFYda8lDPPevRUlkg6gNQxI4y5uJgFG2NvwkpZWxuEpv0Fk3 gJP5ejWBwcXxxn/wqCUCRX5YgXOI3d9f4O7OaNmiFmOgX7YE4FWHhHq+JAKZQGpW /5Z2JgGKBUG/s5Cv7xr7+3i2QARVvJBpgbUtv558ObivqK8uHUuCe4I/n5XFGxyE Nx7SsGtd8sC9jjPvNByl5zfEVHGmPae61DQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejjedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 17 Sep 2023 20:12:11 -0400 (EDT) Message-ID: <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> Date: Mon, 18 Sep 2023 03:12:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86o7m91z22.fsf@mail.linkov.net> <86pm6py6k4.fsf@mail.linkov.net> <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <8634zitwoy.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) Sorry about the wait. On 13/09/2023 09:47, Juri Linkov wrote: >>> So here is a complete tested patch that maintains backward-compatibility >>> with older versions, and is localized to project.el without the need to >>> discuss more fundamental changes on emacs-devel, and handles 100% of >>> known cases such as reported in bug#58784, bug#63829, etc. >> It sounds like a possibly concise solution, but I'm still wrapping my head >> around it. >> >>> +(make-obsolete-variable >>> + 'project-current-directory-override >>> + 'project-current-directory-old >>> + "30.1") >> Aren't those variables sufficiently different that making one an alias for >> another would confuse things? > Indeed, during development I mistakenly made one an alias for another > with 'define-obsolete-variable-alias', and this broke both variables. > So I replaced it with 'make-obsolete-variable' that doesn't make an alias. > It just designates it as obsolete to show the intention to remove it > in later versions. I suppose that would make us liable to support it for a version or two? >>> + (setq-local project-current-directory-old default-directory) >>> + (setq-local default-directory dir) >> Could you explain: if we can just set these here and then clean up in >> postfun, couldn't we likewise set (and then later clean up) the value of >> project-current-directory-override? > We need to set 'default-directory' to support non-project commands. > I already started to use this feature, and it becomes indispensable. > For example, the most often used commands are vc commands such as > 'C-x p p C-x v L' to see a vc log in another project, and > 'C-x p p C-x v d' to open vc-dir, etc. All right, so we also want to support non-project commands. And you wanted to use a common approach for both. What if we handle them differently, though? For "project" commands (those that internally call project-current) we can set one variable, and for the rest -- alter default-directory. Then restore the previous value in post-command. The detection of "project commands" could work like this: - Is it in one of the special maps? E.g. in project-prefix-map. Or maybe it's in project-switch-commands. - Does the function name start with 'project-'? - Finally, for user-defined commands we could also introduce a property 'project-command-p', although the distinction between using project-current-directory-override vs default-directory will not be important for every such command, so maybe being this thorough is not too important. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 18 02:59:37 2023 Received: (at 63648) by debbugs.gnu.org; 18 Sep 2023 06:59:37 +0000 Received: from localhost ([127.0.0.1]:51918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi8EL-0004e8-0k for submit@debbugs.gnu.org; Mon, 18 Sep 2023 02:59:37 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:43511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi8EA-0004dL-IY for 63648@debbugs.gnu.org; Mon, 18 Sep 2023 02:59:32 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2BEEE1C0005; Mon, 18 Sep 2023 06:59:09 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> (Dmitry Gutov's message of "Mon, 18 Sep 2023 03:12:08 +0300") Organization: LINKOV.NET References: <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> Date: Mon, 18 Sep 2023 09:51:09 +0300 Message-ID: <86il88x9cy.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> 'C-x p p C-x v L' to see a vc log in another project, and >> 'C-x p p C-x v d' to open vc-dir, etc. > > All right, so we also want to support non-project commands. And you wanted > to use a common approach for both. > > What if we handle them differently, though? For "project" commands (those > that internally call project-current) we can set one variable, and for the > rest -- alter default-directory. Then restore the previous value in > post-command. > > The detection of "project commands" could work like this: > > - Is it in one of the special maps? E.g. in project-prefix-map. Or maybe > it's in project-switch-commands. > - Does the function name start with 'project-'? > - Finally, for user-defined commands we could also introduce a property > 'project-command-p', although the distinction between using > project-current-directory-override vs default-directory will not be > important for every such command, so maybe being this thorough is not too > important. Sorry, I don't understand how 'C-x p p' could read the user's mind whether the user afterwards will type a key for a project command or a non-project command? And depending on user's intention will either set project-current-directory-override or default-directory. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 18 07:00:23 2023 Received: (at 63648) by debbugs.gnu.org; 18 Sep 2023 11:00:23 +0000 Received: from localhost ([127.0.0.1]:52190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiBzK-0008IH-QQ for submit@debbugs.gnu.org; Mon, 18 Sep 2023 07:00:23 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:46451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiBzI-0008Hz-ER for 63648@debbugs.gnu.org; Mon, 18 Sep 2023 07:00:21 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 46BC13200922; Mon, 18 Sep 2023 07:00:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 18 Sep 2023 07:00:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1695034805; x=1695121205; bh=b2tYBfic7sKKDZZv5KMBZkD3Rbqv+Odgkhc UgshrLug=; b=koCwf9JnxuNT8NViOlQHFzZ4ysPrvQp+4Pbvhif1lXI07eko78b aGkpxOblIW71W87Bsum/l7ef0Ec/4oebVVJCHQE3ta7yZ06RuE8s91WZAPGar22R EXDc7+44nUC52rK2lZPcPHJksxbJGi7lWD3sx/61qC6QmZSPFhIeZRvXSn6RiUO7 i+fkzEuiBtvNEh8VU6G2tSx7wy4Odo6N9iE35e2p2qYKeiv5oxIrQ6DH3RvkJRoO 8C7Psg/A0s2si6CaKkTMtAQqPgMsI+V8ZvdxxPiDiUZcVYaxOs9fQ1asR5EyMC4e 0k4se1gYiM+QlXxR90FAlMtJbU5bNK79VCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1695034805; x=1695121205; bh=b2tYBfic7sKKDZZv5KMBZkD3Rbqv+Odgkhc UgshrLug=; b=c8MOziG7lyuA40mxQ4RfSz4hqkT+6uS7sKKirNQwoJFc154UeMC Eho18RnyhMC+Q+0uQ05ciJt49rePZTdSakadRS1F4KcojU0ZjrM7UgrPyXjJ80cM 11tvBI75mTeVSaxb+Bc3sTciJ2xLLsMc5a1NVSkcFv2UhZdJ6I4wYnvQyMb1uFiT Ve11HVTmiblH3DTIRdhn/mj0Y3cy/9XBbH1el8jjGKzrbHQ0Jam+meNhPtjo/cBi Y1V8fgd0ZKK4Pei0Lc3Kg/aaIPKeBLWyy/mNpIcTqZPiZ5pxp6SHeBJb0xy9+0Zl C2HRaAf3aTvy48nKvvuWh3WKCSbA6BM23Eg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejkedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Sep 2023 07:00:04 -0400 (EDT) Message-ID: <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> Date: Mon, 18 Sep 2023 14:00:03 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86il88x9cy.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 18/09/2023 09:51, Juri Linkov wrote: >>> 'C-x p p C-x v L' to see a vc log in another project, and >>> 'C-x p p C-x v d' to open vc-dir, etc. >> All right, so we also want to support non-project commands. And you wanted >> to use a common approach for both. >> >> What if we handle them differently, though? For "project" commands (those >> that internally call project-current) we can set one variable, and for the >> rest -- alter default-directory. Then restore the previous value in >> post-command. >> >> The detection of "project commands" could work like this: >> >> - Is it in one of the special maps? E.g. in project-prefix-map. Or maybe >> it's in project-switch-commands. >> - Does the function name start with 'project-'? >> - Finally, for user-defined commands we could also introduce a property >> 'project-command-p', although the distinction between using >> project-current-directory-override vs default-directory will not be >> important for every such command, so maybe being this thorough is not too >> important. > Sorry, I don't understand how 'C-x p p' could read the user's mind > whether the user afterwards will type a key for a project command > or a non-project command? And depending on user's intention will > either set project-current-directory-override or default-directory. Ah, I forgot that in the general case we don't read the sequence, find the command and do the thing. We leave the event loop up to Emacs. What about pre-command-hook? this-command will already be set by then. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 18 09:57:28 2023 Received: (at 63648) by debbugs.gnu.org; 18 Sep 2023 13:57:28 +0000 Received: from localhost ([127.0.0.1]:53935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiEke-0005Y0-8T for submit@debbugs.gnu.org; Mon, 18 Sep 2023 09:57:27 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:48169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiEkY-0005XR-7M for 63648@debbugs.gnu.org; Mon, 18 Sep 2023 09:57:22 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0447F5C010F; Mon, 18 Sep 2023 09:57:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 18 Sep 2023 09:57:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1695045422; x=1695131822; bh=zavPwp45wBczpgGCp8j7Tzewh5XtrYvg+AD WOD6gU+g=; b=dBtEMG92eEZHdClDq56O1wyuGWM8yhcJPwIg0bkHWdtktK9DbU6 0G8ghq//8WpHhuIKM49N8CI+XfTkjgrrS8nFg2ucRAdIr4az0KcBv+Iif7m9DcMl ItvOip9+0bs6af1+zeSSDMUWwOaMJaliqCI4je6txL74dScmpwdtE0XRTzGQeY9d juMxxZLYKthL8SXchQMna4FB0djkNBs/jucroEL/5pd0HrqmseEKEFA5Qmy0gIX7 R08R7p3Du8g6O1cg8p6GEsrgHfCy97bRm6FzFqjLQJ+DtzmxH3So5kTNi91Mg2d5 j9bzO/kCP4K5THSFbKpoSCWwBOXBlLJMfWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1695045422; x=1695131822; bh=zavPwp45wBczpgGCp8j7Tzewh5XtrYvg+AD WOD6gU+g=; b=XjMqIssww6n+kH4Ps+tDhCAYPij0vpcWL9bZ4dcHZsn7K6AjQGL bshyyaFNajs7tPNXgoCiieef8ZOh3pJJupz13TAg/Ce/vkCan8PELeyB/Um9uL45 b02AfWKEwcBIBa2Rjoqa7QlW1JZismplkupXS8++zgKNHdufs3E8uEAZgMMFpyzP GuJjFxnxIEdn22NgAnRnFnJxxim/W2yMAOAKo/U3QqtFzk1YKSxZmqcLduPBzr9M W+2a/n7ORqQK3yNdVwMyET6wDgyKUd8edJVECXYxKmcNuHtlYIkqLjHhySFu4x97 01+wDaOw/HtVeMnQ4D1FBYJaW5K9b9/g91w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejkedgieelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffhvfevfhgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfeftdejleetffelhfffteefgfeggfejgfdtudeuvedttdetvdelffekvdeg udetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Sep 2023 09:57:00 -0400 (EDT) Message-ID: <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> Date: Mon, 18 Sep 2023 16:56:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US From: Dmitry Gutov To: Juri Linkov References: <86bki9y68h.fsf@mail.linkov.net> <86cz2f7bvo.fsf@mail.linkov.net> <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> In-Reply-To: <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 18/09/2023 14:00, Dmitry Gutov wrote: > On 18/09/2023 09:51, Juri Linkov wrote: >>>> 'C-x p p C-x v L' to see a vc log in another project, and >>>> 'C-x p p C-x v d' to open vc-dir, etc. >>> All right, so we also want to support non-project commands. And you >>> wanted >>> to use a common approach for both. >>> >>> What if we handle them differently, though? For "project" commands >>> (those >>> that internally call project-current) we can set one variable, and >>> for the >>> rest -- alter default-directory. Then restore the previous value in >>> post-command. >>> >>> The detection of "project commands" could work like this: >>> >>> - Is it in one of the special maps? E.g. in project-prefix-map. Or maybe >>>    it's in project-switch-commands. >>> - Does the function name start with 'project-'? >>> - Finally, for user-defined commands we could also introduce a property >>>    'project-command-p', although the distinction between using >>>    project-current-directory-override vs default-directory will not be >>>    important for every such command, so maybe being this thorough is >>> not too >>>   important. >> Sorry, I don't understand how 'C-x p p' could read the user's mind >> whether the user afterwards will type a key for a project command >> or a non-project command?  And depending on user's intention will >> either set project-current-directory-override or default-directory. > > Ah, I forgot that in the general case we don't read the sequence, find > the command and do the thing. We leave the event loop up to Emacs. > > What about pre-command-hook? this-command will already be set by then. And we should consider whether other-project-prefix should entirely subsume project-switch-project. Or they should remain separate commands. E.g. would people who customized project-switch-commands to a symbol be okay with not being able to use the other functionality of other-project-prefix? Or what about the variable project-switch-use-entire-map? I'm not sure about dropping it, at least without notifying about that in the UI somehow. Finally, the current patch drops the loop, so if the user types the wrong key, they will need to repeat the command and choose the project again. So perhaps the simplest incremental change is to add other-project-prefix which will work with "regular" commands and keep project-switch-project for project commands (whether it will support "project" commands as well, can be optional). The downside is that it will require a different key binding (or for the user to redefine the current one), so I'm open to discussing all the questions above. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 19 14:20:58 2023 Received: (at 63648) by debbugs.gnu.org; 19 Sep 2023 18:20:59 +0000 Received: from localhost ([127.0.0.1]:57800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qifLG-0006Yi-KT for submit@debbugs.gnu.org; Tue, 19 Sep 2023 14:20:58 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:57843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qifLA-0006YK-Nl for 63648@debbugs.gnu.org; Tue, 19 Sep 2023 14:20:57 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 32B37240002; Tue, 19 Sep 2023 18:20:34 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> (Dmitry Gutov's message of "Mon, 18 Sep 2023 16:56:58 +0300") Organization: LINKOV.NET References: <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> Date: Tue, 19 Sep 2023 20:57:49 +0300 Message-ID: <868r9258oi.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > And we should consider whether other-project-prefix should entirely subsume > project-switch-project. Or they should remain separate commands. We could leave project-switch-project unobsoleted indefinitely for users who might prefer it, and users can bind it to C-x p p. > E.g. would people who customized project-switch-commands to a symbol be > okay with not being able to use the other functionality of > other-project-prefix? Symbolic project-switch-commands is supported by other-project-prefix. > Or what about the variable project-switch-use-entire-map? I'm not sure > about dropping it, at least without notifying about that in the UI somehow. project-switch-use-entire-map could be handled in other-project-prefix. But is this really needed? I can't imagine why anyone might want to disable keys from project-prefix-map. > Finally, the current patch drops the loop, so if the user types the wrong > key, they will need to repeat the command and choose the project again. Indeed, the loop now is the command loop, and maybe it's possible to write a hack to set a catch-all in set-transient-map that is not finished until a key in the map is typed. But as with any command, if the user types a wrong key sequence, then need to type it again. I do this all the time with mistakenly typed keys. I don't see why project keys are the exception. > So perhaps the simplest incremental change is to add other-project-prefix > which will work with "regular" commands and keep project-switch-project for > project commands (whether it will support "project" commands as well, can > be optional). > > The downside is that it will require a different key binding (or for the > user to redefine the current one), so I'm open to discussing all the > questions above. A different key binding for the commands that do the same thing? Only because the new command uses the command loop? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 19 20:39:32 2023 Received: (at 63648) by debbugs.gnu.org; 20 Sep 2023 00:39:32 +0000 Received: from localhost ([127.0.0.1]:57941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qilFc-000068-2C for submit@debbugs.gnu.org; Tue, 19 Sep 2023 20:39:32 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:57993) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qilFX-00005h-CN for 63648@debbugs.gnu.org; Tue, 19 Sep 2023 20:39:30 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 033835C0110; Tue, 19 Sep 2023 20:39:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 19 Sep 2023 20:39:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1695170351; x=1695256751; bh=o9PgdSP/o8xbuK9H7LUbDrpN2byvbF3N9o7 W/Q81+5Q=; b=JOm4slw97GjVHRy4ThY6r8rqVy8PpACfc6NtXHedB5gZthvGMIC h3m2WyhU7e0K6T7r6XKpmP+BgPp2QR1YIa0UFW+pBASVQy9ED0EVNc6FIEETv7V8 B/vVh97q+PVGUOrrDA/3DfR2OSXDnbpNTlu6vB5Y50WUQgvPCO4CvPXpIM/mUc8b R71pX5NMaDD8594xuc9+ZejZ9Nrkj6uwPOsYsWBrGF4waDghx4jn9Jrfbj6GL15e tfxFdY4XbMe1ECNbiLSUae5SlmBvD7eFjlQcZYKi9XmgmJM8fLZA8UjOVa37cF4G hBGs2bqEHiuOhIDlZRt3HlcKUBPheciThdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1695170351; x=1695256751; bh=o9PgdSP/o8xbuK9H7LUbDrpN2byvbF3N9o7 W/Q81+5Q=; b=aF2+nwBiiDnEk26yqbmkeJcpT1GbczOSBxf0m7V5McdCVuEYsgy svmVDMVin3DVxTDWd2v57ch2anatxSir0/cXXcsFJ9L1E/lKZ2FTN3d/WjIF+ZEK /XINsRKqqahESRbHU0YXbbQ04BESE3XZM3HAVRx5KJyacc4RJWFBzxzprupTcqMU 6/2LPg3vOYB2btbu2JigbqD9eI5j7DXJDP++0RImDgjRVNGI3VohRyykKyjPvZhj NTG6jTq0bEiUsDNXOsYSRtsm79KCfgjnKeOKXewCZf5KJm4dqXOEHeAzSJ1ZD7XI cilKre/8e+X8pBdprNamHvGgi0BsNMCQWqw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudekvddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Sep 2023 20:39:10 -0400 (EDT) Message-ID: Date: Wed, 20 Sep 2023 03:39:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86353axu48.fsf@mail.linkov.net> <87o7jfi00b.fsf@catern.com> <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <868r9258oi.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 19/09/2023 20:57, Juri Linkov wrote: >> And we should consider whether other-project-prefix should entirely subsume >> project-switch-project. Or they should remain separate commands. > > We could leave project-switch-project unobsoleted indefinitely > for users who might prefer it, and users can bind it to C-x p p. Or we keep the easier-to-use command on 'C-x p p', and the more experienced users would rebind that to 'other-project-prefix', when they learn how to use it. >> E.g. would people who customized project-switch-commands to a symbol be >> okay with not being able to use the other functionality of >> other-project-prefix? > > Symbolic project-switch-commands is supported by other-project-prefix. Yes, and that could be a problem: if I as a user want 'C-x p p' to always run 'project-find-file', for example (in the other project), but I also want to be able to sometimes call 'M-x other-project-prefix' (or use a custom binding) to run an arbitrary command in the other project. >> Or what about the variable project-switch-use-entire-map? I'm not sure >> about dropping it, at least without notifying about that in the UI somehow. > > project-switch-use-entire-map could be handled in other-project-prefix. > But is this really needed? I can't imagine why anyone might want > to disable keys from project-prefix-map. I think if project-switch-use-entire-map is still wanted, we should just keep these commands separate (the same logic as in the previous paragraph). Why not remove that option? Consider the current UI (which looks almost the same in your latest patch): user types 'C-x p p', chooses the project and then sees the prompt which only offers the options from project-switch-commands. They are not informed that any other keys could be used too. So if we were to change the default behavior, I think this UI/prompt needs to change, at the very least. Do we want to drop the whole "choose a command from the list" thing? Will that be an improvement overall, for most users? If you think so, I suppose we should make a poll somewhere. >> Finally, the current patch drops the loop, so if the user types the wrong >> key, they will need to repeat the command and choose the project again. > > Indeed, the loop now is the command loop, and maybe it's possible to > write a hack to set a catch-all in set-transient-map that is not > finished until a key in the map is typed. But as with any command, > if the user types a wrong key sequence, then need to type it again. > I do this all the time with mistakenly typed keys. I don't see why > project keys are the exception. Maybe because in the middle of it all you have interacted with Emacs to choose the other project, and that can be a significant amount of typing? I suppose, if it worked the other way (first choose the command, and then the project), it would make more sense to not care about having the user repeat the command sequence. >> So perhaps the simplest incremental change is to add other-project-prefix >> which will work with "regular" commands and keep project-switch-project for >> project commands (whether it will support "project" commands as well, can >> be optional). >> >> The downside is that it will require a different key binding (or for the >> user to redefine the current one), so I'm open to discussing all the >> questions above. > > A different key binding for the commands that do the same thing? > Only because the new command uses the command loop? project-switch-project would continue to show the menu with commands, only work with them by default, and obey project-switch-use-entire-map, which, when set to t, would enable other commands from the project keymap, but only them. All accessible via one character binding. And when project-switch-commands is set to a symbol, it would only invoke that one command without additional prompting. other-project-prefix would accept all commands but require full key sequence for the invoked command. Would it add shortcuts to the commands from the project keymap? Possibly. Any ideas how to inform the user about that? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 20 13:13:10 2023 Received: (at 63648) by debbugs.gnu.org; 20 Sep 2023 17:13:10 +0000 Received: from localhost ([127.0.0.1]:60296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj0lB-0005D1-Su for submit@debbugs.gnu.org; Wed, 20 Sep 2023 13:13:10 -0400 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:49013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj0l7-0005CT-P2 for 63648@debbugs.gnu.org; Wed, 20 Sep 2023 13:13:07 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id BC33C240004; Wed, 20 Sep 2023 17:12:47 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Wed, 20 Sep 2023 03:39:08 +0300") Organization: LINKOV.NET References: <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> Date: Wed, 20 Sep 2023 20:10:46 +0300 Message-ID: <86edishisp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> And we should consider whether other-project-prefix should entirely subsume >>> project-switch-project. Or they should remain separate commands. >> We could leave project-switch-project unobsoleted indefinitely >> for users who might prefer it, and users can bind it to C-x p p. > > Or we keep the easier-to-use command on 'C-x p p', and the more experienced > users would rebind that to 'other-project-prefix', when they learn how to > use it. Or vice versa. >>> E.g. would people who customized project-switch-commands to a symbol be >>> okay with not being able to use the other functionality of >>> other-project-prefix? >> Symbolic project-switch-commands is supported by other-project-prefix. > > Yes, and that could be a problem: if I as a user want 'C-x p p' to always > run 'project-find-file', for example (in the other project), but I also > want to be able to sometimes call 'M-x other-project-prefix' (or use > a custom binding) to run an arbitrary command in the other project. With other-project-prefix, users can run 'project-find-file' in another project with just: ``` (defun other-project-find-file () (interactive) (call-interactively 'other-project-prefix) (call-interactively 'project-find-file)) ``` >>> Or what about the variable project-switch-use-entire-map? I'm not sure >>> about dropping it, at least without notifying about that in the UI somehow. >> project-switch-use-entire-map could be handled in other-project-prefix. >> But is this really needed? I can't imagine why anyone might want >> to disable keys from project-prefix-map. > > I think if project-switch-use-entire-map is still wanted, we should just > keep these commands separate (the same logic as in the previous paragraph). No problem, project-switch-use-entire-map can be easily supported in other-project-prefix. > Why not remove that option? Consider the current UI (which looks almost the > same in your latest patch): user types 'C-x p p', chooses the project and > then sees the prompt which only offers the options from > project-switch-commands. They are not informed that any other keys could be > used too. So if we were to change the default behavior, I think this > UI/prompt needs to change, at the very least. Agreed, a better prompt needed. Maybe with the standard C-h key for help. > Do we want to drop the whole "choose a command from the list" thing? Will > that be an improvement overall, for most users? If you think so, I suppose > we should make a poll somewhere. Maybe this short menu is not much needed. OTOH, it doesn't cause distraction. >>> Finally, the current patch drops the loop, so if the user types the wrong >>> key, they will need to repeat the command and choose the project again. >> Indeed, the loop now is the command loop, and maybe it's possible to >> write a hack to set a catch-all in set-transient-map that is not >> finished until a key in the map is typed. But as with any command, >> if the user types a wrong key sequence, then need to type it again. >> I do this all the time with mistakenly typed keys. I don't see why >> project keys are the exception. > > Maybe because in the middle of it all you have interacted with Emacs to > choose the other project, and that can be a significant amount of typing? Then for repeating the previously selected project it will be in the history: 'C-x p p M-p'. > I suppose, if it worked the other way (first choose the command, and then > the project), it would make more sense to not care about having the user > repeat the command sequence. Like it does when typed e.g. 'C-x p f' in a non-project directory? >>> So perhaps the simplest incremental change is to add other-project-prefix >>> which will work with "regular" commands and keep project-switch-project for >>> project commands (whether it will support "project" commands as well, can >>> be optional). >>> >>> The downside is that it will require a different key binding (or for the >>> user to redefine the current one), so I'm open to discussing all the >>> questions above. >> A different key binding for the commands that do the same thing? >> Only because the new command uses the command loop? > > project-switch-project would continue to show the menu with commands, only > work with them by default, and obey project-switch-use-entire-map, which, > when set to t, would enable other commands from the project keymap, but > only them. All accessible via one character binding. And when > project-switch-commands is set to a symbol, it would only invoke that one > command without additional prompting. > > other-project-prefix would accept all commands but require full key > sequence for the invoked command. And also other-project-prefix will fix such bugs as bug#65558. > Would it add shortcuts to the commands from the project keymap? > Possibly. Any ideas how to inform the user about that? By a different prompt? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 20 21:16:55 2023 Received: (at 63648) by debbugs.gnu.org; 21 Sep 2023 01:16:55 +0000 Received: from localhost ([127.0.0.1]:60684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj8JK-0004n6-Nt for submit@debbugs.gnu.org; Wed, 20 Sep 2023 21:16:55 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj8JH-0004mo-MK for 63648@debbugs.gnu.org; Wed, 20 Sep 2023 21:16:53 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C9E7A5C0228; Wed, 20 Sep 2023 21:16:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 20 Sep 2023 21:16:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1695258995; x=1695345395; bh=i8eM5GT96iDy9wnI/wsXPBZ7+mr9DudizPW DK2QRmJM=; b=i/wpe8g8J1/OKMNvwn/eSzpWFXBmhv1N7vJ0fFz2CRNUOaNny/e 9rpt6++Rfrf5TZ+RKk8+FzSsA4hP2GULvw76KC4ILHjP25Ag2G9npslsS4ThL7eF qFXboHSnqZxQT8b9l70nch1cOgzsl8uCBx5OdbsIBu4LwpsyMIw3WDkk1cHY6GcT oiNm5ZSjX1W3DjJo8O1e1mKSiRsCVqmhZvuwqaast7FVzmr+/lsg/hG17cP0/ZaG coKcn5jXpsI3wm7Lfu5iX6lrCt3ZWioDuTGvSE1sZUR9MnDEtb72ql2ikLGSNeLc AicmeqhIYoZJ2o/0n/HlkQDbSC40k2iNX/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1695258995; x=1695345395; bh=i8eM5GT96iDy9wnI/wsXPBZ7+mr9DudizPW DK2QRmJM=; b=nsI/SBGW2GJE6/cUUV6smlMazqwW1YN1YGomeUNghoB96xz8kaj 93rhuxCwQkReIq3m8xuYsgR6INc/ikLFgqcs/SR+JFPpCQNl87Q4lW+jQkwqPdM7 gYWR2Z80dyfirndAx50jKAxtmIxWVgHFQd0Q21VPPZVW+77jt8wxBfPxx1eNKYz2 YXFNu61rSDW2tybN3mJOP/Q71vJD34vhVK33/G66O7GXJUzhrmE8Xoy4EDXZRDBY 7tOa0CAaGkBAO4RVDOUOnhygFXtRa1xBlXKBWqUjOIAvrtEyRjFMlzQsVBY+MVIZ oTRpX1RGBOVCgdplawkZ49KYsACw9I/0syw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudekgedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 20 Sep 2023 21:16:34 -0400 (EDT) Message-ID: <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> Date: Thu, 21 Sep 2023 04:16:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86msyhwrrg.fsf@mail.linkov.net> <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86edishisp.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 20/09/2023 20:10, Juri Linkov wrote: >>>> And we should consider whether other-project-prefix should entirely subsume >>>> project-switch-project. Or they should remain separate commands. >>> We could leave project-switch-project unobsoleted indefinitely >>> for users who might prefer it, and users can bind it to C-x p p. >> >> Or we keep the easier-to-use command on 'C-x p p', and the more experienced >> users would rebind that to 'other-project-prefix', when they learn how to >> use it. > > Or vice versa. Yes. >>>> E.g. would people who customized project-switch-commands to a symbol be >>>> okay with not being able to use the other functionality of >>>> other-project-prefix? >>> Symbolic project-switch-commands is supported by other-project-prefix. >> >> Yes, and that could be a problem: if I as a user want 'C-x p p' to always >> run 'project-find-file', for example (in the other project), but I also >> want to be able to sometimes call 'M-x other-project-prefix' (or use >> a custom binding) to run an arbitrary command in the other project. > > With other-project-prefix, users can run 'project-find-file' > in another project with just: > > ``` > (defun other-project-find-file () > (interactive) > (call-interactively 'other-project-prefix) > (call-interactively 'project-find-file)) > ``` Right... but they'd have to define a custom function for any such command. I think the idea behind 'other-project-prefix' is that one wouldn't have to. >>>> Or what about the variable project-switch-use-entire-map? I'm not sure >>>> about dropping it, at least without notifying about that in the UI somehow. >>> project-switch-use-entire-map could be handled in other-project-prefix. >>> But is this really needed? I can't imagine why anyone might want >>> to disable keys from project-prefix-map. >> >> I think if project-switch-use-entire-map is still wanted, we should just >> keep these commands separate (the same logic as in the previous paragraph). > > No problem, project-switch-use-entire-map can be easily supported in > other-project-prefix. I'm not saying it's hard to support it there. But it could make the command less useful. >> Why not remove that option? Consider the current UI (which looks almost the >> same in your latest patch): user types 'C-x p p', chooses the project and >> then sees the prompt which only offers the options from >> project-switch-commands. They are not informed that any other keys could be >> used too. So if we were to change the default behavior, I think this >> UI/prompt needs to change, at the very least. > > Agreed, a better prompt needed. Maybe with the standard C-h key for help. Some short version initially, and perhaps a more expanded if the user hits 'C-h'. >> Do we want to drop the whole "choose a command from the list" thing? Will >> that be an improvement overall, for most users? If you think so, I suppose >> we should make a poll somewhere. > > Maybe this short menu is not much needed. OTOH, it doesn't cause distraction. I think some menu, or an explanation, anything, is better than nothing. >>>> Finally, the current patch drops the loop, so if the user types the wrong >>>> key, they will need to repeat the command and choose the project again. >>> Indeed, the loop now is the command loop, and maybe it's possible to >>> write a hack to set a catch-all in set-transient-map that is not >>> finished until a key in the map is typed. But as with any command, >>> if the user types a wrong key sequence, then need to type it again. >>> I do this all the time with mistakenly typed keys. I don't see why >>> project keys are the exception. >> >> Maybe because in the middle of it all you have interacted with Emacs to >> choose the other project, and that can be a significant amount of typing? > > Then for repeating the previously selected project it will be in the history: > 'C-x p p M-p'. Fair point. Still, that's more typing and required one to remember/know about M-p. >> I suppose, if it worked the other way (first choose the command, and then >> the project), it would make more sense to not care about having the user >> repeat the command sequence. > > Like it does when typed e.g. 'C-x p f' in a non-project directory? Yep. >>> A different key binding for the commands that do the same thing? >>> Only because the new command uses the command loop? >> >> project-switch-project would continue to show the menu with commands, only >> work with them by default, and obey project-switch-use-entire-map, which, >> when set to t, would enable other commands from the project keymap, but >> only them. All accessible via one character binding. And when >> project-switch-commands is set to a symbol, it would only invoke that one >> command without additional prompting. >> >> other-project-prefix would accept all commands but require full key >> sequence for the invoked command. > > And also other-project-prefix will fix such bugs as bug#65558. > >> Would it add shortcuts to the commands from the project keymap? >> Possibly. Any ideas how to inform the user about that? > > By a different prompt? Probably. Would you like to propose one? So that I have something to compare to, and have something specific to put to the vote as well. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 21 03:17:16 2023 Received: (at 63648) by debbugs.gnu.org; 21 Sep 2023 07:17:16 +0000 Received: from localhost ([127.0.0.1]:60922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjDw3-0006DY-CB for submit@debbugs.gnu.org; Thu, 21 Sep 2023 03:17:16 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjDw0-0006DI-JA for 63648@debbugs.gnu.org; Thu, 21 Sep 2023 03:17:14 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5690660004; Thu, 21 Sep 2023 07:16:53 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> (Dmitry Gutov's message of "Thu, 21 Sep 2023 04:16:32 +0300") Organization: LINKOV.NET References: <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> Date: Thu, 21 Sep 2023 09:58:57 +0300 Message-ID: <86msxgatuy.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >>>>> E.g. would people who customized project-switch-commands to a symbol be >>>>> okay with not being able to use the other functionality of >>>>> other-project-prefix? >>>> Symbolic project-switch-commands is supported by other-project-prefix. >>> >>> Yes, and that could be a problem: if I as a user want 'C-x p p' to always >>> run 'project-find-file', for example (in the other project), but I also >>> want to be able to sometimes call 'M-x other-project-prefix' (or use >>> a custom binding) to run an arbitrary command in the other project. >> With other-project-prefix, users can run 'project-find-file' >> in another project with just: >> ``` >> (defun other-project-find-file () >> (interactive) >> (call-interactively 'other-project-prefix) >> (call-interactively 'project-find-file)) >> ``` > > Right... but they'd have to define a custom function for any such > command. I think the idea behind 'other-project-prefix' is that one > wouldn't have to. Only one custom function. Or they can just bind the most used command to the most easily typed key RET. >>>>> Or what about the variable project-switch-use-entire-map? I'm not sure >>>>> about dropping it, at least without notifying about that in the UI somehow. >>>> project-switch-use-entire-map could be handled in other-project-prefix. >>>> But is this really needed? I can't imagine why anyone might want >>>> to disable keys from project-prefix-map. >>> >>> I think if project-switch-use-entire-map is still wanted, we should just >>> keep these commands separate (the same logic as in the previous paragraph). >> No problem, project-switch-use-entire-map can be easily supported in >> other-project-prefix. > > I'm not saying it's hard to support it there. But it could make the command > less useful. When all global keybindings are available, it's strange to remove keys from project-prefix-map. But ok, the patch below supports project-switch-use-entire-map. >>> Why not remove that option? Consider the current UI (which looks almost the >>> same in your latest patch): user types 'C-x p p', chooses the project and >>> then sees the prompt which only offers the options from >>> project-switch-commands. They are not informed that any other keys could be >>> used too. So if we were to change the default behavior, I think this >>> UI/prompt needs to change, at the very least. >> Agreed, a better prompt needed. Maybe with the standard C-h key for >> help. > > Some short version initially, and perhaps a more expanded if the user hits > 'C-h'. I tried to use 'help-form' in a new patch, but actually 'C-h' is quite useless when not using the ad-hoc loop as e.g. in y-or-n-p that forces to type a limited set of keys. >>>>> Finally, the current patch drops the loop, so if the user types the wrong >>>>> key, they will need to repeat the command and choose the project again. >>>> Indeed, the loop now is the command loop, and maybe it's possible to >>>> write a hack to set a catch-all in set-transient-map that is not >>>> finished until a key in the map is typed. But as with any command, >>>> if the user types a wrong key sequence, then need to type it again. >>>> I do this all the time with mistakenly typed keys. I don't see why >>>> project keys are the exception. >>> >>> Maybe because in the middle of it all you have interacted with Emacs to >>> choose the other project, and that can be a significant amount of typing? >> Then for repeating the previously selected project it will be in the >> history: >> 'C-x p p M-p'. > > Fair point. Still, that's more typing and required one to remember/know > about M-p. If 'project-prompt-project-dir' remembered the selected directory like 'project-current' does, then would be possible to repeat with: 'C-x p p M-n'. >>>> A different key binding for the commands that do the same thing? >>>> Only because the new command uses the command loop? >>> >>> project-switch-project would continue to show the menu with commands, only >>> work with them by default, and obey project-switch-use-entire-map, which, >>> when set to t, would enable other commands from the project keymap, but >>> only them. All accessible via one character binding. And when >>> project-switch-commands is set to a symbol, it would only invoke that one >>> command without additional prompting. >>> >>> other-project-prefix would accept all commands but require full key >>> sequence for the invoked command. >> And also other-project-prefix will fix such bugs as bug#65558. >> >>> Would it add shortcuts to the commands from the project keymap? >>> Possibly. Any ideas how to inform the user about that? >> By a different prompt? > > Probably. Would you like to propose one? So that I have something to > compare to, and have something specific to put to the vote as well. Ok, something like this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=project-default-directory.patch diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2e6ae89a443..6d5664c0e98 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -197,6 +197,14 @@ project-current-directory-override "Value to use instead of `default-directory' when detecting the project. When it is non-nil, `project-current' will always skip prompting too.") +(defvar-local project-default-directory nil + "Value to use instead of `default-directory' when detecting the project. +For the next command after switching the project, this buffer-local +variable contains the original value of `default-directory'. +Whereas the buffer-local `default-directory' is temporarily set +to the root directory of the switched project. +When it is non-nil, `project-current' will always skip prompting too.") + (defcustom project-prompter #'project-prompt-project-dir "Function to call to prompt for a project. Called with no arguments and should return a project root dir." @@ -232,7 +240,8 @@ project-current (let ((pr (project--find-in-directory directory))) (cond (pr) - ((unless project-current-directory-override + ((unless (or project-current-directory-override + project-default-directory) maybe-prompt) (setq directory (funcall project-prompter) pr (project--find-in-directory directory)))) @@ -397,8 +406,10 @@ project-buffers (let ((root (expand-file-name (file-name-as-directory (project-root project)))) bufs) (dolist (buf (buffer-list)) - (when (string-prefix-p root (expand-file-name - (buffer-local-value 'default-directory buf))) + (when (string-prefix-p + root (expand-file-name + (or (buffer-local-value 'project-default-directory buf) + (buffer-local-value 'default-directory buf)))) (push buf bufs))) (nreverse bufs))) @@ -813,7 +824,9 @@ project-buffers dd bufs) (dolist (buf (buffer-list)) - (setq dd (expand-file-name (buffer-local-value 'default-directory buf))) + (setq dd (expand-file-name + (or (buffer-local-value 'project-default-directory buf) + (buffer-local-value 'default-directory buf)))) (when (and (string-prefix-p root dd) (not (cl-find-if (lambda (module) (string-prefix-p module dd)) modules))) @@ -842,7 +855,9 @@ project-prefix-map (define-key map "c" 'project-compile) (define-key map "e" 'project-eshell) (define-key map "k" 'project-kill-buffers) - (define-key map "p" 'project-switch-project) + (define-key map "p" (if (< emacs-major-version 30) + 'project-switch-project + 'other-project-prefix)) (define-key map "g" 'project-find-regexp) (define-key map "G" 'project-or-external-find-regexp) (define-key map "r" 'project-query-replace-regexp) @@ -889,10 +904,16 @@ project-other-window-command \\{project-prefix-map} \\{project-other-window-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-window) - (inhibit-same-window . t)) - project-other-window-map)) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-pop-up-window) + (inhibit-same-window . t)) + project-other-window-map) + (let ((inhibit-message t)) (other-window-prefix)) + (message "Display next project command buffer in a new window...") + (set-transient-map (make-composed-keymap project-prefix-map + project-other-window-map)))) +;; TODO: maybe rename to project-other-window-prefix ;;;###autoload (define-key ctl-x-4-map "p" #'project-other-window-command) ;;;###autoload @@ -904,8 +925,13 @@ project-other-frame-command \\{project-prefix-map} \\{project-other-frame-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-frame)) - project-other-frame-map)) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-pop-up-frame)) + project-other-frame-map) + (let ((inhibit-message t)) (other-frame-prefix)) + (message "Display next project command buffer in a new frame...") + (set-transient-map (make-composed-keymap project-prefix-map + project-other-frame-map)))) ;;;###autoload (define-key ctl-x-5-map "p" #'project-other-frame-command) @@ -917,7 +943,11 @@ project-other-tab-command \\{project-prefix-map}" (interactive) - (project--other-place-command '((display-buffer-in-new-tab)))) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-in-new-tab))) + (let ((inhibit-message t)) (other-tab-prefix)) + (message "Display next project command buffer in a new tab...") + (set-transient-map project-prefix-map))) ;;;###autoload (when (bound-and-true-p tab-prefix-map) @@ -1000,14 +1030,16 @@ project--find-default-from "Ensure FILENAME is in PROJECT. Usually, just return FILENAME. But if -`project-current-directory-override' is set, adjust it to be +`project-default-directory' is set, adjust it to be relative to PROJECT instead. This supports using a relative file name from the current buffer when switching projects with `project-switch-project' and then using a command like `project-find-file'." - (if-let (filename-proj (and project-current-directory-override - (project-current nil default-directory))) + (if-let (filename-proj (or (and project-current-directory-override + (project-current nil default-directory)) + (and project-default-directory + (project-current nil project-default-directory)))) ;; file-name-concat requires Emacs 28+ (concat (file-name-as-directory (project-root project)) (file-relative-name filename (project-root filename-proj))) @@ -1993,6 +2025,60 @@ project-switch-project (let ((project-current-directory-override dir)) (call-interactively command)))) +;;;###autoload +(defun other-project-prefix (dir) + "\"Switch\" to another project before running an Emacs command. +The available commands are presented as a dispatch menu +made from `project-switch-commands'. + +When called in a program, it will use the project corresponding +to directory DIR." + (interactive (list (funcall project-prompter))) + (if (symbolp project-switch-commands) + (let* ((project-default-directory default-directory) + (default-directory dir)) + (call-interactively project-switch-commands)) + (prefix-command-preserve-state) + (letrec ((minibuffer-depth (minibuffer-depth)) + (command this-command) + (old-buffer (current-buffer)) + (echofun (lambda () "[switch-project]")) + (postfun + (lambda () + (unless (or (eq this-command command) + (> (minibuffer-depth) minibuffer-depth)) + (remove-hook 'post-command-hook postfun) + (remove-hook 'prefix-command-echo-keystrokes-functions + echofun) + (when (buffer-live-p old-buffer) + (with-current-buffer old-buffer + (when project-default-directory + (setq-local default-directory project-default-directory) + (kill-local-variable 'project-default-directory)))))))) + (add-hook 'post-command-hook postfun) + (add-hook 'prefix-command-echo-keystrokes-functions echofun) + (setq-local project-default-directory default-directory) + (setq-local default-directory dir) + (message (concat (project--keymap-prompt) " or any global key.")) + (let ((map (make-sparse-keymap))) + (if project-switch-use-entire-map + (set-keymap-parent map project-prefix-map) + (dolist (row project-switch-commands map) + (when-let* ((cmd (nth 0 row)) + (key (nth 2 row)) + (keychar (if key (vector key) + (where-is-internal + cmd (list project-prefix-map) t)))) + (define-key map keychar cmd)))) + (define-key map (vector help-char) + (lambda () + (interactive) + (let ((help-form "\ +You can use any global keybinding.")) + (help-form-show)))) + ;; Should return exitfun from set-transient-map + (set-transient-map map))))) + ;;;###autoload (defun project-uniquify-dirname-transform (dirname) "Uniquify name of directory DIRNAME using `project-name', if in a project. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 22 12:03:17 2023 Received: (at 63648) by debbugs.gnu.org; 22 Sep 2023 16:03:17 +0000 Received: from localhost ([127.0.0.1]:37167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjice-0005Gq-P4 for submit@debbugs.gnu.org; Fri, 22 Sep 2023 12:03:17 -0400 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]:57369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjicb-0005GG-L2 for 63648@debbugs.gnu.org; Fri, 22 Sep 2023 12:03:14 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0ADE820003; Fri, 22 Sep 2023 16:02:53 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86msxgatuy.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 21 Sep 2023 09:58:57 +0300") Organization: LINKOV.NET References: <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> Date: Fri, 22 Sep 2023 18:52:09 +0300 Message-ID: <86y1gynr2u.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> Probably. Would you like to propose one? So that I have something to >> compare to, and have something specific to put to the vote as well. > > Ok, something like this: Here is a more tested patch. It supports these cases: (setq project-switch-use-entire-map t) C-x p p C-b - should not include current buffer in the list of another project (bug#58784) C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) C-x p p C-x d - should visit another project's root (bug#63648) The same with frames: C-x 5 p p C-b C-x 5 p p f M-n C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) C-x 5 p p C-x d --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=project-default-directory.patch diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2e6ae89a443..9faacbe3512 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -197,6 +197,14 @@ project-current-directory-override "Value to use instead of `default-directory' when detecting the project. When it is non-nil, `project-current' will always skip prompting too.") +(defvar-local project-default-directory nil + "Value to use instead of `default-directory' when detecting the project. +For the next command after switching the project, this buffer-local +variable contains the original value of `default-directory'. +Whereas the buffer-local `default-directory' is temporarily set +to the root directory of the switched project. +When it is non-nil, `project-current' will always skip prompting too.") + (defcustom project-prompter #'project-prompt-project-dir "Function to call to prompt for a project. Called with no arguments and should return a project root dir." @@ -232,7 +240,8 @@ project-current (let ((pr (project--find-in-directory directory))) (cond (pr) - ((unless project-current-directory-override + ((unless (or project-current-directory-override + project-default-directory) maybe-prompt) (setq directory (funcall project-prompter) pr (project--find-in-directory directory)))) @@ -397,8 +406,10 @@ project-buffers (let ((root (expand-file-name (file-name-as-directory (project-root project)))) bufs) (dolist (buf (buffer-list)) - (when (string-prefix-p root (expand-file-name - (buffer-local-value 'default-directory buf))) + (when (string-prefix-p + root (expand-file-name + (or (buffer-local-value 'project-default-directory buf) + (buffer-local-value 'default-directory buf)))) (push buf bufs))) (nreverse bufs))) @@ -813,7 +824,9 @@ project-buffers dd bufs) (dolist (buf (buffer-list)) - (setq dd (expand-file-name (buffer-local-value 'default-directory buf))) + (setq dd (expand-file-name + (or (buffer-local-value 'project-default-directory buf) + (buffer-local-value 'default-directory buf)))) (when (and (string-prefix-p root dd) (not (cl-find-if (lambda (module) (string-prefix-p module dd)) modules))) @@ -842,7 +855,9 @@ project-prefix-map (define-key map "c" 'project-compile) (define-key map "e" 'project-eshell) (define-key map "k" 'project-kill-buffers) - (define-key map "p" 'project-switch-project) + (define-key map "p" (if (< emacs-major-version 30) + 'project-switch-project + 'other-project-prefix)) (define-key map "g" 'project-find-regexp) (define-key map "G" 'project-or-external-find-regexp) (define-key map "r" 'project-query-replace-regexp) @@ -889,10 +904,18 @@ project-other-window-command \\{project-prefix-map} \\{project-other-window-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-window) - (inhibit-same-window . t)) - project-other-window-map)) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-pop-up-window) + (inhibit-same-window . t)) + project-other-window-map) + (prefix-command-preserve-state) + (let ((inhibit-message t)) (other-window-prefix)) + (message "Display next project command buffer in a new window...") + ;; Should return exitfun from set-transient-map + (set-transient-map (make-composed-keymap project-prefix-map + project-other-window-map)))) +;; TODO: maybe rename to project-other-window-prefix ;;;###autoload (define-key ctl-x-4-map "p" #'project-other-window-command) ;;;###autoload @@ -904,8 +927,15 @@ project-other-frame-command \\{project-prefix-map} \\{project-other-frame-map}" (interactive) - (project--other-place-command '((display-buffer-pop-up-frame)) - project-other-frame-map)) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-pop-up-frame)) + project-other-frame-map) + (prefix-command-preserve-state) + (let ((inhibit-message t)) (other-frame-prefix)) + (message "Display next project command buffer in a new frame...") + ;; Should return exitfun from set-transient-map + (set-transient-map (make-composed-keymap project-prefix-map + project-other-frame-map)))) ;;;###autoload (define-key ctl-x-5-map "p" #'project-other-frame-command) @@ -917,7 +947,13 @@ project-other-tab-command \\{project-prefix-map}" (interactive) - (project--other-place-command '((display-buffer-in-new-tab)))) + (if (< emacs-major-version 30) + (project--other-place-command '((display-buffer-in-new-tab))) + (prefix-command-preserve-state) + (let ((inhibit-message t)) (other-tab-prefix)) + (message "Display next project command buffer in a new tab...") + ;; Should return exitfun from set-transient-map + (set-transient-map project-prefix-map))) ;;;###autoload (when (bound-and-true-p tab-prefix-map) @@ -1000,14 +1036,16 @@ project--find-default-from "Ensure FILENAME is in PROJECT. Usually, just return FILENAME. But if -`project-current-directory-override' is set, adjust it to be +`project-default-directory' is set, adjust it to be relative to PROJECT instead. This supports using a relative file name from the current buffer when switching projects with `project-switch-project' and then using a command like `project-find-file'." - (if-let (filename-proj (and project-current-directory-override - (project-current nil default-directory))) + (if-let (filename-proj (or (and project-current-directory-override + (project-current nil default-directory)) + (and project-default-directory + (project-current nil project-default-directory)))) ;; file-name-concat requires Emacs 28+ (concat (file-name-as-directory (project-root project)) (file-relative-name filename (project-root filename-proj))) @@ -1993,6 +2031,60 @@ project-switch-project (let ((project-current-directory-override dir)) (call-interactively command)))) +;;;###autoload +(defun other-project-prefix (dir) + "\"Switch\" to another project before running an Emacs command. +The available commands are presented as a dispatch menu +made from `project-switch-commands'. + +When called in a program, it will use the project corresponding +to directory DIR." + (interactive (list (funcall project-prompter))) + (if (symbolp project-switch-commands) + (let* ((project-default-directory default-directory) + (default-directory dir)) + (call-interactively project-switch-commands)) + (prefix-command-preserve-state) + (letrec ((minibuffer-depth (minibuffer-depth)) + (command this-command) + (old-buffer (current-buffer)) + (echofun (lambda () "[switch-project]")) + (postfun + (lambda () + (unless (or (eq this-command command) + (> (minibuffer-depth) minibuffer-depth)) + (remove-hook 'post-command-hook postfun) + (remove-hook 'prefix-command-echo-keystrokes-functions + echofun) + (when (buffer-live-p old-buffer) + (with-current-buffer old-buffer + (when project-default-directory + (setq-local default-directory project-default-directory) + (kill-local-variable 'project-default-directory)))))))) + (add-hook 'post-command-hook postfun) + (add-hook 'prefix-command-echo-keystrokes-functions echofun) + (setq-local project-default-directory default-directory) + (setq-local default-directory dir) + (message (concat (project--keymap-prompt) " or any global key.")) + (let ((map (make-sparse-keymap))) + (if project-switch-use-entire-map + (set-keymap-parent map project-prefix-map) + (dolist (row project-switch-commands map) + (when-let* ((cmd (nth 0 row)) + (key (if (nth 2 row) + (vector (nth 2 row)) + (where-is-internal + cmd (list project-prefix-map) t)))) + (define-key map key cmd)))) + (define-key map (vector help-char) + (lambda () + (interactive) + (let ((help-form "\ +You can use any global keybinding.")) + (help-form-show)))) + ;; Should return exitfun from set-transient-map + (set-transient-map map))))) + ;;;###autoload (defun project-uniquify-dirname-transform (dirname) "Uniquify name of directory DIRNAME using `project-name', if in a project. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 18 20:43:05 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 00:43:05 +0000 Received: from localhost ([127.0.0.1]:35134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtH7w-0007AN-ET for submit@debbugs.gnu.org; Wed, 18 Oct 2023 20:43:04 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:45613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtH7s-00079s-VW for 63648@debbugs.gnu.org; Wed, 18 Oct 2023 20:43:02 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 178485C0267; Wed, 18 Oct 2023 20:42:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 18 Oct 2023 20:42:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1697676149; x=1697762549; bh=v5 LJDJpUAXS3pyZO5EmfODg/v8BFaCCH9vB/fCSEAjU=; b=M22BQLMfHD+4X0RLlW 5wuNT2pXLraNc+cc0IEf3j6+1wclXzqiKdz5olPGgSYqq40fW03Zj6b/92LxIyjQ XXGUu3ykMCqGDOoztXuojW6ojl+pDZCOkJDIrdODoIUgk113OC57WEgOK6hqrj16 lqfjKDCXo7rEiSVWe41KWy2Y5nuDxTg4IEph95LmH79oy32hWEhbwzY4g+rvcob5 CRaJYbXaJSYAn1okTLMSLPWeIDxryOjbvV7ouZPu2i4g9+7XDCCK5ghagStCqYFO e7yaURw2qcfmmjVriITT4oUqRYWn4dhuJ0tcgx+sgNAR5K49/2YUc+K+dcdOwKP+ TWDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1697676149; x=1697762549; bh=v5LJDJpUAXS3p yZO5EmfODg/v8BFaCCH9vB/fCSEAjU=; b=C3ZMo+EFt6lQWp8fmSCQXKGXVW4qa hSRwhmt8SR4eYvP8tg6FOIq7hEoNywktQ9qTi+0OxtftI79+kH7jcYGficv8Y3wv vi1dREzmJMF8V3E3r9pa5vAcW8ZokWn7aosjtbnv5U833CtE378iQgj6CvJKvxGW ay6ZKDXDDjsnHz6GcJjpt0cvlDJ9fnAo85Iiffyd9FY4RVy3E3ccJHrHk3ewEb3k qvkpKfymrqHHXrL2ienQfheQ19P6QvfnvFSbXHvcWp1Hywl6y2mrRjFD3cFwf8XP QLB8wZQfnO53KQdSGkBGdMaIYMpNrsIVEx4K5+3+r2Ibh/Dv2A5B2QjJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeehgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtkfffgggfuffvvehfhfgjsehmtderredtfeejnecuhfhrohhmpeffmhhithhr hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg hrnhepheetkefgteeiueejuedvtddvleetffeljeetuddvfeffjeeiheehueetffevieej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih htrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Oct 2023 20:42:27 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------Nye0DD0lgigWDm34n024Myk0" Message-ID: <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> Date: Thu, 19 Oct 2023 03:42:24 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86y1gynr2u.fsf@mail.linkov.net> X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) This is a multi-part message in MIME format. --------------Nye0DD0lgigWDm34n024Myk0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Juri, On 22/09/2023 18:52, Juri Linkov wrote: >>> Probably. Would you like to propose one? So that I have something to >>> compare to, and have something specific to put to the vote as well. >> >> Ok, something like this: > > Here is a more tested patch. It supports these cases: > > (setq project-switch-use-entire-map t) > > C-x p p C-b - should not include current buffer in the list of another project (bug#58784) > C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) > C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) > C-x p p C-x d - should visit another project's root (bug#63648) > > The same with frames: > > C-x 5 p p C-b > C-x 5 p p f M-n > C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) > C-x 5 p p C-x d Thank you. Especially for the list. But I think we still haven't reached a decision whether the "loop until correct key is pressed" behavior is useful. I tried to think how to fit the above requirements into the existing model, and it seems to require a new command, and an additional key being pressed sometimes, for explicitness. The attached patch also includes your fix for bug#65558, which seems orthogonal to our dilemma, and could probably be installed separately. It could be dry-ed up a little, though. Anyway, with the attached counter-proposal, the list looks like this: C-x p p C-b - works when project-switch-use-entire-map=t C-x p p f M-n - always works C-u C-x p p f - same C-x p p C-x d - the key sequence is 'C-x p p o C-x d' With frames: C-x 5 p p C-b - works when project-switch-use-entire-map=t C-x 5 p p f M-n - always works C-u C-x 5 p p f emoji TAB - same (thanks to your fix, included) C-x 5 p p C-x d - the key sequence is 'C-x 5 C-x p p o C-x d' The user could add project-list-buffers (or project-switch-to-buffer) to project-switch-commands, though, and then project-switch-use-entire-map won't be needed. Either way's fine. To sum up, that does require pressing an extra key to use commands outside of project-prefix-map, but OTOH that key is shown right in the commands menu. And one doesn't have to (setq project-switch-use-entire-map t) to use it, though that doesn't hurt either. And the meaning of project-switch-use-entire-map remains as it currently is: expand the set of keys to the whole project-prefix-map, but not to all local and global ones. WDYT? --------------Nye0DD0lgigWDm34n024Myk0 Content-Type: text/x-patch; charset=UTF-8; name="project-other-command.diff" Content-Disposition: attachment; filename="project-other-command.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IGI5ZWNiNzcwZTYwLi43NjRkMzEzODdlMCAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC04NDcsNiArODQ3LDcgQEAgcHJvamVjdC1wcmVmaXgtbWFwCiAgICAgKGRl ZmluZS1rZXkgbWFwICJHIiAncHJvamVjdC1vci1leHRlcm5hbC1maW5kLXJlZ2V4cCkKICAg ICAoZGVmaW5lLWtleSBtYXAgInIiICdwcm9qZWN0LXF1ZXJ5LXJlcGxhY2UtcmVnZXhwKQog ICAgIChkZWZpbmUta2V5IG1hcCAieCIgJ3Byb2plY3QtZXhlY3V0ZS1leHRlbmRlZC1jb21t YW5kKQorICAgIChkZWZpbmUta2V5IG1hcCAibyIgJ3Byb2plY3Qtb3RoZXItY29tbWFuZCkK ICAgICAoZGVmaW5lLWtleSBtYXAgIlxDLWIiICdwcm9qZWN0LWxpc3QtYnVmZmVycykKICAg ICBtYXApCiAgICJLZXltYXAgZm9yIHByb2plY3QgY29tbWFuZHMuIikKQEAgLTg4OSwxMCAr ODkwLDE4IEBAIHByb2plY3Qtb3RoZXItd2luZG93LWNvbW1hbmQKIFxce3Byb2plY3QtcHJl Zml4LW1hcH0KIFxce3Byb2plY3Qtb3RoZXItd2luZG93LW1hcH0iCiAgIChpbnRlcmFjdGl2 ZSkKLSAgKHByb2plY3QtLW90aGVyLXBsYWNlLWNvbW1hbmQgJygoZGlzcGxheS1idWZmZXIt cG9wLXVwLXdpbmRvdykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW5o aWJpdC1zYW1lLXdpbmRvdyAuIHQpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBwcm9qZWN0LW90aGVyLXdpbmRvdy1tYXApKQotCisgIChpZiAoPCBlbWFjcy1tYWpvci12 ZXJzaW9uIDMwKQorICAgICAgKHByb2plY3QtLW90aGVyLXBsYWNlLWNvbW1hbmQgJygoZGlz cGxheS1idWZmZXItcG9wLXVwLXdpbmRvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGluaGliaXQtc2FtZS13aW5kb3cgLiB0KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHByb2plY3Qtb3RoZXItd2luZG93LW1hcCkKKyAgICAo cHJlZml4LWNvbW1hbmQtcHJlc2VydmUtc3RhdGUpCisgICAgKGxldCAoKGluaGliaXQtbWVz c2FnZSB0KSkgKG90aGVyLXdpbmRvdy1wcmVmaXgpKQorICAgIChtZXNzYWdlICJEaXNwbGF5 IG5leHQgcHJvamVjdCBjb21tYW5kIGJ1ZmZlciBpbiBhIG5ldyB3aW5kb3cuLi4iKQorICAg IDs7IFNob3VsZCByZXR1cm4gZXhpdGZ1biBmcm9tIHNldC10cmFuc2llbnQtbWFwCisgICAg KHNldC10cmFuc2llbnQtbWFwIChtYWtlLWNvbXBvc2VkLWtleW1hcCBwcm9qZWN0LXByZWZp eC1tYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBy b2plY3Qtb3RoZXItd2luZG93LW1hcCkpKSkKKworOzsgVE9ETzogbWF5YmUgcmVuYW1lIHRv IHByb2plY3Qtb3RoZXItd2luZG93LXByZWZpeAogOzs7IyMjYXV0b2xvYWQgKGRlZmluZS1r ZXkgY3RsLXgtNC1tYXAgInAiICMncHJvamVjdC1vdGhlci13aW5kb3ctY29tbWFuZCkKIAog Ozs7IyMjYXV0b2xvYWQKQEAgLTkwNCw4ICs5MTMsMTUgQEAgcHJvamVjdC1vdGhlci1mcmFt ZS1jb21tYW5kCiBcXHtwcm9qZWN0LXByZWZpeC1tYXB9CiBcXHtwcm9qZWN0LW90aGVyLWZy YW1lLW1hcH0iCiAgIChpbnRlcmFjdGl2ZSkKLSAgKHByb2plY3QtLW90aGVyLXBsYWNlLWNv bW1hbmQgJygoZGlzcGxheS1idWZmZXItcG9wLXVwLWZyYW1lKSkKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcHJvamVjdC1vdGhlci1mcmFtZS1tYXApKQorICAoaWYgKDwg ZW1hY3MtbWFqb3ItdmVyc2lvbiAzMCkKKyAgICAgIChwcm9qZWN0LS1vdGhlci1wbGFjZS1j b21tYW5kICcoKGRpc3BsYXktYnVmZmVyLXBvcC11cC1mcmFtZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBwcm9qZWN0LW90aGVyLWZyYW1lLW1hcCkKKyAgICAo cHJlZml4LWNvbW1hbmQtcHJlc2VydmUtc3RhdGUpCisgICAgKGxldCAoKGluaGliaXQtbWVz c2FnZSB0KSkgKG90aGVyLWZyYW1lLXByZWZpeCkpCisgICAgKG1lc3NhZ2UgIkRpc3BsYXkg bmV4dCBwcm9qZWN0IGNvbW1hbmQgYnVmZmVyIGluIGEgbmV3IGZyYW1lLi4uIikKKyAgICA7 OyBTaG91bGQgcmV0dXJuIGV4aXRmdW4gZnJvbSBzZXQtdHJhbnNpZW50LW1hcAorICAgIChz ZXQtdHJhbnNpZW50LW1hcCAobWFrZS1jb21wb3NlZC1rZXltYXAgcHJvamVjdC1wcmVmaXgt bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9q ZWN0LW90aGVyLWZyYW1lLW1hcCkpKSkKIAogOzs7IyMjYXV0b2xvYWQgKGRlZmluZS1rZXkg Y3RsLXgtNS1tYXAgInAiICMncHJvamVjdC1vdGhlci1mcmFtZS1jb21tYW5kKQogCkBAIC05 MTcsNyArOTMzLDEzIEBAIHByb2plY3Qtb3RoZXItdGFiLWNvbW1hbmQKIAogXFx7cHJvamVj dC1wcmVmaXgtbWFwfSIKICAgKGludGVyYWN0aXZlKQotICAocHJvamVjdC0tb3RoZXItcGxh Y2UtY29tbWFuZCAnKChkaXNwbGF5LWJ1ZmZlci1pbi1uZXctdGFiKSkpKQorICAoaWYgKDwg ZW1hY3MtbWFqb3ItdmVyc2lvbiAzMCkKKyAgICAgIChwcm9qZWN0LS1vdGhlci1wbGFjZS1j b21tYW5kICcoKGRpc3BsYXktYnVmZmVyLWluLW5ldy10YWIpKSkKKyAgICAocHJlZml4LWNv bW1hbmQtcHJlc2VydmUtc3RhdGUpCisgICAgKGxldCAoKGluaGliaXQtbWVzc2FnZSB0KSkg KG90aGVyLXRhYi1wcmVmaXgpKQorICAgIChtZXNzYWdlICJEaXNwbGF5IG5leHQgcHJvamVj dCBjb21tYW5kIGJ1ZmZlciBpbiBhIG5ldyB0YWIuLi4iKQorICAgIDs7IFNob3VsZCByZXR1 cm4gZXhpdGZ1biBmcm9tIHNldC10cmFuc2llbnQtbWFwCisgICAgKHNldC10cmFuc2llbnQt bWFwIHByb2plY3QtcHJlZml4LW1hcCkpKQogCiA7OzsjIyNhdXRvbG9hZAogKHdoZW4gKGJv dW5kLWFuZC10cnVlLXAgdGFiLXByZWZpeC1tYXApCkBAIC0xNzk2LDYgKzE4MTgsMTkgQEAg cHJvamVjdC1leGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQKICAgKGxldCAoKGRlZmF1bHQtZGly ZWN0b3J5IChwcm9qZWN0LXJvb3QgKHByb2plY3QtY3VycmVudCB0KSkpKQogICAgIChjYWxs LWludGVyYWN0aXZlbHkgIydleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQpKSkKIAorOzs7IyMj YXV0b2xvYWQKKyhkZWZ1biBwcm9qZWN0LW90aGVyLWNvbW1hbmQgKCkKKyAgIlJ1biBjb21t YW5kIHdpdGggYGRlZmF1bHQtZGlyZWN0b3J5JyBzZXQgdG8gdGhlIGN1cnJlbnQgcHJvamVj dCByb290LiIKKyAgKGludGVyYWN0aXZlKQorICAobGV0KiAoKHByIChwcm9qZWN0LWN1cnJl bnQgdCkpCisgICAgICAgICAocHJlZml4LWNvbW1hbmQtZWNoby1rZXlzdHJva2VzLWZ1bmN0 aW9ucworICAgICAgICAgIChjb25zIChsYW1iZGEgKCkgKGZvcm1hdCAiW2V4ZWN1dGUgaW4g JXNdIiAocHJvamVjdC1yb290IHByKSkpCisgICAgICAgICAgICAgICAgcHJlZml4LWNvbW1h bmQtZWNoby1rZXlzdHJva2VzLWZ1bmN0aW9ucykpCisgICAgICAgICAoY29tbWFuZCAoa2V5 LWJpbmRpbmcgKHJlYWQta2V5LXNlcXVlbmNlICIiKSB0KSkpCisgICAgKGxldCAoKGRlZmF1 bHQtZGlyZWN0b3J5IChwcm9qZWN0LXJvb3QgcHIpKSkKKyAgICAgIChhbmQgY29tbWFuZAor ICAgICAgICAgICAoY2FsbC1pbnRlcmFjdGl2ZWx5IGNvbW1hbmQpKSkpKQorCiAoZGVmdW4g cHJvamVjdC1yZW1lbWJlci1wcm9qZWN0cy11bmRlciAoZGlyICZvcHRpb25hbCByZWN1cnNp dmUpCiAgICJJbmRleCBhbGwgcHJvamVjdHMgYmVsb3cgYSBkaXJlY3RvcnkgRElSLgogSWYg UkVDVVJTSVZFIGlzIG5vbi1uaWwsIHJlY3Vyc2UgaW50byBhbGwgc3ViZGlyZWN0b3JpZXMg dG8gZmluZApAQCAtMTg3NCw3ICsxOTA5LDggQEAgcHJvamVjdC1zd2l0Y2gtY29tbWFuZHMK ICAgICAocHJvamVjdC1maW5kLXJlZ2V4cCAiRmluZCByZWdleHAiKQogICAgIChwcm9qZWN0 LWZpbmQtZGlyICJGaW5kIGRpcmVjdG9yeSIpCiAgICAgKHByb2plY3QtdmMtZGlyICJWQy1E aXIiKQotICAgIChwcm9qZWN0LWVzaGVsbCAiRXNoZWxsIikpCisgICAgKHByb2plY3QtZXNo ZWxsICJFc2hlbGwiKQorICAgIChwcm9qZWN0LW90aGVyLWNvbW1hbmQgIk90aGVyIikpCiAg ICJBbGlzdCBtYXBwaW5nIGNvbW1hbmRzIHRvIGRlc2NyaXB0aW9ucy4KIFVzZWQgYnkgYHBy b2plY3Qtc3dpdGNoLXByb2plY3QnIHRvIGNvbnN0cnVjdCBhIGRpc3BhdGNoIG1lbnUgb2YK IGNvbW1hbmRzIGF2YWlsYWJsZSB1cG9uIFwic3dpdGNoaW5nXCIgdG8gYW5vdGhlciBwcm9q ZWN0Lgo= --------------Nye0DD0lgigWDm34n024Myk0-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 00:46:56 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 04:46:56 +0000 Received: from localhost ([127.0.0.1]:35411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtKvw-0006XA-C8 for submit@debbugs.gnu.org; Thu, 19 Oct 2023 00:46:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtKvu-0006Wu-9J for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 00:46:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtKvM-0000R3-GK; Thu, 19 Oct 2023 00:46:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/gFtHD+jSzJo0nzwS+96dBRGESiR7u28RSTzrq09rzA=; b=J6Yjo3d8HVhO WRg+QANOdchOq0v5hFDnT10yeiAnaC0emkRxUdNgVRFzWa31EL7MOlT076PzQU33GW+8HGm6p3WOd OAXSWqDwXSDdx1g4gVhr/SMl7aZS+nZKVOfwYGFc8Ry1omMiwoRNTgFJ9+t1iJcZv1TzaXfHNkC+2 Z/IaYwZA3g5aNDSY8+zgFPwy6l4V8eXmYNGkMhVV1Zo2WfYIhzk+xcLdqomiVR74cQ0hwkSWX04re F5X7304pSZzkA5B1o7O82Tiy4BBGtDIGTVCcR2yfOYTKj51agicfk0BOXssTdQ8+wL6zMYapGeJlL gtc+yYU9aNh/RkrFy53/xw==; Date: Thu, 19 Oct 2023 07:46:09 +0300 Message-Id: <83wmvjmd7y.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> (message from Dmitry Gutov on Thu, 19 Oct 2023 03:42:24 +0300) Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands References: <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@janestreet.com, sbaugh@catern.com, 63648@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Spencer Baugh , 63648@debbugs.gnu.org, > sbaugh@catern.com > Date: Thu, 19 Oct 2023 03:42:24 +0300 > From: Dmitry Gutov > > +;;;###autoload > +(defun project-other-command () > + "Run command with `default-directory' set to the current project root." I very much hope you will find a better name for this command. The "other" part seems to be out of place here, at least as far as the doc string is considered. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 02:59:23 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 06:59:23 +0000 Received: from localhost ([127.0.0.1]:35719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtN07-0003J6-8U for submit@debbugs.gnu.org; Thu, 19 Oct 2023 02:59:23 -0400 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:56041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtN02-0003IT-FK for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 02:59:19 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id C03D3FF80E; Thu, 19 Oct 2023 06:58:43 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <83wmvjmd7y.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 19 Oct 2023 07:46:09 +0300") Organization: LINKOV.NET References: <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <83wmvjmd7y.fsf@gnu.org> Date: Thu, 19 Oct 2023 09:43:42 +0300 Message-ID: <86a5sfxgbl.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , sbaugh@catern.com, 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> +(defun project-other-command () >> + "Run command with `default-directory' set to the current project root." > > I very much hope you will find a better name for this command. The > "other" part seems to be out of place here, at least as far as the doc > string is considered. The prefix 'other-' would make sense for consistency with 'other-window-...', etc. But when the prefix is 'project-' then the function name doesn't need to contain the word "other". From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 03:52:25 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 07:52:25 +0000 Received: from localhost ([127.0.0.1]:35760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtNpR-0007h8-2u for submit@debbugs.gnu.org; Thu, 19 Oct 2023 03:52:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtNpN-0007gm-8X for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 03:52:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtNoq-0000gD-F7; Thu, 19 Oct 2023 03:51:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WqC66rp7ntVEQSaJdAs9ZJHrDRLN0Ov8jeTnEYAXZ94=; b=SLpOO+gd4ZD7 4OYiccYL8B8OuPuyJfq0yI7BMbRPC6LBtl5IIK19hZmaip5YueksuAdt/4nEfJXuNaoh0sIwbLVfW 5cLeY1ZqFEnq52Bp5xiGs+h+bRhZACKydNrjH4S6lJucQLbyszoV4j8aWNcHUSzwBh9N85pEmUMan GGSiRFRPx8yDJXhfZjH7azRWrE+C9GKeOep7mN7js+9aG60TiKqdrTbGZb7HOdUSuDCqi/eV8Ujbc MsvoarwU7ehKJ6Sjyt/BCwUQ7SfITDa2/gleGibR1YoJwkUlHaFiUf5p5b5e23e1z/X6LmWZYRR5h jXxn6Ntz+BQlH176Mwet1g==; Date: Thu, 19 Oct 2023 10:51:39 +0300 Message-Id: <83sf67m4ms.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86a5sfxgbl.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 19 Oct 2023 09:43:42 +0300) Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands References: <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <83wmvjmd7y.fsf@gnu.org> <86a5sfxgbl.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: dmitry@gutov.dev, sbaugh@catern.com, 63648@debbugs.gnu.org, sbaugh@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: Dmitry Gutov , sbaugh@janestreet.com, > 63648@debbugs.gnu.org, sbaugh@catern.com > Date: Thu, 19 Oct 2023 09:43:42 +0300 > > >> +(defun project-other-command () > >> + "Run command with `default-directory' set to the current project root." > > > > I very much hope you will find a better name for this command. The > > "other" part seems to be out of place here, at least as far as the doc > > string is considered. > > The prefix 'other-' would make sense for consistency with 'other-window-...', etc. How is it consistent with "other-window" commands? More accurately, what is this "other" thing that makes the "other" part in the command name relevant? From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 05:47:38 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 09:47:38 +0000 Received: from localhost ([127.0.0.1]:35846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtPcs-0003Kz-LJ for submit@debbugs.gnu.org; Thu, 19 Oct 2023 05:47:38 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:40649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtPco-0003Ke-4Z for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 05:47:33 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 5D5453200A52; Thu, 19 Oct 2023 05:46:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Oct 2023 05:46:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697708816; x=1697795216; bh=SHoR/pvov4oIB3xNynQoxKWHtQ5ijunp4V4 Nyk0KJAI=; b=eoMPBijXBgOEm4vYztnWamaz00c1Xp2F+WySBng1skYaJnKHHJG 82ALyWI4M/iE8Qp04/4u9V+yJipV+4k9nCq7cZVK9DYDlIuzGESuUBuA63di0act o/8l47gG7wFZuLLDrEHddT51SZZOf2ktJVj+aCnUYGb/1wppd9hTseKjOqMAwhdU rCLJqtqYmgcjx+TqJCPChefJiOFURuNnh2iYO/kdq6BRuWDknQ0WCZG3VYtXrHeg K1p81bZCR6sWDptL2j9+a9yY6qWvTbz1SFn/rflN4yTIDlOulzxXSW4fLkgRM62M cFryyl7umQAQaJ+f5SBxSNYiayd3K2oCcag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697708816; x=1697795216; bh=SHoR/pvov4oIB3xNynQoxKWHtQ5ijunp4V4 Nyk0KJAI=; b=JG1Z646giBwGm7YdubkxwBPS3ivwKCwSctw+NTevIR17p3E3gbc 616Grjy2LGrooKjp4s71sDZdx1UX2g7ONtE0Tc0w4czeps1nZAgeqVH0lKSOgQRJ pQ32B/0f0XOqfUvp40OGXYcEJktzKyzQo43IgPLG6SpMKMUOojkDFPajmY4JANRW UCUYBiZS+PkkZe0Gwe6GjS2cufFGNzJzB9ylQaUY85rOHxE3MPjcMGgE9gTOeH4j diuMAS4isfW//JBHrUHFYBzROKPijQXRnABwyKOtaKIEFpnnJwYiy8nVQ3k6skeq U0YN7/tB+sFOzgnUgTnOkzZmNvH5DrQ1SMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeigddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 05:46:55 -0400 (EDT) Message-ID: Date: Thu, 19 Oct 2023 12:46:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Eli Zaretskii References: <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <83wmvjmd7y.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83wmvjmd7y.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@janestreet.com, sbaugh@catern.com, 63648@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 19/10/2023 07:46, Eli Zaretskii wrote: >> Cc: Spencer Baugh,63648@debbugs.gnu.org, >> sbaugh@catern.com >> Date: Thu, 19 Oct 2023 03:42:24 +0300 >> From: Dmitry Gutov >> >> +;;;###autoload >> +(defun project-other-command () >> + "Run command with `default-directory' set to the current project root." > I very much hope you will find a better name for this command. The > "other" part seems to be out of place here, at least as far as the doc > string is considered. The intended meaning was "execute any other command in project", that is any other than those that are already present in project-prefix-map. It also matches the "o" binding, which is very conveniently positioned. But I'm not at all married to the name, better ideas welcome. project-any-command project-prefix-command project-execute-command [as opposed to extended command? which reads the command name] project-execute-other-command project-execute-in-root ... your suggestions here From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 07:06:14 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 11:06:14 +0000 Received: from localhost ([127.0.0.1]:35923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtQr0-0000Kx-Ee for submit@debbugs.gnu.org; Thu, 19 Oct 2023 07:06:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtQqv-0000Ki-Tb for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 07:06:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtQqP-0008Sg-2H; Thu, 19 Oct 2023 07:05:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lVKZkp9SxxS5BITWk2/T8gN/jMdcB+PbsjlDeXc/KgY=; b=S2HPTl6rELjg mPsl5LaC9ARnNz1+yAWlDvp3TAWVkiaZlNX5kDSihemXA0UeDwl+hevCoNGW/wyhgtAV17f4Edmq2 PdyDDbPgsK/LQk9axcc789lksexNQ4YnRb1a/k+7d/JWzYeIvCQ6sp9mM+wnBRyJgsiyiI5gXPeKN v6kRXoOgz10vd9ZDABQGwX6sDu+bOJAKAgBjBXkXQ+6Q2Krl3lo/c3xNbY8rsFVMrfcpst9sef6pU f9FJocyNR/iC99DsObKqXwNiYdOOGs/G0S86cLAVs2uuBdzCHWdKlj9mjhHBZVbTdVq7wBIC7XqeM 19w5Fx0OMFVrJQod7WvBxA==; Date: Thu, 19 Oct 2023 14:05:30 +0300 Message-Id: <83wmviub2d.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Thu, 19 Oct 2023 12:46:53 +0300) Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands References: <86y1hs4kkg.fsf@mail.linkov.net> <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <83wmvjmd7y.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@janestreet.com, sbaugh@catern.com, 63648@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 19 Oct 2023 12:46:53 +0300 > Cc: juri@linkov.net, sbaugh@janestreet.com, 63648@debbugs.gnu.org, > sbaugh@catern.com > From: Dmitry Gutov > > On 19/10/2023 07:46, Eli Zaretskii wrote: > >> Cc: Spencer Baugh,63648@debbugs.gnu.org, > >> sbaugh@catern.com > >> Date: Thu, 19 Oct 2023 03:42:24 +0300 > >> From: Dmitry Gutov > >> > >> +;;;###autoload > >> +(defun project-other-command () > >> + "Run command with `default-directory' set to the current project root." > > I very much hope you will find a better name for this command. The > > "other" part seems to be out of place here, at least as far as the doc > > string is considered. > > The intended meaning was "execute any other command in project", that is > any other than those that are already present in project-prefix-map. It > also matches the "o" binding, which is very conveniently positioned. > > But I'm not at all married to the name, better ideas welcome. > > project-any-command This one looks like a good name to me. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 07:35:10 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 11:35:10 +0000 Received: from localhost ([127.0.0.1]:35946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtRJ0-0003pG-Eq for submit@debbugs.gnu.org; Thu, 19 Oct 2023 07:35:10 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:47387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtRIv-0003oY-5X for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 07:35:08 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 4A6B43200A11; Thu, 19 Oct 2023 07:34:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Oct 2023 07:34:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697715271; x=1697801671; bh=i90EWhpcAnoLvRzQGdYJjqalazJHa+5je2Z 7T2UytJs=; b=LC0oTHKCBYFQBM0BVu1ybOAGhXFsXQQnGylb+GWJ+OKtzhqOYig H/KUYlOM/aEcpw7TJS2F5bbT0Ylq68oL1Ip0WCGkT6G+vty99jKI+1CTf4Q+Z4N8 JXLTauGpOEApGNQDCt8J2t1YmTPT5tGO/N25cBMh5ux93Qvq3+WkL0Nms7Ba2i8L XBW/Q834mKflqhgR8o+zuZD8bXP6H1uS80WXEqvqqSGT2QPqq+D2rZvfo2Axk4Ml A7a4cduXblySLFfCgHYp198i2Gxg6bnWO/ijnTigqxJ1BBgNf9/dALsJp1T1lDzk zjXZHa0aot8vf6boo222pNTA8wtBab9bnHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697715271; x=1697801671; bh=i90EWhpcAnoLvRzQGdYJjqalazJHa+5je2Z 7T2UytJs=; b=l8SgahOpuP+2s7Af0bCDIqS2ZUf5CalwTvNn/v6iGl6QL/YBvTY VNW3YeNV7UIAu8e54EP688OVunRXMOTTFCbr15GAjLTri+PkRVcIhwdU8fyoVtLm SDQl0XhBQHRBdnUPCz0insFXNRhziWS6o8twfblZFEFfDDkNjuqdc6n1jXOCVLu8 xVfLQEMGubO87wj5/KxyepKnHUcE6EMejCgYo0fYAtp5fIbanzMCvFsQsXJ++o3o 8HO1gjvj7i7CVsUAwCLsQ7j1hhvBAEt6r9R7arfEMJqG+QSZG/GPrPDOX3IR/YxY cY9BYTyHNZDDLBaSX33m1ptl9uuDRr1MEcw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeigdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 07:34:30 -0400 (EDT) Message-ID: <1812033c-b069-d157-aa3f-0e2b1a185411@gutov.dev> Date: Thu, 19 Oct 2023 14:34:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Eli Zaretskii References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <83wmvjmd7y.fsf@gnu.org> <83wmviub2d.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83wmviub2d.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@janestreet.com, sbaugh@catern.com, 63648@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 19/10/2023 14:05, Eli Zaretskii wrote: >> Date: Thu, 19 Oct 2023 12:46:53 +0300 >> Cc:juri@linkov.net,sbaugh@janestreet.com,63648@debbugs.gnu.org, >> sbaugh@catern.com >> From: Dmitry Gutov >> >> On 19/10/2023 07:46, Eli Zaretskii wrote: >>>> Cc: Spencer Baugh,63648@debbugs.gnu.org, >>>> sbaugh@catern.com >>>> Date: Thu, 19 Oct 2023 03:42:24 +0300 >>>> From: Dmitry Gutov >>>> >>>> +;;;###autoload >>>> +(defun project-other-command () >>>> + "Run command with `default-directory' set to the current project root." >>> I very much hope you will find a better name for this command. The >>> "other" part seems to be out of place here, at least as far as the doc >>> string is considered. >> The intended meaning was "execute any other command in project", that is >> any other than those that are already present in project-prefix-map. It >> also matches the "o" binding, which is very conveniently positioned. >> >> But I'm not at all married to the name, better ideas welcome. >> >> project-any-command > This one looks like a good name to me. Works for me. I'll be waiting for the feedback on the rest of the proposed change. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 08:23:21 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 12:23:21 +0000 Received: from localhost ([127.0.0.1]:36032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtS3d-00085R-6W for submit@debbugs.gnu.org; Thu, 19 Oct 2023 08:23:21 -0400 Received: from s.wfbtzhsw.outbound-mail.sendgrid.net ([159.183.224.105]:22990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtS3a-000858-Se for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 08:23:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=+pb0pNY7psgDBu47hlLvIwJBatTX9Ghf38cl0h/ppgI=; b=tVWdUmNNuE5gBvjjMkXvAn5yJ4JuAQ67Imh6bGjCVGOMEjZ1Xff2RaQ7B9dXN26NMc8E vSiOsX7/mSIdBb/o5et2NWNXB2nlatYK53pA9sE6spk5q1SHyChvOrKs1vXJMOx5cjOjZQ XqtuJ0H5fjlFA3V2CkDTmuZ2LhnOuQqESKvysnjS2bs1q656yhyEQqGRoD4eSoUYbM6c4Y 1pu+96kVlL+GPYJz7RLufq39ktdE2HX4gh5oEnnlW/FrvZlrLyiAfBL3d2zsYHXZqoSoIi pwnmFGF1Jvqc8gb7OELQJ7SGfkgS2GttVOU/FxGJTj1L1EIP/29C8e0EXBIV3i5w== Received: by filterdrecv-d585b8d85-tktxc with SMTP id filterdrecv-d585b8d85-tktxc-1-65311F94-24 2023-10-19 12:22:44.858936406 +0000 UTC m=+150145.192633501 Received: from earth.catern.com (unknown) by geopod-ismtpd-17 (SG) with ESMTP id JWxpm3HBQ36QM7evnwoWQQ Thu, 19 Oct 2023 12:22:44.609 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gutov.dev Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id E5E8E6006E; Thu, 19 Oct 2023 08:22:43 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> (Dmitry Gutov's message of "Thu, 19 Oct 2023 03:42:24 +0300") References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> Date: Thu, 19 Oct 2023 12:22:44 +0000 (UTC) Message-ID: <87r0lqu7ho.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbJUrGlQzS6FU3zpT3Y3ML?= =?us-ascii?Q?W8GPdsSGJCXMT=2FqpdbVmk1I2Lns6RfIsjBuQxjR?= =?us-ascii?Q?JlJwURw1zg+gw7x0x+maTICoDtWau0RRhM0428e?= =?us-ascii?Q?kyQwL6vOgG8GKTwVAGNXsON5cswoWKnq=2FXZXFRC?= =?us-ascii?Q?zI+1z1EadpbDRjJS4poXtPrVuM3wMy2GcUw=3D=3D?= To: Dmitry Gutov X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) Dmitry Gutov writes: > Hi Juri, > > On 22/09/2023 18:52, Juri Linkov wrote: >>>> Probably. Would you like to propose one? So that I have something to >>>> compare to, and have something specific to put to the vote as well. >>> >>> Ok, something like this: >> Here is a more tested patch. It supports these cases: >> (setq project-switch-use-entire-map t) >> C-x p p C-b - should not include current buffer in the list of >> another project (bug#58784) >> C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) >> C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) >> C-x p p C-x d - should visit another project's root (bug#63648) >> The same with frames: >> C-x 5 p p C-b >> C-x 5 p p f M-n >> C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) >> C-x 5 p p C-x d > > Thank you. Especially for the list. > > But I think we still haven't reached a decision whether the "loop > until correct key is pressed" behavior is useful. > > I tried to think how to fit the above requirements into the existing > model, and it seems to require a new command, and an additional key > being pressed sometimes, for explicitness. > > The attached patch also includes your fix for bug#65558, which seems > orthogonal to our dilemma, and could probably be installed > separately. It could be dry-ed up a little, though. > > Anyway, with the attached counter-proposal, the list looks like this: > > C-x p p C-b - works when project-switch-use-entire-map=t > C-x p p f M-n - always works > C-u C-x p p f - same > C-x p p C-x d - the key sequence is 'C-x p p o C-x d' > > With frames: > > C-x 5 p p C-b - works when project-switch-use-entire-map=t > C-x 5 p p f M-n - always works > C-u C-x 5 p p f emoji TAB - same (thanks to your fix, included) > C-x 5 p p C-x d - the key sequence is 'C-x 5 C-x p p o C-x d' > > The user could add project-list-buffers (or project-switch-to-buffer) > to project-switch-commands, though, and then > project-switch-use-entire-map won't be needed. Either way's fine. > > To sum up, that does require pressing an extra key to use commands > outside of project-prefix-map, but OTOH that key is shown right in the > commands menu. And one doesn't have to (setq > project-switch-use-entire-map t) to use it, though that doesn't hurt > either. > > And the meaning of project-switch-use-entire-map remains as it > currently is: expand the set of keys to the whole project-prefix-map, > but not to all local and global ones. > > WDYT? Hm, I personally think having to hit the extra "o" is undesirable. I'm not sure whether "C-x p p o" would be an improvement over the current state of the world: you can already hit "C-x p p D" to run project-dired, so you end up in dired at the root of the project, and then run whatever command you like with default-directory=project-root. The main downside of C-x p p D is that it necessarily switches buffers, which I often don't want. Solving that would be nice, but it would be nice to also get a shorter keybinding out of it. Actually, this gives me an idea. What if we embraced having C-x p p switch buffers? What if we had a new command which jumps you to some new "project status buffer", whose default-directory=project-root, and which has single-letter bindings for the current project-prefix commands? Similar to vc-dir. We could probably find some useful information to display in that buffer, too, like a header which extracts the status from the project's compilation buffer, or a list of the buffers in the project. If we replaced C-x p p with this command, then that would avoid all our issues with default-directory and command loops and so on, by just biting the bullet and switching buffers. Although, maybe we can get the best of both worlds by having C-x p p just temporarily switch buffer? It can do (with-current-buffer (project-status) ...) plus resolving keybindings as if they were typed in the project-status buffer. That seems pretty elegant to me and resolves a lot of complexities without giving up anything. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 08:50:00 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 12:50:00 +0000 Received: from localhost ([127.0.0.1]:36069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtSTP-00035y-PD for submit@debbugs.gnu.org; Thu, 19 Oct 2023 08:50:00 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:41697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtSTN-00035i-In for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 08:49:58 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id ADF023200AE6; Thu, 19 Oct 2023 08:49:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Oct 2023 08:49:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697719763; x=1697806163; bh=BgFrGAAEzHUbR/YiOwb1GJDTlZFqs3jxH6m N8Q9322U=; b=cdLhdx1GZhy9MDZCZYYQylF3qAHme6K8Nr/s3wP++aLwx1FLQcU dl57HzgfAny6C90WLAdh8o2u836BJ5mhguWhoIn2cUlJBT+W87DnRLqf/Utac4Z1 tRvIMc5PWkEZYNsDFxylpioRowifW/RrEcOIK2An7r24eg/ZIvACx46DIr8nBlVm NU/ek1QJrtC8VdrNu0p/ZqGHwXqwILN8JEkqW6PGflMzqSUojP/XO3sKkjNCm+OJ Oo3tRyNNIuA7t0/hqBHa0UI5NY3QeQuJ1Uz+m66MPqu2MofC51N7TWoc2ch2axa8 hEiMbiNl9TzVD8HvHXs8/LNBGdHOnqgNqRg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697719763; x=1697806163; bh=BgFrGAAEzHUbR/YiOwb1GJDTlZFqs3jxH6m N8Q9322U=; b=o1IIXB8cVVrrKhwWl8M7L0ZULtbpxum66X81dazVsO1Eta2TQJ5 QGUOUIo/axFKSy3ndJI+6E0gAttWPSrU3+jDwk5HSjer9+GzK9rImfKXj6EHTejM ioShpBxYUzWs9kyGtOtaqAVglewVQXnpwKgh952WpelNoe2psu362Bi+2So4Huk0 9ENG1+Ab6k5Ug1Wgwkvn/u526LsyLSl0+GPX/NKYSqywSCMZRdS3gv9vOzdDbKI+ IqweUQxoHlldPm+SDORK471MhIijTL7K2qQeKR4St+opV+g7wHPNcEQGe+JTKOae v7nIjGHP9yJKG/wwRM89h21igZzzH6iPLng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeigdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpefhuedtkeevgeegteetkeefjeffgeduudduhfeuveelfedtffffgeegiedvvdej leenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 08:49:22 -0400 (EDT) Message-ID: <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> Date: Thu, 19 Oct 2023 15:49:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: sbaugh@catern.com References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> From: Dmitry Gutov In-Reply-To: <87r0lqu7ho.fsf@catern.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 19/10/2023 15:22, sbaugh@catern.com wrote: > Dmitry Gutov writes: >> Hi Juri, >> >> On 22/09/2023 18:52, Juri Linkov wrote: >>>>> Probably. Would you like to propose one? So that I have something to >>>>> compare to, and have something specific to put to the vote as well. >>>> >>>> Ok, something like this: >>> Here is a more tested patch. It supports these cases: >>> (setq project-switch-use-entire-map t) >>> C-x p p C-b - should not include current buffer in the list of >>> another project (bug#58784) >>> C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) >>> C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) >>> C-x p p C-x d - should visit another project's root (bug#63648) >>> The same with frames: >>> C-x 5 p p C-b >>> C-x 5 p p f M-n >>> C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) >>> C-x 5 p p C-x d >> >> Thank you. Especially for the list. >> >> But I think we still haven't reached a decision whether the "loop >> until correct key is pressed" behavior is useful. >> >> I tried to think how to fit the above requirements into the existing >> model, and it seems to require a new command, and an additional key >> being pressed sometimes, for explicitness. >> >> The attached patch also includes your fix for bug#65558, which seems >> orthogonal to our dilemma, and could probably be installed >> separately. It could be dry-ed up a little, though. >> >> Anyway, with the attached counter-proposal, the list looks like this: >> >> C-x p p C-b - works when project-switch-use-entire-map=t >> C-x p p f M-n - always works >> C-u C-x p p f - same >> C-x p p C-x d - the key sequence is 'C-x p p o C-x d' >> >> With frames: >> >> C-x 5 p p C-b - works when project-switch-use-entire-map=t >> C-x 5 p p f M-n - always works >> C-u C-x 5 p p f emoji TAB - same (thanks to your fix, included) >> C-x 5 p p C-x d - the key sequence is 'C-x 5 C-x p p o C-x d' >> >> The user could add project-list-buffers (or project-switch-to-buffer) >> to project-switch-commands, though, and then >> project-switch-use-entire-map won't be needed. Either way's fine. >> >> To sum up, that does require pressing an extra key to use commands >> outside of project-prefix-map, but OTOH that key is shown right in the >> commands menu. And one doesn't have to (setq >> project-switch-use-entire-map t) to use it, though that doesn't hurt >> either. >> >> And the meaning of project-switch-use-entire-map remains as it >> currently is: expand the set of keys to the whole project-prefix-map, >> but not to all local and global ones. >> >> WDYT? > > Hm, I personally think having to hit the extra "o" is undesirable. I'm > not sure whether "C-x p p o" would be an improvement over the current > state of the world: you can already hit "C-x p p D" to run > project-dired, so you end up in dired at the root of the project, and > then run whatever command you like with default-directory=project-root. It makes this capability apparent, and it's still one fewer keystroke (and 'o' is close to 'p', too). > The main downside of C-x p p D is that it necessarily switches buffers, > which I often don't want. Solving that would be nice, but it would be > nice to also get a shorter keybinding out of it. > > Actually, this gives me an idea. What if we embraced having C-x p p > switch buffers? What if we had a new command which jumps you to some > new "project status buffer", whose default-directory=project-root, and > which has single-letter bindings for the current project-prefix > commands? Similar to vc-dir. We could probably find some useful > information to display in that buffer, too, like a header which extracts > the status from the project's compilation buffer, or a list of the > buffers in the project. I'm totally on board with adding such command, except I'm not sure if we will give away the 'C-x p p' binding to it. But as far as calling the "next" command, both project-vc-dir and project-dired currently satisfy your condition, right? > If we replaced C-x p p with this command, then that would avoid all our > issues with default-directory and command loops and so on, by just > biting the bullet and switching buffers. Except when one wants to call a command that takes the current buffer into account. And/or its contents in particular (e.g. file name at point). > Although, maybe we can get the best of both worlds by having C-x p p > just temporarily switch buffer? It can do (with-current-buffer > (project-status) ...) plus resolving keybindings as if they were typed > in the project-status buffer. That seems pretty elegant to me and > resolves a lot of complexities without giving up anything. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem caused by a similar approach in the implementation. OTOH, https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58784 probably doesn't apply (most of the time; unless the projects are nested or whatever). From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 10:00:44 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 14:00:44 +0000 Received: from localhost ([127.0.0.1]:37348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtTZq-0005fG-87 for submit@debbugs.gnu.org; Thu, 19 Oct 2023 10:00:44 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:34975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtTZl-0005em-Lv for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 10:00:41 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> (Dmitry Gutov's message of "Thu, 19 Oct 2023 15:49:20 +0300") References: <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> Date: Thu, 19 Oct 2023 10:00:05 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Dmitry Gutov writes: > On 19/10/2023 15:22, sbaugh@catern.com wrote: >> Hm, I personally think having to hit the extra "o" is undesirable. >> I'm >> not sure whether "C-x p p o" would be an improvement over the current >> state of the world: you can already hit "C-x p p D" to run >> project-dired, so you end up in dired at the root of the project, and >> then run whatever command you like with default-directory=project-root. > > It makes this capability apparent, and it's still one fewer keystroke > (and 'o' is close to 'p', too). One fewer keystroke? Oh, since one has to hit shift to type D... there's equivalently C-x p p v, then, which is the same length in keystrokes. >> The main downside of C-x p p D is that it necessarily switches buffers, >> which I often don't want. Solving that would be nice, but it would be >> nice to also get a shorter keybinding out of it. >> Actually, this gives me an idea. What if we embraced having C-x p p >> switch buffers? What if we had a new command which jumps you to some >> new "project status buffer", whose default-directory=project-root, and >> which has single-letter bindings for the current project-prefix >> commands? Similar to vc-dir. We could probably find some useful >> information to display in that buffer, too, like a header which extracts >> the status from the project's compilation buffer, or a list of the >> buffers in the project. > > I'm totally on board with adding such command, except I'm not sure if > we will give away the 'C-x p p' binding to it. But as far as calling > the "next" command, both project-vc-dir and project-dired currently > satisfy your condition, right? Yes. Although project-vc-dir and project-dired don't provide a nice solution for how to implement the C-x p p single key bindings. With the project-status buffer, if it had the single-key bindings, then we would just say "C-x p p resolves keybindings as they would be resolved in project-status". BTW, a more tangential idea: a list-projects command and associated *Project List* buffer would be nice. With: - a list of all remembered projects, with some details about each one - you can hit RET to open a project's project-status - with something (a post-command-hook?) which updates default-directory so that it matches the project at point, so commands you run operate on that project (e.g. find-file) - and the same single key bindings that are in project-prefix-map (maybe C-x p RET should be the binding to open project-status in general) This would be a nice complement to project-switch-project: list-projects and project-switch-project would be like list-buffers and switch-to-buffer. (The combination of list-projects and project-status buffers would basically be a port of what we have internally at Jane Street. While I'm saying that, I should mention also our equivalent of project-switch-project: when passed a prefix argument, all our equivalent-to-project-* commands will prompt for a project. This is not a great solution though, it doesn't scale well since every command needs to be aware of this prefix argument. The C-x p p design of a separate command which overrides the project for the next command is much better, and once we get a good design I plan to tell our users to start using C-x p p for our internal commands instead of passing the prefix argument.) >> If we replaced C-x p p with this command, then that would avoid all our >> issues with default-directory and command loops and so on, by just >> biting the bullet and switching buffers. > > Except when one wants to call a command that takes the current buffer > into account. And/or its contents in particular (e.g. file name at > point). > >> Although, maybe we can get the best of both worlds by having C-x p p >> just temporarily switch buffer? It can do (with-current-buffer >> (project-status) ...) plus resolving keybindings as if they were typed >> in the project-status buffer. That seems pretty elegant to me and >> resolves a lot of complexities without giving up anything. > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem > caused by a similar approach in the implementation. OTOH, I was thinking we'd solve both this specific problem and the general case by just saving the current buffer in a project-old-buffer variable so that project-aware commands could go back and grab stuff from it. It does mean that project-unaware commands can't both operate in a different project and on the current buffer. Is there ever a place we actually want that though? > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58784 probably doesn't > apply (most of the time; unless the projects are nested or whatever). Indeed. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 13:17:49 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 17:17:49 +0000 Received: from localhost ([127.0.0.1]:37708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtWea-0003Jy-VY for submit@debbugs.gnu.org; Thu, 19 Oct 2023 13:17:49 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:33707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtWeU-0003Ja-M2 for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 13:17:47 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5DD603200A3A; Thu, 19 Oct 2023 13:17:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 19 Oct 2023 13:17:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697735828; x=1697822228; bh=r5+7kJdBD0Vel8a50Vfl8JsrCjEdQGRNONQ JxL3uExU=; b=Cena81z3V8aWWnpK+7otTme+sR9yQ44Lm2Na5XemjukeQu82Tkz rFoNfK8Al4TPaMapYPYc5zQKIkzPWGdTb18DYBibVMzIZq12WStxocZsEYijC1g/ LUl4JeRl9yZ67VZ6JtDXpuZV6h6GHQqiYEIMX8MgR/CrPgG3XdvA81tDNqu7B07n 9NCflPuH4d3SWL2xCBdCkf56Nr5NUAubScmmIAqmBhTMdzSWO1f0uB8In/LPejM3 W9YaWnK7+AofUQIF+a6bPCokGGbjzOSdv371bjSpkJRljfq5de7BJAK33MAMKb// O1vmJad8edHvikJLXa0RRmuIivbyoXac4dA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697735828; x=1697822228; bh=r5+7kJdBD0Vel8a50Vfl8JsrCjEdQGRNONQ JxL3uExU=; b=dQopJ2pCVdNZQEcA+eG0JSGAF/o5KNM77IQYS8l0o4nMT+Ru1Z2 OjhgNUnk5+E+F/DF3Qfu1rmXCG7LPyFaRx4URri8GaU3sBdXvJsV5yznkICz4+mo ocyLOn/TeWNDOZDJS3SVQmMNlSO3ycCIxmzxBK7q9c7srKITd3CaRagvlO2WORA4 rmcW9DCeP/PakqYSMB/sGbdqzn3TthoxrA99wVEtC5VNSG2TX92tYba1fC3CVyEY YEuGG4Esn8dayRrBPuh9UPK52uKKFJUFuJg3FsijLx9qgwbRINam+peRMCdqt340 0WFoDI++sCUZBQ5oG+ifUOklrPX4wP3eLiQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeigdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfeutdekveeggeetteekfeejffegudduudfhueevleeftdffffeggeeivddv jeelnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 13:17:07 -0400 (EDT) Message-ID: <6fb5f40a-48cf-c5fc-d609-df90790f66e6@gutov.dev> Date: Thu, 19 Oct 2023 20:17:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Spencer Baugh References: <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 19/10/2023 17:00, Spencer Baugh wrote: >> It makes this capability apparent, and it's still one fewer keystroke >> (and 'o' is close to 'p', too). > > One fewer keystroke? Oh, since one has to hit shift to type > D... there's equivalently C-x p p v, then, which is the same length in > keystrokes. 'C-x p p v' is a bit farther, but close enough indeed. >>> The main downside of C-x p p D is that it necessarily switches buffers, >>> which I often don't want. Solving that would be nice, but it would be >>> nice to also get a shorter keybinding out of it. >>> Actually, this gives me an idea. What if we embraced having C-x p p >>> switch buffers? What if we had a new command which jumps you to some >>> new "project status buffer", whose default-directory=project-root, and >>> which has single-letter bindings for the current project-prefix >>> commands? Similar to vc-dir. We could probably find some useful >>> information to display in that buffer, too, like a header which extracts >>> the status from the project's compilation buffer, or a list of the >>> buffers in the project. >> >> I'm totally on board with adding such command, except I'm not sure if >> we will give away the 'C-x p p' binding to it. But as far as calling >> the "next" command, both project-vc-dir and project-dired currently >> satisfy your condition, right? > > Yes. Although project-vc-dir and project-dired don't provide a nice > solution for how to implement the C-x p p single key bindings. With the > project-status buffer, if it had the single-key bindings, then we would > just say "C-x p p resolves keybindings as they would be resolved in > project-status". Hmm... if the goal is to just have 'C-x p p' resolve the short key bindings, then (setq project-switch-use-entire-map t) gets you all the way there, doesn't it? So the question is, do you need to be able to use non-project commands (like in the title of this report), and how often? If it's not very often (which would reflect my experience), then pressing 'o' once in a while should be a small price to pay. BTW, when project-switch-use-entire-map is non-nil, we should probably display something informative to the user (e.g. some abbreviated list of all the bindings in project-prefix-map?), so that the users don't mistake the the meaning of the option, and see at least some of the keys they can press at that point, instead of the incorrect command menu. > BTW, a more tangential idea: a list-projects command and associated > *Project List* buffer would be nice. With: > > - a list of all remembered projects, with some details about each one > - you can hit RET to open a project's project-status > - with something (a post-command-hook?) which updates default-directory > so that it matches the project at point, so commands you run operate > on that project (e.g. find-file) > - and the same single key bindings that are in project-prefix-map > (maybe C-x p RET should be the binding to open project-status in general) > > This would be a nice complement to project-switch-project: list-projects > and project-switch-project would be like list-buffers and > switch-to-buffer. That reminds me of bug#63896. And I suppose some pieces could be reused between these views. Speaking of 'list-projects', though, I wonder what we could display for a project by default, aside from its root dir (abbreviated) and the number of open buffers. > (The combination of list-projects and project-status buffers would > basically be a port of what we have internally at Jane Street. While > I'm saying that, I should mention also our equivalent of > project-switch-project: when passed a prefix argument, all our > equivalent-to-project-* commands will prompt for a project. This is not > a great solution though, it doesn't scale well since every command needs > to be aware of this prefix argument. The C-x p p design of a separate > command which overrides the project for the next command is much better, > and once we get a good design I plan to tell our users to start using > C-x p p for our internal commands instead of passing the prefix > argument.) > >>> If we replaced C-x p p with this command, then that would avoid all our >>> issues with default-directory and command loops and so on, by just >>> biting the bullet and switching buffers. >> >> Except when one wants to call a command that takes the current buffer >> into account. And/or its contents in particular (e.g. file name at >> point). >> >>> Although, maybe we can get the best of both worlds by having C-x p p >>> just temporarily switch buffer? It can do (with-current-buffer >>> (project-status) ...) plus resolving keybindings as if they were typed >>> in the project-status buffer. That seems pretty elegant to me and >>> resolves a lot of complexities without giving up anything. >> >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem >> caused by a similar approach in the implementation. OTOH, > > I was thinking we'd solve both this specific problem and the general > case by just saving the current buffer in a project-old-buffer variable > so that project-aware commands could go back and grab stuff from it. I suppose they could, but then we support using them all (?) already with project-switch-use-entire-map. When one has custom commands, the user would probably add them to project-prefix-map too. > It does mean that project-unaware commands can't both operate in a > different project and on the current buffer. Is there ever a place we > actually want that though? From where I'm standing, we've already passed into the "does anybody need this" territory. But people can write their own commands, or install packages, and apparently sometimes combine them with projects with advanced invocations. I'm happy to try optimizing different workflows, but it's probably at least equally important to make sure the new additions are consistent and predictable (meaning, it's easy to tell in advance whether something is going to work or not), and hopefully somewhat discoverable too. The latter probably means that we cannot make just any global key sequence work in the *Project List* buffer (or e.g. have 'M-x gnus' start in a different directory depending on which line point current is on). But we might have a binding for a prefix command which would make sure the next one is run within the project room as its default-directory. Binding 'project-any-command' (or a variation of it) to 'o' seems natural in there too. Do you disagree? From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 14:07:08 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 18:07:08 +0000 Received: from localhost ([127.0.0.1]:37735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtXQK-00050d-BH for submit@debbugs.gnu.org; Thu, 19 Oct 2023 14:07:08 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:52927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtXQE-0004zl-2m for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 14:07:04 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id A4EDAE0004; Thu, 19 Oct 2023 18:06:28 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> (Dmitry Gutov's message of "Thu, 19 Oct 2023 03:42:24 +0300") Organization: LINKOV.NET References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> Date: Thu, 19 Oct 2023 20:56:41 +0300 Message-ID: <86ttqmv7c6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > C-x p p C-x d - the key sequence is 'C-x p p o C-x d' BTW, with (setq project-switch-use-entire-map t) I accidentally typed 'C-x p p C-x d' that should ignore 'C-x' and read a directory with 'd', it fails with: (wrong-type-argument commandp 1) From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 14:07:12 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 18:07:12 +0000 Received: from localhost ([127.0.0.1]:37737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtXQN-00050n-Qy for submit@debbugs.gnu.org; Thu, 19 Oct 2023 14:07:12 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:37127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtXQJ-0004zq-5W for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 14:07:07 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5CC7440002; Thu, 19 Oct 2023 18:06:31 +0000 (UTC) From: Juri Linkov To: Spencer Baugh Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Spencer Baugh's message of "Thu, 19 Oct 2023 10:00:05 -0400") Organization: LINKOV.NET References: <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> Date: Thu, 19 Oct 2023 21:03:02 +0300 Message-ID: <86o7guv6ax.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem >> caused by a similar approach in the implementation. OTOH, > > I was thinking we'd solve both this specific problem and the general > case by just saving the current buffer in a project-old-buffer variable > so that project-aware commands could go back and grab stuff from it. > > It does mean that project-unaware commands can't both operate in a > different project and on the current buffer. Is there ever a place we > actually want that though? For example, 'C-x p p M-x rgrep RET' would need to read a word under point as the default value. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 15:31:03 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 19:31:03 +0000 Received: from localhost ([127.0.0.1]:37762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtYjW-00020a-TX for submit@debbugs.gnu.org; Thu, 19 Oct 2023 15:31:03 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtYjS-000201-9j for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 15:31:01 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <6fb5f40a-48cf-c5fc-d609-df90790f66e6@gutov.dev> (Dmitry Gutov's message of "Thu, 19 Oct 2023 20:17:05 +0300") References: <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> <6fb5f40a-48cf-c5fc-d609-df90790f66e6@gutov.dev> Date: Thu, 19 Oct 2023 15:30:26 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 19/10/2023 17:00, Spencer Baugh wrote: >>>> The main downside of C-x p p D is that it necessarily switches buffers, >>>> which I often don't want. Solving that would be nice, but it would be >>>> nice to also get a shorter keybinding out of it. >>>> Actually, this gives me an idea. What if we embraced having C-x p p >>>> switch buffers? What if we had a new command which jumps you to some >>>> new "project status buffer", whose default-directory=project-root, and >>>> which has single-letter bindings for the current project-prefix >>>> commands? Similar to vc-dir. We could probably find some useful >>>> information to display in that buffer, too, like a header which extracts >>>> the status from the project's compilation buffer, or a list of the >>>> buffers in the project. >>> >>> I'm totally on board with adding such command, except I'm not sure if >>> we will give away the 'C-x p p' binding to it. But as far as calling >>> the "next" command, both project-vc-dir and project-dired currently >>> satisfy your condition, right? >> Yes. Although project-vc-dir and project-dired don't provide a nice >> solution for how to implement the C-x p p single key bindings. With the >> project-status buffer, if it had the single-key bindings, then we would >> just say "C-x p p resolves keybindings as they would be resolved in >> project-status". > > Hmm... if the goal is to just have 'C-x p p' resolve the short key > bindings, then (setq project-switch-use-entire-map t) gets you all the > way there, doesn't it? To be clear, this was just a comment about how project-status would help us on the implementation side of single-key bindings. I still > So the question is, do you need to be able to use non-project commands > (like in the title of this report), and how often? > > If it's not very often (which would reflect my experience), then > pressing 'o' once in a while should be a small price to pay. I personally use non-project commands quite frequently through C-x p p D Some things I run sometimes: - find-file (if I just want to find a file from the root rather than with project-find-file) - vc-pull - vc-root-diff - various internal commands to access code review or check the build status > BTW, when project-switch-use-entire-map is non-nil, we should probably > display something informative to the user (e.g. some abbreviated list > of all the bindings in project-prefix-map?), so that the users don't > mistake the the meaning of the option, and see at least some of the > keys they can press at that point, instead of the incorrect command > menu. True. Automatically generating this would be kind of like which-key. >> BTW, a more tangential idea: a list-projects command and associated >> *Project List* buffer would be nice. With: >> - a list of all remembered projects, with some details about each >> one >> - you can hit RET to open a project's project-status >> - with something (a post-command-hook?) which updates default-directory >> so that it matches the project at point, so commands you run operate >> on that project (e.g. find-file) >> - and the same single key bindings that are in project-prefix-map >> (maybe C-x p RET should be the binding to open project-status in general) >> This would be a nice complement to project-switch-project: >> list-projects >> and project-switch-project would be like list-buffers and >> switch-to-buffer. > > That reminds me of bug#63896. And I suppose some pieces could be > reused between these views. Indeed. They're two perspectives on the same data. The main reason for bug#63896 though is to get the benefits of seeing the data that project-list presents, and then be able to run a command in an arbitrary > Speaking of 'list-projects', though, I wonder what we could display > for a project by default, aside from its root dir (abbreviated) and > the number of open buffers. Some possibilities: - The project type (or the vc type if it's a vc project?) - Maybe some vc information; whether the working tree is dirty? - The current number of warnings/errors in the *compilation* buffer for that project if any; I implemented that for bug#63896 and it's pretty easy >> (The combination of list-projects and project-status buffers would >> basically be a port of what we have internally at Jane Street. While >> I'm saying that, I should mention also our equivalent of >> project-switch-project: when passed a prefix argument, all our >> equivalent-to-project-* commands will prompt for a project. This is not >> a great solution though, it doesn't scale well since every command needs >> to be aware of this prefix argument. The C-x p p design of a separate >> command which overrides the project for the next command is much better, >> and once we get a good design I plan to tell our users to start using >> C-x p p for our internal commands instead of passing the prefix >> argument.) >> >>>> If we replaced C-x p p with this command, then that would avoid all our >>>> issues with default-directory and command loops and so on, by just >>>> biting the bullet and switching buffers. >>> >>> Except when one wants to call a command that takes the current buffer >>> into account. And/or its contents in particular (e.g. file name at >>> point). >>> >>>> Although, maybe we can get the best of both worlds by having C-x p p >>>> just temporarily switch buffer? It can do (with-current-buffer >>>> (project-status) ...) plus resolving keybindings as if they were typed >>>> in the project-status buffer. That seems pretty elegant to me and >>>> resolves a lot of complexities without giving up anything. >>> >>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem >>> caused by a similar approach in the implementation. OTOH, >> I was thinking we'd solve both this specific problem and the general >> case by just saving the current buffer in a project-old-buffer variable >> so that project-aware commands could go back and grab stuff from it. > > I suppose they could, but then we support using them all (?) already > with project-switch-use-entire-map. When one has custom commands, the > user would probably add them to project-prefix-map too. Er, I'm not sure I understand. Let me clarify: The "specific problem and the general case" that I was referring to is the problem with some implementations of project-switch-project where the buffer changes when we use project-switch-project, meaning we can't grab stuff from the current buffer. And we could solve that by just saving the buffer in a project-specific variable. >> It does mean that project-unaware commands can't both operate in a >> different project and on the current buffer. Is there ever a place we >> actually want that though? > > From where I'm standing, we've already passed into the "does anybody > need this" territory. But people can write their own commands, or > install packages, and apparently sometimes combine them with projects > with advanced invocations. > > I'm happy to try optimizing different workflows, but it's probably at > least equally important to make sure the new additions are consistent > and predictable (meaning, it's easy to tell in advance whether > something is going to work or not), and hopefully somewhat > discoverable too. I agree of course. > The latter probably means that we cannot make just any global key > sequence work in the *Project List* buffer (or e.g. have 'M-x gnus' > start in a different directory depending on which line point current > is on). But we might have a binding for a prefix command which would > make sure the next one is run within the project room as its > default-directory. Binding 'project-any-command' (or a variation of > it) to 'o' seems natural in there too. Do you disagree? Hm, I think changing default-directory in project-list based on point is very discoverable. Let me explain why: When you hit "g" in the project-list buffer, I expect that it would operate on the project at point. That seems obvious and unobjectionable. So users will be used to being able to operate on different projects based on the value of point. And it is (in my experience) a straightforward extension from that to running arbitrary commands on different projects based on the value of point. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 15:39:20 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 19:39:20 +0000 Received: from localhost ([127.0.0.1]:37827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtYrM-0002GP-AP for submit@debbugs.gnu.org; Thu, 19 Oct 2023 15:39:20 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:47319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtYrK-0002Fs-9Q for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 15:39:07 -0400 From: Spencer Baugh To: Juri Linkov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86o7guv6ax.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 19 Oct 2023 21:03:02 +0300") References: <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> <86o7guv6ax.fsf@mail.linkov.net> Date: Thu, 19 Oct 2023 15:38:33 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem >>> caused by a similar approach in the implementation. OTOH, >> >> I was thinking we'd solve both this specific problem and the general >> case by just saving the current buffer in a project-old-buffer variable >> so that project-aware commands could go back and grab stuff from it. >> >> It does mean that project-unaware commands can't both operate in a >> different project and on the current buffer. Is there ever a place we >> actually want that though? > > For example, 'C-x p p M-x rgrep RET' would need to read a word under point > as the default value. Argh. Aaargh. OK, I guess that is definitely a test case that we want to work. So nevermind about the idea of having project-switch-project just switch to a project-status buffer. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 18:39:55 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 22:39:55 +0000 Received: from localhost ([127.0.0.1]:38066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtbgI-0007Qo-MH for submit@debbugs.gnu.org; Thu, 19 Oct 2023 18:39:55 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:57057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtbgD-0007QY-W7 for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 18:39:53 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id CFA185C036E; Thu, 19 Oct 2023 18:39:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 19 Oct 2023 18:39:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697755157; x=1697841557; bh=ixNVesNO13VlRSyr2WuSL4VjNSvdlcWZF1T SazJPIpw=; b=ueJCrUjZ3AKdMXt6+dchEXbAd/1iK3fNY76WOistQpQ71cPfM3G lWElOxDQwEFmpTpHso0HhEbPeDmj+OBgw2KiHRwCxJESoRMS8UZChHfH9aHBW52R /EzzhrSYXX/iXyqky30oL4MIBLW4f/dfqKR43FGk2Mzy/hZ5D1bi5x37toxoxKt/ KMT24qzaQy6x19JjF39MDGrXh0fB0UQ3+KI83rEZBzy9IC53kw9otgZHg1SIdlig LYrDzP6pOJDLaYmMHTS3VuZofHjfy4E72/fAe0t+yLaV2CkEDmazZf8WphA6fGaR sWBUp/ZxvrZJFSbuPt4jY0BT+3/Pqi9zGag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697755157; x=1697841557; bh=ixNVesNO13VlRSyr2WuSL4VjNSvdlcWZF1T SazJPIpw=; b=RksaMHgLL/SrRxcavqE2ClV0lKTEazvYIezmMYtDHUWwZs6IgER Q2czigF+JxeWzAY2P5gUdmQjpbTB69zlyqiDQUKU8DXHWl8UwKGKTuAgvO2/iQah elVxaPPMSxpX91AbdfnnL73BvPeGfQcr+MKvO9IgVIPwkWIz6Y+42LglOjDj0NkS 79co3gIB3caWtnDZiYFzY0kVXviJMiinQsnqYICE4X5gEMm5xXLvOEgDA14LHt1P 7/LGCjzcQEvQ6gef8fQpYqHqNsm0r/GukJeG26trjkTYA1wMbZYYat1x9L/NRex4 N5avOSgWijkNEgYqL3DdoMuYm3pglVbFuSQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeejgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 18:39:16 -0400 (EDT) Message-ID: <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> Date: Fri, 20 Oct 2023 01:39:14 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86ttqmv7c6.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 19/10/2023 20:56, Juri Linkov wrote: >> C-x p p C-x d - the key sequence is 'C-x p p o C-x d' > BTW, with (setq project-switch-use-entire-map t) > I accidentally typed 'C-x p p C-x d' that should ignore 'C-x' > and read a directory with 'd', it fails with: > > (wrong-type-argument commandp 1) Thanks, see the commit e1708697122 I just pushed. It should fix this, print the available keys from the whole keymap (when enabled), and echo mistakes as well. In a fairly bare way, but this should make the feature what I'd call usable. I also tried the variant with printing all the command names beside the keys, but even with ^project- stripped, they didn't fit on one line. 'C-x d' will result in a warning echo, though, instead of just using 'd'. If you really prefer that, try experimenting with the below addition, but I'm wary of edge cases, since we want to keep supporting sub-maps like in bug#47620. It also might feel a little too "magical" now that there are more details printed (it also doesn't handle extremes like 'C-c C-x C-c' still). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0d6539113cc..90b61609c45 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -2003,7 +2003,9 @@ project--switch-project-command (help-key-description choice nil))))) (setq choice (read-key-sequence (concat "Choose: " prompt))) (when (setq command (lookup-key commands-map choice)) - (when (numberp command) (setq command nil)) + (when (numberp command) + (setq command + (lookup-key commands-map (substring choice command)))) (unless (or project-switch-use-entire-map (assq command commands-menu)) ;; TODO: Add some hint to the prompt, like "key not From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 19 19:26:10 2023 Received: (at 63648) by debbugs.gnu.org; 19 Oct 2023 23:26:10 +0000 Received: from localhost ([127.0.0.1]:38176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtcP3-0000Y4-QD for submit@debbugs.gnu.org; Thu, 19 Oct 2023 19:26:10 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:41363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtcP1-0000XM-Bf for 63648@debbugs.gnu.org; Thu, 19 Oct 2023 19:26:08 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C8AD25C008D; Thu, 19 Oct 2023 19:25:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Oct 2023 19:25:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697757934; x=1697844334; bh=jaNQSRGq0q53atKBjQu69E0Yi0flbQOeCZX ZOBr+N2k=; b=I2t1SKfliR+4aOsAk8vD9Ic5JlVJVKgWjlX6rCnBrkPEZnE37pV LyfQEzVSKakRWrs3yWDSA6sWncdqvaURwOl6Zi1nW1VdHvD/6C8suWK0gEI8i673 xfuXW08qfOlgGxOwUYdgAXNd9HbKsEaKCdX22IJ5HwJgz6vAAH86Eax8psyuRDpq OmpC40L8tABcNjPbFAWAiLrbnB6jL7dT3ldiEt6fyWcbeToB1a7Z3dtzERP+TJ/j Z9am2NeC69AwikzDeFc6woxAwW0MCsQh8b27yfMvHCMskLsSPg2OH4FNo9QXpS7B IVBMvXhzcECvYKESKfqfA1ZTygXL2Qf0oww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697757934; x=1697844334; bh=jaNQSRGq0q53atKBjQu69E0Yi0flbQOeCZX ZOBr+N2k=; b=AUN978oDNPumUazeXjql7+Rmtnm6kV3an7Ea98JQIr54RRGP0St +pAYPGHv379Yr/1ON6ursaX7QbcUDV5mcYQd85MWa5DeUCG3Y4gdKNdzmWihOSig URpI9SPyLaC+yIl0kLg5Jya0mnXKl+m0mJG0lJW7lWDUB6U61MPFhFLn5O6LzGiW UM/aI8hfwe0Zpr50fckjdH+nmJvqQ/kK/EWH5fhjFIH8rSPHeHI477pUI+LMqG3B XrA9rDgn1JCe2E7TixpWREOGgVQ0NMDmDXr7vzlRBsA5jo5T40k1Y4+CZPYZzq9j mNw3q2JoFe92dqbC4D5t2aZ2UfN3YFFVaBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeejgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpefhuedtkeevgeegteetkeefjeffgeduudduhfeuveelfedtffffgeegiedvvdej leenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 19:25:33 -0400 (EDT) Message-ID: <78eb0b42-9603-b668-90e2-114e38e6f9ff@gutov.dev> Date: Fri, 20 Oct 2023 02:25:31 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Spencer Baugh References: <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> <6fb5f40a-48cf-c5fc-d609-df90790f66e6@gutov.dev> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 19/10/2023 22:30, Spencer Baugh wrote: >>>> I'm totally on board with adding such command, except I'm not sure if >>>> we will give away the 'C-x p p' binding to it. But as far as calling >>>> the "next" command, both project-vc-dir and project-dired currently >>>> satisfy your condition, right? >>> Yes. Although project-vc-dir and project-dired don't provide a nice >>> solution for how to implement the C-x p p single key bindings. With the >>> project-status buffer, if it had the single-key bindings, then we would >>> just say "C-x p p resolves keybindings as they would be resolved in >>> project-status". >> >> Hmm... if the goal is to just have 'C-x p p' resolve the short key >> bindings, then (setq project-switch-use-entire-map t) gets you all the >> way there, doesn't it? > > To be clear, this was just a comment about how project-status would help > us on the implementation side of single-key bindings. I still >> So the question is, do you need to be able to use non-project commands >> (like in the title of this report), and how often? >> >> If it's not very often (which would reflect my experience), then >> pressing 'o' once in a while should be a small price to pay. > > I personally use non-project commands quite frequently through C-x p p D > > Some things I run sometimes: > - find-file (if I just want to find a file from the root rather than > with project-find-file) > - vc-pull > - vc-root-diff > - various internal commands to access code review or check the build > status I guess 'find-file' could also be a command that could use the buffer text under point. Apparently, not in your usage, but in someone else's. >> BTW, when project-switch-use-entire-map is non-nil, we should probably >> display something informative to the user (e.g. some abbreviated list >> of all the bindings in project-prefix-map?), so that the users don't >> mistake the the meaning of the option, and see at least some of the >> keys they can press at that point, instead of the incorrect command >> menu. > > True. > > Automatically generating this would be kind of like which-key. I pushed a version of this to master, but one that looks more like read-multiple-choice. Reimplementing which-key would be too much, and unfortunately I don't see a way to integrate it when available either. >> Speaking of 'list-projects', though, I wonder what we could display >> for a project by default, aside from its root dir (abbreviated) and >> the number of open buffers. > > Some possibilities: > - The project type (or the vc type if it's a vc project?) > - Maybe some vc information; whether the working tree is dirty? > - The current number of warnings/errors in the *compilation* buffer for > that project if any; I implemented that for bug#63896 and it's > pretty easy These first two sound like they call for addition of more generic functions that describe a project. Though it seems like they'd be hard to explain in terms of other project backends. Maybe we could instead say "VCS responsible for project root" and "VCS short status". Anyway, both good ideas. Regarding warnings/compilations, like I said in the other bug, it does sound nice when the integration works, but the info will be empty for a lot of users. >>>>> Although, maybe we can get the best of both worlds by having C-x p p >>>>> just temporarily switch buffer? It can do (with-current-buffer >>>>> (project-status) ...) plus resolving keybindings as if they were typed >>>>> in the project-status buffer. That seems pretty elegant to me and >>>>> resolves a lot of complexities without giving up anything. >>>> >>>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63829 was a problem >>>> caused by a similar approach in the implementation. OTOH, >>> I was thinking we'd solve both this specific problem and the general >>> case by just saving the current buffer in a project-old-buffer variable >>> so that project-aware commands could go back and grab stuff from it. >> >> I suppose they could, but then we support using them all (?) already >> with project-switch-use-entire-map. When one has custom commands, the >> user would probably add them to project-prefix-map too. > > Er, I'm not sure I understand. Let me clarify: The "specific problem > and the general case" that I was referring to is the problem with some > implementations of project-switch-project where the buffer changes when > we use project-switch-project, meaning we can't grab stuff from the > current buffer. And we could solve that by just saving the buffer in a > project-specific variable. Which only project-aware commands would be able to take advantage of. >> The latter probably means that we cannot make just any global key >> sequence work in the *Project List* buffer (or e.g. have 'M-x gnus' >> start in a different directory depending on which line point current >> is on). But we might have a binding for a prefix command which would >> make sure the next one is run within the project room as its >> default-directory. Binding 'project-any-command' (or a variation of >> it) to 'o' seems natural in there too. Do you disagree? > > Hm, I think changing default-directory in project-list based on point is > very discoverable. Let me explain why: When you hit "g" in the > project-list buffer, I expect that it would operate on the project at > point. That seems obvious and unobjectionable. So users will be used > to being able to operate on different projects based on the value of > point. And it is (in my experience) a straightforward extension from > that to running arbitrary commands on different projects based on the > value of point. 'g' is probably fine. 'f' and the rest of such keys too. Though 'n' and, more importantly, 'p' will likely have different expectations. What if the user presses 'C-x o' while this buffer is current (and point is on one of the projects)? Or 'C-x C-s'? Would we dispatch every key sequence through our custom prefix command while this buffer is current? I can't think of an particularly damaging example right now, but the concept feels moderately dangerous. Buuut... simply changing default-directory buffer-locally in post-command hook based on what is under point might be fine. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 02:56:08 2023 Received: (at 63648) by debbugs.gnu.org; 20 Oct 2023 06:56:08 +0000 Received: from localhost ([127.0.0.1]:38506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtjQW-0003eh-Ax for submit@debbugs.gnu.org; Fri, 20 Oct 2023 02:56:08 -0400 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:51473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtjQR-0003e6-4u for 63648@debbugs.gnu.org; Fri, 20 Oct 2023 02:56:07 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2A117FF813; Fri, 20 Oct 2023 06:55:27 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> (Dmitry Gutov's message of "Fri, 20 Oct 2023 01:39:14 +0300") Organization: LINKOV.NET References: <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> Date: Fri, 20 Oct 2023 09:44:37 +0300 Message-ID: <865y31onju.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 'C-x d' will result in a warning echo, though, instead of just using > 'd'. If you really prefer that, try experimenting with the below addition, > but I'm wary of edge cases, since we want to keep supporting sub-maps like > in bug#47620. It also might feel a little too "magical" now that there are > more details printed (it also doesn't handle extremes like 'C-c C-x C-c' > still). > > @@ -2003,7 +2003,9 @@ project--switch-project-command > (help-key-description choice > nil))))) > (setq choice (read-key-sequence (concat "Choose: " prompt))) > (when (setq command (lookup-key commands-map choice)) > - (when (numberp command) (setq command nil)) > + (when (numberp command) > + (setq command > + (lookup-key commands-map (substring choice command)))) Wow, it works nicely for 'C-x p p C-x d'. But strange it fails for 'C-x p p C-x v d' with the same error: (wrong-type-argument commandp 1) From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 15:25:50 2023 Received: (at 63648) by debbugs.gnu.org; 20 Oct 2023 19:25:50 +0000 Received: from localhost ([127.0.0.1]:41469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtv81-0002ce-Gu for submit@debbugs.gnu.org; Fri, 20 Oct 2023 15:25:49 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:39681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtv7w-0002cF-Hn for 63648@debbugs.gnu.org; Fri, 20 Oct 2023 15:25:48 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 3D9BE3200A1E; Fri, 20 Oct 2023 15:25:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 20 Oct 2023 15:25:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697829909; x=1697916309; bh=84MIfI/7XJdI8q7m7z0DoFmocx7BmtOhHV3 qyns5Q3Y=; b=nesOCGsjq5Rghps1xNtkPL6ga9kqYAqjdVuZJMCrv4UHh8fg4lL tpjQn4THJBuSDm6c87sMMHAYz1zBGc4Z25RgfVFonrCkX9mjfyejtwCDGuWgCWRw tm5NdKga5M8n0MD9tBjMv11t1XUQ0vNigUIxLV2HxymL5PLWqJ0Tg6tEd6J+PjT0 HktrriOPxJ88sG/CG53cXWwxdXmC51Gh8nvk6ee+ZXZucI6m+Oeyjej+7LrfMnuy PCLiK/6KTnXRMjZo2AcWldyxrxlq3Ac1lRyCuFXlm3imdHuuhZXms0Z7VDZBOLwe MBEakEj6UNb4A/4AzmhqtllmuTGIj4coDKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697829909; x=1697916309; bh=84MIfI/7XJdI8q7m7z0DoFmocx7BmtOhHV3 qyns5Q3Y=; b=vRfFRIXG46M6y3G39wf6nDrpO/i7bG1Qx/Hew+RF0xiN+Hwp9+8 X5F0pRU84D8b7dTieO7EcSVH/dXWPxj20Pe3I3X4mcTKh50bjM/9ouze+0cT4CpQ F4pneXe9r06S3e9PxfdvarI55gcy7iW36YOmA0IaDnCOEL9d5uRijevNvdGid9f6 PwZOJQavJp1/N8rsZuyGpdgLt9XSgfi8mSDnsZu5Zl9IU98HOKVRqPPAQraKoudV dqGmqqAois2dUvlYtHS9zQUMufPr7725TTQzwZCvmWX1zADoFfDVUpVgdwtWHLoz GO4AV2QvErTRUtn5kXnAUfD4eV6tzw3wj0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeekgddufeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Oct 2023 15:25:07 -0400 (EDT) Message-ID: <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> Date: Fri, 20 Oct 2023 22:25:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <865y31onju.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 20/10/2023 09:44, Juri Linkov wrote: >> 'C-x d' will result in a warning echo, though, instead of just using >> 'd'. If you really prefer that, try experimenting with the below addition, >> but I'm wary of edge cases, since we want to keep supporting sub-maps like >> in bug#47620. It also might feel a little too "magical" now that there are >> more details printed (it also doesn't handle extremes like 'C-c C-x C-c' >> still). >> >> @@ -2003,7 +2003,9 @@ project--switch-project-command >> (help-key-description choice >> nil))))) >> (setq choice (read-key-sequence (concat "Choose: " prompt))) >> (when (setq command (lookup-key commands-map choice)) >> - (when (numberp command) (setq command nil)) >> + (when (numberp command) >> + (setq command >> + (lookup-key commands-map (substring choice command)))) > Wow, it works nicely for 'C-x p p C-x d'. > But strange it fails for 'C-x p p C-x v d' > with the same error: > > (wrong-type-argument commandp 1) That's because (lookup-key ... "vd") also returns 1. I haven't been able to find a solution that works like we would expect. The most trivial would be to loop cutting off invalid prefixes, but then we end up with 'd', not 'v'. That's probably not what you want. Ideally, 'read-key-sequence' would stop at the user pressing 'v' and return "^Xv", then the rest would work out okay. But I haven't managed to have it do that, even when using overriding-terminal-local-map and temporarily altering the global map. My experimental patch is below, you can try tweaking it. And overall I'm not sure it's a constructive approach because you might have been going for 'C-x v d' (where the 'v' translation is correct), but you might have been going for 'C-x v D' or 'C-x v v' instead, very different commands. It might be better to report unknown key sequence and let the user make an explicit choice, like it works now. Depends on whether you notice the key sequence echoing while doing that input. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fda1081eb62..09d7e1025ca 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1983,7 +1983,6 @@ project--switch-project-command project-switch-commands)) (commands-map (let ((temp-map (make-sparse-keymap))) - (set-keymap-parent temp-map project-prefix-map) (dolist (row commands-menu temp-map) (when-let ((cmd (nth 0 row)) (keychar (nth 2 row))) @@ -1991,7 +1990,15 @@ project--switch-project-command command choice) (while (not command) - (let* ((overriding-local-map commands-map) + (let* ((map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map (if project-switch-use-entire-map + project-prefix-map + commands-map)) + (define-key map "\e\e\e" 'keyboard-escape-quit) + (define-key map "\C-g" 'keyboard-quit) + map)) + (overriding-terminal-local-map map) (prompt (if project-switch-use-entire-map (project--keymap-prompt) (project--menu-prompt)))) @@ -2001,16 +2008,20 @@ project--switch-project-command (propertize "Unrecognized input" 'face 'warning) (help-key-description choice nil))))) - (setq choice (read-key-sequence (concat "Choose: " prompt))) - (when (setq command (lookup-key commands-map choice)) - (when (numberp command) (setq command nil)) + (unwind-protect + (progn + (use-global-map map) + (setq choice (read-key-sequence (concat "Choose: " prompt) nil t nil t))) + (use-global-map global-map)) + (when (setq command (lookup-key map choice)) + (while (numberp command) + (setq choice (substring choice command)) + (setq command (lookup-key map choice))) + (when (memq command '(keyboard-quit keyboard-escape-quit)) + (call-interactively command)) (unless (or project-switch-use-entire-map (assq command commands-menu)) - (setq command nil))) - (let ((global-command (lookup-key (current-global-map) choice))) - (when (memq global-command - '(keyboard-quit keyboard-escape-quit)) - (call-interactively global-command))))) + (setq command nil))))) (message nil) command)) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 21 09:15:23 2023 Received: (at 63648) by debbugs.gnu.org; 21 Oct 2023 13:15:23 +0000 Received: from localhost ([127.0.0.1]:42554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quBp5-0008IE-J4 for submit@debbugs.gnu.org; Sat, 21 Oct 2023 09:15:23 -0400 Received: from s.wfbtzhsw.outbound-mail.sendgrid.net ([159.183.224.105]:36586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quBp3-0008Hv-A9 for 63648@debbugs.gnu.org; Sat, 21 Oct 2023 09:15:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=n69/7qn0aCDd/xb8AM2fLe5lQGT2VqZiLI7JT86aQ+s=; b=dxpyJoP3NvLzrhtxoz9ftfRKsAVEiIv3CJbvNgf9AjyWpiAvRrMV4xKq/sNKJ8O34IAQ Oc1F4ojk8pNTm9rH4l9cSOziYQTUdJv+gNkJ1+yVuIce/mTmID0cAK1fpRkFX55sTCs8rd /jL3GQkA5JFSUZ2US4bD8HJWKtOfFBCX5nVMfmcox7Yb+IMAKvVt2OWeGKTFShyA7rnc6q Q74thIMYz9OP1R0qnffzDN1DAGeXuJ5+/K5kxMlNF5QYatyCGW1rDx412wCecKX2Ozah0g sy+I07fvCs+FMdRwPsFD22uheourAtOumrXYb7GlvUaDWs+pOT/JYPYJJA/I7jjg== Received: by filterdrecv-655bd866f5-n6pxp with SMTP id filterdrecv-655bd866f5-n6pxp-1-6533CEC7-6 2023-10-21 13:14:47.08779425 +0000 UTC m=+326030.454923043 Received: from earth.catern.com (unknown) by geopod-ismtpd-1 (SG) with ESMTP id NTCMI9foTrGIsdppO9Wv1A Sat, 21 Oct 2023 13:14:47.068 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=linkov.net Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id B12D363AE0; Sat, 21 Oct 2023 09:14:46 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <86y1gynr2u.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 22 Sep 2023 18:52:09 +0300") References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> Date: Sat, 21 Oct 2023 13:14:47 +0000 (UTC) Message-ID: <87fs24t8vt.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbIak4j9QWMMOsraAqwOId?= =?us-ascii?Q?uZOxsij=2FcRvgiqQDbTM+tZSGodNszvbNNnnaIFT?= =?us-ascii?Q?sIp0fNdQ+64sQYJyS+NjNoj2XE05amUY+MrQ=2F0b?= =?us-ascii?Q?QeG9VN5TV=2FzllVGdNJMIg8UZMRpoySPTiXA=2FAh+?= =?us-ascii?Q?0xmvixRlhmX3VJMyiJWIst861hMzV5zNjxQ=3D=3D?= To: Juri Linkov X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 63648 Cc: Dmitry Gutov , 63648@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) Juri Linkov writes: >>> Probably. Would you like to propose one? So that I have something to >>> compare to, and have something specific to put to the vote as well. >> >> Ok, something like this: > > Here is a more tested patch. It supports these cases: > > (setq project-switch-use-entire-map t) > > C-x p p C-b - should not include current buffer in the list of another project (bug#58784) > C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) > C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) > C-x p p C-x d - should visit another project's root (bug#63648) > > The same with frames: > > C-x 5 p p C-b > C-x 5 p p f M-n > C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) > C-x 5 p p C-x d I've only been testing it for a few days, but this patch seems perfect to me. It does everything I want. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 21 09:27:44 2023 Received: (at 63648) by debbugs.gnu.org; 21 Oct 2023 13:27:45 +0000 Received: from localhost ([127.0.0.1]:42573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quC12-0000JM-Hr for submit@debbugs.gnu.org; Sat, 21 Oct 2023 09:27:44 -0400 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]:51142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quC0z-0000J5-SF for 63648@debbugs.gnu.org; Sat, 21 Oct 2023 09:27:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=rSj9DVbTEwEVmCo+5KLYDi/gJu2/7tvWQK3wwi8AerE=; b=UC6Z0iFnfuzXW8HzbNnYw1rFLYulJLcqdhshT5s9VnjLacDxNyXMJpcipoo4bULBfe2g Qr+u1jcuOcwPcuPPRrQs/CiiUF4KeBv+ekiIvN47G1juBxAG4w7o9XB2A79mPk3amAe1Nq B4wj99Bs8IHXS83b12OQ1FI1crtUGgQVS/gA+6gYgdrl7gCkvFUS8OZtAmYGZmF8cq41pr YxRxtJeCsgK22nlVJcMr27Q+yec5+ftLlaTe+Kh4bp5VhLguISs/E0E5MFSdvExkudgEFB Llxs4CFVZLR+CtPhrFljz21plBtLIFqn+KPiLSuV5zjZoBq6IPlRSwEx8/wDvn3g== Received: by filterdrecv-656b5b4c75-nx6ft with SMTP id filterdrecv-656b5b4c75-nx6ft-1-6533D1AB-25 2023-10-21 13:27:07.886301942 +0000 UTC m=+326839.375197622 Received: from earth.catern.com (unknown) by geopod-ismtpd-4 (SG) with ESMTP id aGXu0JG2StCZ4ewz_0kMNg Sat, 21 Oct 2023 13:27:07.806 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gutov.dev Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 6D5386360E; Sat, 21 Oct 2023 09:27:07 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> (Dmitry Gutov's message of "Thu, 19 Oct 2023 03:42:24 +0300") References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> Date: Sat, 21 Oct 2023 13:27:07 +0000 (UTC) Message-ID: <87bkcst8b8.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbIM7oQE7C=2FAE7YQcqFkxG?= =?us-ascii?Q?7YT86uwHYLFmFM5WMrQqv0AJGWIk677rYSKvGpF?= =?us-ascii?Q?PbXdKNxQh7fDNKgkpxbqdpA7058PkYV+MTsTafw?= =?us-ascii?Q?eaOFfgIWcy2JvJjLEb7mDQPl1D5Ykl+mboMWcQE?= =?us-ascii?Q?14reVDwCbLThJw6FbWKsbh7yrvRyq6kTmzA=3D=3D?= To: Dmitry Gutov X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Dmitry Gutov writes: > Hi Juri, > > On 22/09/2023 18:52, Juri Linkov wrote: >>>> Probably. Would you like to propose one? So that I have something to >>>> compare to, and have somet [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [149.72.154.232 listed in wl.mailspike.net] 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [149.72.154.232 listed in bl.score.senderscore.com] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Dmitry Gutov writes: > Hi Juri, > > On 22/09/2023 18:52, Juri Linkov wrote: >>>> Probably. Would you like to propose one? So that I have something to >>>> compare to, and have something specific to put to the vote as well. >>> >>> Ok, something like this: >> Here is a more tested patch. It supports these cases: >> (setq project-switch-use-entire-map t) >> C-x p p C-b - should not include current buffer in the list of >> another project (bug#58784) >> C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) >> C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) >> C-x p p C-x d - should visit another project's root (bug#63648) >> The same with frames: >> C-x 5 p p C-b >> C-x 5 p p f M-n >> C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) >> C-x 5 p p C-x d > > Thank you. Especially for the list. > > But I think we still haven't reached a decision whether the "loop > until correct key is pressed" behavior is useful. > > I tried to think how to fit the above requirements into the existing > model, and it seems to require a new command, and an additional key > being pressed sometimes, for explicitness. > > The attached patch also includes your fix for bug#65558, which seems > orthogonal to our dilemma, and could probably be installed > separately. It could be dry-ed up a little, though. > > Anyway, with the attached counter-proposal, the list looks like this: > > C-x p p C-b - works when project-switch-use-entire-map=t > C-x p p f M-n - always works > C-u C-x p p f - same > C-x p p C-x d - the key sequence is 'C-x p p o C-x d' > > With frames: > > C-x 5 p p C-b - works when project-switch-use-entire-map=t > C-x 5 p p f M-n - always works > C-u C-x 5 p p f emoji TAB - same (thanks to your fix, included) > C-x 5 p p C-x d - the key sequence is 'C-x 5 C-x p p o C-x d' > > The user could add project-list-buffers (or project-switch-to-buffer) > to project-switch-commands, though, and then > project-switch-use-entire-map won't be needed. Either way's fine. > > To sum up, that does require pressing an extra key to use commands > outside of project-prefix-map, but OTOH that key is shown right in the > commands menu. And one doesn't have to (setq > project-switch-use-entire-map t) to use it, though that doesn't hurt > either. Two thoughts: 1. Maybe C-x p o should also exist, which runs the subsequent command in project-root. (Although I think it would be better if C-x p magically let you type any binding after C-x p, and the command would run in project-root, as I pondered much earlier in this thread. But that's a lot harder...) 2. Maybe C-x p p should have both `o` (on by default even without project-switch-use-entire-map) and the no-extra-key version (needs to be explicitly turned on, possibly by project-switch-use-entire-map) Although, I plan to turn the no-extra-key version on for all my users anyway. The one extra key is a real cost if you're doing this frequently. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 21 12:09:55 2023 Received: (at 63648) by debbugs.gnu.org; 21 Oct 2023 16:09:55 +0000 Received: from localhost ([127.0.0.1]:44936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quEXz-00034L-0J for submit@debbugs.gnu.org; Sat, 21 Oct 2023 12:09:55 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:37499) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quEXw-000347-Uv for 63648@debbugs.gnu.org; Sat, 21 Oct 2023 12:09:53 -0400 From: Spencer Baugh To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <78eb0b42-9603-b668-90e2-114e38e6f9ff@gutov.dev> (Dmitry Gutov's message of "Fri, 20 Oct 2023 02:25:31 +0300") References: <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> <6fb5f40a-48cf-c5fc-d609-df90790f66e6@gutov.dev> <78eb0b42-9603-b668-90e2-114e38e6f9ff@gutov.dev> Date: Sat, 21 Oct 2023 12:09:19 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 19/10/2023 22:30, Spencer Baugh wrote: >>>>> I'm totally on board with adding such command, except I'm not sure if >>>>> we will give away the 'C-x p p' binding to it. But as far as calling >>>>> the "next" command, both project-vc-dir and project-dired currently >>>>> satisfy your condition, right? >>>> Yes. Although project-vc-dir and project-dired don't provide a nice >>>> solution for how to implement the C-x p p single key bindings. With the >>>> project-status buffer, if it had the single-key bindings, then we would >>>> just say "C-x p p resolves keybindings as they would be resolved in >>>> project-status". >>> >>> Hmm... if the goal is to just have 'C-x p p' resolve the short key >>> bindings, then (setq project-switch-use-entire-map t) gets you all the >>> way there, doesn't it? >> To be clear, this was just a comment about how project-status would >> help >> us on the implementation side of single-key bindings. I still > > I don't remember how I was going to finish it :) Anyway, the point is moot now, since I'm persuaded that "C-x p p resolves keybindings as they would be resolved in project-status" doesn't work because of the buffer change. >>> BTW, when project-switch-use-entire-map is non-nil, we should probably >>> display something informative to the user (e.g. some abbreviated list >>> of all the bindings in project-prefix-map?), so that the users don't >>> mistake the the meaning of the option, and see at least some of the >>> keys they can press at that point, instead of the incorrect command >>> menu. >> True. >> Automatically generating this would be kind of like which-key. > > I pushed a version of this to master, but one that looks more like > read-multiple-choice. Reimplementing which-key would be too much, and > unfortunately I don't see a way to integrate it when available either. which-key is in GNU ELPA. So possibly it could be brought into core, if we're finding that we need it. Does that seem plausible? I could bring it up on emacs-devel, since I think which-key would be an excellent addition to core for other reasons too. >>> The latter probably means that we cannot make just any global key >>> sequence work in the *Project List* buffer (or e.g. have 'M-x gnus' >>> start in a different directory depending on which line point current >>> is on). But we might have a binding for a prefix command which would >>> make sure the next one is run within the project room as its >>> default-directory. Binding 'project-any-command' (or a variation of >>> it) to 'o' seems natural in there too. Do you disagree? >> Hm, I think changing default-directory in project-list based on >> point is >> very discoverable. Let me explain why: When you hit "g" in the >> project-list buffer, I expect that it would operate on the project at >> point. That seems obvious and unobjectionable. So users will be used >> to being able to operate on different projects based on the value of >> point. And it is (in my experience) a straightforward extension from >> that to running arbitrary commands on different projects based on the >> value of point. > > 'g' is probably fine. 'f' and the rest of such keys too. Though 'n' > and, more importantly, 'p' will likely have different expectations. Yes, I was thinking we'd have 'n' and 'p' do next/previous-line. 'n' is unused and 'p' is probably not necessary: you can just do C-s instead, or possibly (if we set it up) use imenu, M-g i. Possibly we should avoid using C-x p n, to reserve 'n' for this. (Or maybe C-x p n could be something that is also not necessary in the project-list buffer... maybe C-x p n could run project-list? Maybe it could be called project-navigate?) > What if the user presses 'C-x o' while this buffer is current (and > point is on one of the projects)? Or 'C-x C-s'? Would we dispatch > every key sequence through our custom prefix command while this buffer > is current? > > I can't think of an particularly damaging example right now, but the > concept feels moderately dangerous. Oh, certainly not! That does sound quite dangerous and complicated and I have no idea how it would work. > Buuut... simply changing default-directory buffer-locally in > post-command hook based on what is under point might be fine. Yes, that's what I had in mind. This is much simpler than other-project-prefix. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 21 14:42:13 2023 Received: (at 63648) by debbugs.gnu.org; 21 Oct 2023 18:42:13 +0000 Received: from localhost ([127.0.0.1]:45037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGvL-0007zC-Bg for submit@debbugs.gnu.org; Sat, 21 Oct 2023 14:42:12 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGvG-0007ye-4s for 63648@debbugs.gnu.org; Sat, 21 Oct 2023 14:42:09 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ED2BE5C0129; Sat, 21 Oct 2023 14:41:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 21 Oct 2023 14:41:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1697913692; x=1698000092; bh=vt 2TpBElRE/0VFI23YPNLOVViydyGQtHCLh7gGMZPk8=; b=sAETdov8xOBniNLThj 6fk4E7T/9SjgOEXNkyPwUE/vOlhwuht4Xzo+AuJBFlGNyQfN9yz+huMiijPPghlp AGYoMs24JpTgNX5M0u6q4an0oK9oUYJ23ISKKc72vgyd/82bnpDolwRzDrySfh27 ekd6nLrtskV0h3K0SwdK+M9alQo8FzRxUsVdXLZXNp9ufSGAlBEu1hDQ3FZSCzLe Iin/4TnY3tSu7RF3601GzJWIL9aMfXLOMvOUUCI8rWKL6N0wrupaqH0VpuKwhmS+ hGJjUnyXpv6XEmQp3yKcVp1c1H+L5G1ZlqCcGSrAtNpJyDPwuHIMscmBxDETRjlO /AEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1697913692; x=1698000092; bh=vt2TpBElRE/0V FI23YPNLOVViydyGQtHCLh7gGMZPk8=; b=qbOPAT4ZdpSyvpItAVnw5F6aGLDBq l+zE/JRicscXiBxYf+Gpg8PW8HX54tx4v1YQy4fM46k1nMFmDzlF+MicCdpBjkn9 Q+OozItYgF5bGq9O1Y87jFo6mCwHUFkh2pbSf1MC4IMS2MKlLGa4p8bKpuGNd8fX hwlSZJj3nbkGus4vI4f98Qs7RfZMcJstH2xMrTVheDaKM1pROpCDyxP4QMregpQG MYvkADZhl4AyvLsaWmToySGVv345gRYxqpHEbpFt1dLvgelBXGW/1hpxWRYHV2ws ypYqRbbjc642uqpguNUOQUu3xr4/0CtLbI0p+9nJzwUx+s5PTWexN6Vfg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkedtgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeehteekgfetieeujeeuvddtvdelteffleejteduvdefffejieehheeuteffveei jeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Oct 2023 14:41:30 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------FMFjdA4hZRIKy0ABIQ4BfA7W" Message-ID: <5405ef33-7754-1098-a1a2-98a8c8afe396@gutov.dev> Date: Sat, 21 Oct 2023 21:41:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: sbaugh@catern.com References: <86h6of66o3.fsf@mail.linkov.net> <86wmxb2qvh.fsf@mail.linkov.net> <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87bkcst8b8.fsf@catern.com> From: Dmitry Gutov In-Reply-To: <87bkcst8b8.fsf@catern.com> X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) This is a multi-part message in MIME format. --------------FMFjdA4hZRIKy0ABIQ4BfA7W Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21/10/2023 16:27, sbaugh@catern.com wrote: > Dmitry Gutov writes: >> Hi Juri, >> >> On 22/09/2023 18:52, Juri Linkov wrote: >>>>> Probably. Would you like to propose one? So that I have something to >>>>> compare to, and have something specific to put to the vote as well. >>>> >>>> Ok, something like this: >>> Here is a more tested patch. It supports these cases: >>> (setq project-switch-use-entire-map t) >>> C-x p p C-b - should not include current buffer in the list of >>> another project (bug#58784) >>> C-x p p f M-n - should fetch the right default file name (bug#58784, bug#63829) >>> C-u C-x p p f emoji TAB - should include ignored emoji-labels.el (bug#63648) >>> C-x p p C-x d - should visit another project's root (bug#63648) >>> The same with frames: >>> C-x 5 p p C-b >>> C-x 5 p p f M-n >>> C-u C-x 5 p p f emoji TAB - should not show completions in another frame (bug#65558) >>> C-x 5 p p C-x d >> >> Thank you. Especially for the list. >> >> But I think we still haven't reached a decision whether the "loop >> until correct key is pressed" behavior is useful. >> >> I tried to think how to fit the above requirements into the existing >> model, and it seems to require a new command, and an additional key >> being pressed sometimes, for explicitness. >> >> The attached patch also includes your fix for bug#65558, which seems >> orthogonal to our dilemma, and could probably be installed >> separately. It could be dry-ed up a little, though. >> >> Anyway, with the attached counter-proposal, the list looks like this: >> >> C-x p p C-b - works when project-switch-use-entire-map=t >> C-x p p f M-n - always works >> C-u C-x p p f - same >> C-x p p C-x d - the key sequence is 'C-x p p o C-x d' >> >> With frames: >> >> C-x 5 p p C-b - works when project-switch-use-entire-map=t >> C-x 5 p p f M-n - always works >> C-u C-x 5 p p f emoji TAB - same (thanks to your fix, included) >> C-x 5 p p C-x d - the key sequence is 'C-x 5 C-x p p o C-x d' >> >> The user could add project-list-buffers (or project-switch-to-buffer) >> to project-switch-commands, though, and then >> project-switch-use-entire-map won't be needed. Either way's fine. >> >> To sum up, that does require pressing an extra key to use commands >> outside of project-prefix-map, but OTOH that key is shown right in the >> commands menu. And one doesn't have to (setq >> project-switch-use-entire-map t) to use it, though that doesn't hurt >> either. > > Two thoughts: > > 1. Maybe C-x p o should also exist, which runs the subsequent command in > project-root. (Although I think it would be better if C-x p > magically let you type any binding after C-x p, and the command would > run in project-root, as I pondered much earlier in this thread. But > that's a lot harder...) Then the 'C-x p p' binding wouldn't be available?... Anyway, try the attached updated patch. > 2. Maybe C-x p p should have both `o` (on by default even without > project-switch-use-entire-map) and the no-extra-key version (needs to > be explicitly turned on, possibly by project-switch-use-entire-map) The patch plus (setq project-switch-commands 'project-any-command) should do that for you. > Although, I plan to turn the no-extra-key version on for all my users > anyway. The one extra key is a real cost if you're doing this > frequently. --------------FMFjdA4hZRIKy0ABIQ4BfA7W Content-Type: text/x-patch; charset=UTF-8; name="project-other-command-v2.diff" Content-Disposition: attachment; filename="project-other-command-v2.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IGZkYTEwODFlYjYyLi4yNTAwYWNkMzk2MSAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC04NDcsNiArODQ3LDcgQEAgcHJvamVjdC1wcmVmaXgtbWFwCiAgICAgKGRl ZmluZS1rZXkgbWFwICJHIiAncHJvamVjdC1vci1leHRlcm5hbC1maW5kLXJlZ2V4cCkKICAg ICAoZGVmaW5lLWtleSBtYXAgInIiICdwcm9qZWN0LXF1ZXJ5LXJlcGxhY2UtcmVnZXhwKQog ICAgIChkZWZpbmUta2V5IG1hcCAieCIgJ3Byb2plY3QtZXhlY3V0ZS1leHRlbmRlZC1jb21t YW5kKQorICAgIChkZWZpbmUta2V5IG1hcCAibyIgJ3Byb2plY3QtYW55LWNvbW1hbmQpCiAg ICAgKGRlZmluZS1rZXkgbWFwICJcQy1iIiAncHJvamVjdC1saXN0LWJ1ZmZlcnMpCiAgICAg bWFwKQogICAiS2V5bWFwIGZvciBwcm9qZWN0IGNvbW1hbmRzLiIpCkBAIC0xODEzLDYgKzE4 MTQsMzMgQEAgcHJvamVjdC1leGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQKICAgKGxldCAoKGRl ZmF1bHQtZGlyZWN0b3J5IChwcm9qZWN0LXJvb3QgKHByb2plY3QtY3VycmVudCB0KSkpKQog ICAgIChjYWxsLWludGVyYWN0aXZlbHkgIydleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQpKSkK IAorOzs7IyMjYXV0b2xvYWQKKyhkZWZ1biBwcm9qZWN0LWFueS1jb21tYW5kICgpCisgICJS dW4gdGhlIG5leHQgY29tbWFuZCBpbiB0aGUgY3VycmVudCBwcm9qZWN0LgorSWYgdGhlIGNv bW1hbmQgaXMgaW4gYHByb2plY3QtcHJlZml4LW1hcCcsIGl0IGdldHMgcGFzc2VkIHRoYXQK K2luZm8gd2l0aCBgcHJvamVjdC1jdXJyZW50LWRpcmVjdG9yeS1vdmVycmlkZScuICBPdGhl cndpc2UsCitgZGVmYXVsdC1kaXJlY3RvcnknIGlzIHRlbXBvcmFyaWx5IHNldCB0byB0aGUg Y3VycmVudCBwcm9qZWN0J3MKK3Jvb3QuIgorICAoaW50ZXJhY3RpdmUpCisgIChsZXQqICgo cHIgKHByb2plY3QtY3VycmVudCB0KSkKKyAgICAgICAgIChwcmVmaXgtY29tbWFuZC1lY2hv LWtleXN0cm9rZXMtZnVuY3Rpb25zCisgICAgICAgICAgKGNvbnMgKGxhbWJkYSAoKSAoZm9y bWF0ICJbZXhlY3V0ZSBpbiAlc10iIChwcm9qZWN0LXJvb3QgcHIpKSkKKyAgICAgICAgICAg ICAgICBwcmVmaXgtY29tbWFuZC1lY2hvLWtleXN0cm9rZXMtZnVuY3Rpb25zKSkKKyAgICAg ICAgIChjb21tYW5kIChrZXktYmluZGluZyAocmVhZC1rZXktc2VxdWVuY2UgIiIpIHQpKQor ICAgICAgICAgKHJvb3QgKHByb2plY3Qtcm9vdCBwcikpCisgICAgICAgICBmb3VuZCkKKyAg ICAod2hlbiBjb21tYW5kCisgICAgICA7OyBXZSBjb3VsZCBhbHNvIGNoZWNrIHRoZSBjb21t YW5kIG5hbWUgYWdhaW5zdCAiXFxgcHJvamVjdC0iLAorICAgICAgOzsgYW5kL29yIChnZXQg Y29tbWFuZCAncHJvamVjdC1jb21tYW5kKS4KKyAgICAgIChtYXAta2V5bWFwCisgICAgICAg KGxhbWJkYSAoX2V2dCBjbWQpIChpZiAoZXEgY21kIGNvbW1hbmQpIChzZXRxIGZvdW5kIHQp KSkKKyAgICAgICBwcm9qZWN0LXByZWZpeC1tYXApCisgICAgICAoaWYgZm91bmQKKyAgICAg ICAgICAobGV0ICgocHJvamVjdC1jdXJyZW50LWRpcmVjdG9yeS1vdmVycmlkZSByb290KSkK KyAgICAgICAgICAgIChjYWxsLWludGVyYWN0aXZlbHkgY29tbWFuZCkpCisgICAgICAgIChs ZXQgKChkZWZhdWx0LWRpcmVjdG9yeSByb290KSkKKyAgICAgICAgICAoY2FsbC1pbnRlcmFj dGl2ZWx5IGNvbW1hbmQpKSkpKSkKKwogKGRlZnVuIHByb2plY3QtcmVtZW1iZXItcHJvamVj dHMtdW5kZXIgKGRpciAmb3B0aW9uYWwgcmVjdXJzaXZlKQogICAiSW5kZXggYWxsIHByb2pl Y3RzIGJlbG93IGEgZGlyZWN0b3J5IERJUi4KIElmIFJFQ1VSU0lWRSBpcyBub24tbmlsLCBy ZWN1cnNlIGludG8gYWxsIHN1YmRpcmVjdG9yaWVzIHRvIGZpbmQKQEAgLTE4OTEsNyArMTkx OSw4IEBAIHByb2plY3Qtc3dpdGNoLWNvbW1hbmRzCiAgICAgKHByb2plY3QtZmluZC1yZWdl eHAgIkZpbmQgcmVnZXhwIikKICAgICAocHJvamVjdC1maW5kLWRpciAiRmluZCBkaXJlY3Rv cnkiKQogICAgIChwcm9qZWN0LXZjLWRpciAiVkMtRGlyIikKLSAgICAocHJvamVjdC1lc2hl bGwgIkVzaGVsbCIpKQorICAgIChwcm9qZWN0LWVzaGVsbCAiRXNoZWxsIikKKyAgICAocHJv amVjdC1hbnktY29tbWFuZCAiT3RoZXIiKSkKICAgIkFsaXN0IG1hcHBpbmcgY29tbWFuZHMg dG8gZGVzY3JpcHRpb25zLgogVXNlZCBieSBgcHJvamVjdC1zd2l0Y2gtcHJvamVjdCcgdG8g Y29uc3RydWN0IGEgZGlzcGF0Y2ggbWVudSBvZgogY29tbWFuZHMgYXZhaWxhYmxlIHVwb24g XCJzd2l0Y2hpbmdcIiB0byBhbm90aGVyIHByb2plY3QuCg== --------------FMFjdA4hZRIKy0ABIQ4BfA7W-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 21 14:43:52 2023 Received: (at 63648) by debbugs.gnu.org; 21 Oct 2023 18:43:52 +0000 Received: from localhost ([127.0.0.1]:45042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGwy-000828-4p for submit@debbugs.gnu.org; Sat, 21 Oct 2023 14:43:52 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:38831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGww-00081t-7J for 63648@debbugs.gnu.org; Sat, 21 Oct 2023 14:43:50 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 257B65C020D; Sat, 21 Oct 2023 14:43:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 21 Oct 2023 14:43:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697913797; x=1698000197; bh=vH764ndV5OaantIeaP/mndV+xVP2n5JHLNM jCcxSnmI=; b=rfYvAfTGe+kWlbiF9Xc8nApcWAhytBwC0/9HY3cJ1NqSuyh5QBP nlgoD+dN2n0apolGUwHrVMUbYdlrRVZYoBFGueD5q1Du9I55YlfoiwhS7y0eDJ1O CX8/vBpiBPggTTyOAFcvgCOapprhf241oxVkZ0KuutH767N8EXYvSowKfNMW1EpC 55H730F/zmVqlbN4Iz94F9o6ZERsdAx7oaOI3PIppnYVLkWAhOAnRUlFiLJsdt3T Jrkjis1HPOFooK7nzizjT+iCbSPdErOI8BMdBevGj0awcON7LIJVCFv9XwawdQQ3 rk8dTDXq+kUsh2o5CHizvB6qkRVxe04VIHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697913797; x=1698000197; bh=vH764ndV5OaantIeaP/mndV+xVP2n5JHLNM jCcxSnmI=; b=I3g5ucUL+3swBfMSYbMFkqqokHanjV50dBoYfYxChKhRCkhq/wq E3uawk3lCIr6Hc8wnHWZdaF1w2a9AovcJVsNGcw2BG7K9uNWoTc17kirnThvNnJj 1o+i8E9rRwcugqe4ORkvUk8YXXTMas4RF3EoD2PkOyb82TuVljRqn71dCSFOs7dm FnpaBUkbJVkp58FCbgzghgK50p+lsQ1sZMirHeqQBIoprKmJ2T9uoLSnWm/uuY4w 8cGEAub9RAMhpwf4zeqjL6GTjrbH/1oyf8x0mzD8YoTHkqeypmGR/yxHhOdlLrdZ RRbpwUCrR7TBoeo++YNXLy29I1lQOtoXyDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkedtgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Oct 2023 14:43:15 -0400 (EDT) Message-ID: <1fe0a2b1-ad92-cac0-42b3-9922f04ca333@gutov.dev> Date: Sat, 21 Oct 2023 21:43:14 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Spencer Baugh References: <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <87r0lqu7ho.fsf@catern.com> <6149d7a4-f47e-2ac4-91cf-fe144d1a4c63@gutov.dev> <6fb5f40a-48cf-c5fc-d609-df90790f66e6@gutov.dev> <78eb0b42-9603-b668-90e2-114e38e6f9ff@gutov.dev> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: sbaugh@catern.com, 63648@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 21/10/2023 19:09, Spencer Baugh wrote: >>>> BTW, when project-switch-use-entire-map is non-nil, we should probably >>>> display something informative to the user (e.g. some abbreviated list >>>> of all the bindings in project-prefix-map?), so that the users don't >>>> mistake the the meaning of the option, and see at least some of the >>>> keys they can press at that point, instead of the incorrect command >>>> menu. >>> True. >>> Automatically generating this would be kind of like which-key. >> >> I pushed a version of this to master, but one that looks more like >> read-multiple-choice. Reimplementing which-key would be too much, and >> unfortunately I don't see a way to integrate it when available either. > > which-key is in GNU ELPA. So possibly it could be brought into core, if > we're finding that we need it. Does that seem plausible? I could bring > it up on emacs-devel, since I think which-key would be an excellent > addition to core for other reasons too. Even if it were here, I'm not sure what the integration would look like, code-wise. >>>> The latter probably means that we cannot make just any global key >>>> sequence work in the *Project List* buffer (or e.g. have 'M-x gnus' >>>> start in a different directory depending on which line point current >>>> is on). But we might have a binding for a prefix command which would >>>> make sure the next one is run within the project room as its >>>> default-directory. Binding 'project-any-command' (or a variation of >>>> it) to 'o' seems natural in there too. Do you disagree? >>> Hm, I think changing default-directory in project-list based on >>> point is >>> very discoverable. Let me explain why: When you hit "g" in the >>> project-list buffer, I expect that it would operate on the project at >>> point. That seems obvious and unobjectionable. So users will be used >>> to being able to operate on different projects based on the value of >>> point. And it is (in my experience) a straightforward extension from >>> that to running arbitrary commands on different projects based on the >>> value of point. >> >> 'g' is probably fine. 'f' and the rest of such keys too. Though 'n' >> and, more importantly, 'p' will likely have different expectations. > > Yes, I was thinking we'd have 'n' and 'p' do next/previous-line. 'n' is > unused and 'p' is probably not necessary: you can just do C-s instead, > or possibly (if we set it up) use imenu, M-g i. > > Possibly we should avoid using C-x p n, to reserve 'n' for this. (Or > maybe C-x p n could be something that is also not necessary in the > project-list buffer... maybe C-x p n could run project-list? Maybe it > could be called project-navigate?) The latter -- sure, probably. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 03:23:13 2023 Received: (at 63648) by debbugs.gnu.org; 23 Oct 2023 07:23:13 +0000 Received: from localhost ([127.0.0.1]:48937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qupHN-0000Pg-2N for submit@debbugs.gnu.org; Mon, 23 Oct 2023 03:23:13 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:41905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qupHK-0000PQ-MG for 63648@debbugs.gnu.org; Mon, 23 Oct 2023 03:23:11 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id BAA211C0003; Mon, 23 Oct 2023 07:22:33 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> (Dmitry Gutov's message of "Fri, 20 Oct 2023 22:25:06 +0300") Organization: LINKOV.NET References: <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> Date: Mon, 23 Oct 2023 09:58:00 +0300 Message-ID: <86msw9g5yb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Wow, it works nicely for 'C-x p p C-x d'. >> But strange it fails for 'C-x p p C-x v d' >> with the same error: >> (wrong-type-argument commandp 1) > > That's because (lookup-key ... "vd") also returns 1. > > I haven't been able to find a solution that works like we would expect. The > most trivial would be to loop cutting off invalid prefixes, but then we end > up with 'd', not 'v'. That's probably not what you want. > > Ideally, 'read-key-sequence' would stop at the user pressing 'v' and return > "^Xv", then the rest would work out okay. But I haven't managed to have it > do that, even when using overriding-terminal-local-map and temporarily > altering the global map. My experimental patch is below, you can try > tweaking it. Now can't type 'C-x p p C-x v d' completely because 'C-x p p C-x v' opens vc-dir after typing 'v'. > And overall I'm not sure it's a constructive approach because you might > have been going for 'C-x v d' (where the 'v' translation is correct), but > you might have been going for 'C-x v D' or 'C-x v v' instead, very > different commands. It might be better to report unknown key sequence and > let the user make an explicit choice, like it works now. Depends on whether > you notice the key sequence echoing while doing that input. Maybe adding a new option 'project-switch-use-global-map' would help? From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 13:24:51 2023 Received: (at 63648) by debbugs.gnu.org; 23 Oct 2023 17:24:51 +0000 Received: from localhost ([127.0.0.1]:51541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quyfa-0004T6-Tw for submit@debbugs.gnu.org; Mon, 23 Oct 2023 13:24:51 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quyfX-0004Ss-Pc for 63648@debbugs.gnu.org; Mon, 23 Oct 2023 13:24:48 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 129685C0341; Mon, 23 Oct 2023 13:24:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 23 Oct 2023 13:24:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1698081853; x=1698168253; bh=Xv 7Qe2zqmZKaHCN8teIMtMDrai3ly6urn4F9keS538M=; b=VDQmI8UWtVzGYuI2ys 83RoBVmSzjyF8TJU75CZhvtqftWGT8LGkma3wpjzBSx5/OalUupBiAWrqmI7HmDf AigBMfEuLKibC1dhKAx7Tj4r1+MZwXJb09dlXZQxXqsiXTkay8cFDpAOjNzJal63 ezLsQSaK2tuC8L7NPkKd7dKLzN7x3PL1IB2gxUDLwLDc1SUKJJbmtAYSDq0quF9Y Y2nl4DfE5OjHcenN7B0AFuhVc5m4DzyF11/b6iiPzdLGrYbpjScRZJZKkg/nzSzE tZCZn544qg1Kirb1V9EvhCg4osKcE/TBCr3q5dRb4cb7YQVuGHSxoJ6UkopYZ7i0 7ofg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698081853; x=1698168253; bh=Xv7Qe2zqmZKaH CN8teIMtMDrai3ly6urn4F9keS538M=; b=vlSMHOxIbpsQOWI2uQdet3BJ5oq1r /1Y4vr8f8Sy52rg6BxhsAkh/GDdKZKLYGlEkth3HSUKyV5N+U96hGLwrnxuejCS7 rOjStcoUI6Fus9jHfmr1b0kPUpqBGw+o9Xj++zO8b1LTrnKr2dB1kDlvQp+cM6y7 AFveFA9fhPcFTFNFRd2tyuGvlFy7mSKzS1ex59SAFm/zfo8bqr3/awl0+THky5Ct g+WAhrUvO6ulygIVgo0ByLfTlSGUvApNdXDqWrKK94gZryjBqnEWOBLjjtZDSDGn 1UCDbfVsqLkLS7+qq8dWirldJbZiNR518Qt71P7yjS84I5T5VNROsAXxg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeehteekgfetieeujeeuvddtvdelteffleejteduvdefffejieehheeuteffveei jeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Oct 2023 13:24:11 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------RtqMHK0l4UL5ctmRBoCYbu60" Message-ID: <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> Date: Mon, 23 Oct 2023 20:24:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <8634zyjt0k.fsf@mail.linkov.net> <8d1fb7ac-5c82-0ec2-8ae2-d09c131ec165@gutov.dev> <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86msw9g5yb.fsf@mail.linkov.net> X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) This is a multi-part message in MIME format. --------------RtqMHK0l4UL5ctmRBoCYbu60 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 23/10/2023 09:58, Juri Linkov wrote: >>> Wow, it works nicely for 'C-x p p C-x d'. >>> But strange it fails for 'C-x p p C-x v d' >>> with the same error: >>> (wrong-type-argument commandp 1) >> >> That's because (lookup-key ... "vd") also returns 1. >> >> I haven't been able to find a solution that works like we would expect. The >> most trivial would be to loop cutting off invalid prefixes, but then we end >> up with 'd', not 'v'. That's probably not what you want. >> >> Ideally, 'read-key-sequence' would stop at the user pressing 'v' and return >> "^Xv", then the rest would work out okay. But I haven't managed to have it >> do that, even when using overriding-terminal-local-map and temporarily >> altering the global map. My experimental patch is below, you can try >> tweaking it. > > Now can't type 'C-x p p C-x v d' completely because > 'C-x p p C-x v' opens vc-dir after typing 'v'. Huh. That actually works for me now, after I ran 'make' and restarted. But I thought you wanted this? 'C-x v d' ends with vc-dir, so if 'C-x p p C-x v' opens vc-dir, then isn't this what you expected? Anyway, the resulting UI is fairly counter-intuitive. >> And overall I'm not sure it's a constructive approach because you might >> have been going for 'C-x v d' (where the 'v' translation is correct), but >> you might have been going for 'C-x v D' or 'C-x v v' instead, very >> different commands. It might be better to report unknown key sequence and >> let the user make an explicit choice, like it works now. Depends on whether >> you notice the key sequence echoing while doing that input. > > Maybe adding a new option 'project-switch-use-global-map' would help? Try the attached, it's another iteration on the latest patch (prefix-command-echo-keystrokes-functions doesn't seem to work reliably in this context). Try it together with (setq project-switch-commands 'project-any-command) Also see the "Variation" in the comment (it allows for short bindings). --------------RtqMHK0l4UL5ctmRBoCYbu60 Content-Type: text/x-patch; charset=UTF-8; name="project-other-command-v3.diff" Content-Disposition: attachment; filename="project-other-command-v3.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IGZkYTEwODFlYjYyLi42ZmZmYTkyZDcxZiAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC04NDcsNiArODQ3LDcgQEAgcHJvamVjdC1wcmVmaXgtbWFwCiAgICAgKGRl ZmluZS1rZXkgbWFwICJHIiAncHJvamVjdC1vci1leHRlcm5hbC1maW5kLXJlZ2V4cCkKICAg ICAoZGVmaW5lLWtleSBtYXAgInIiICdwcm9qZWN0LXF1ZXJ5LXJlcGxhY2UtcmVnZXhwKQog ICAgIChkZWZpbmUta2V5IG1hcCAieCIgJ3Byb2plY3QtZXhlY3V0ZS1leHRlbmRlZC1jb21t YW5kKQorICAgIChkZWZpbmUta2V5IG1hcCAibyIgJ3Byb2plY3QtYW55LWNvbW1hbmQpCiAg ICAgKGRlZmluZS1rZXkgbWFwICJcQy1iIiAncHJvamVjdC1saXN0LWJ1ZmZlcnMpCiAgICAg bWFwKQogICAiS2V5bWFwIGZvciBwcm9qZWN0IGNvbW1hbmRzLiIpCkBAIC0xODEzLDYgKzE4 MTQsMzcgQEAgcHJvamVjdC1leGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQKICAgKGxldCAoKGRl ZmF1bHQtZGlyZWN0b3J5IChwcm9qZWN0LXJvb3QgKHByb2plY3QtY3VycmVudCB0KSkpKQog ICAgIChjYWxsLWludGVyYWN0aXZlbHkgIydleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQpKSkK IAorOzs7IyMjYXV0b2xvYWQKKyhkZWZ1biBwcm9qZWN0LWFueS1jb21tYW5kICgpCisgICJS dW4gdGhlIG5leHQgY29tbWFuZCBpbiB0aGUgY3VycmVudCBwcm9qZWN0LgorSWYgdGhlIGNv bW1hbmQgaXMgaW4gYHByb2plY3QtcHJlZml4LW1hcCcsIGl0IGdldHMgcGFzc2VkIHRoYXQK K2luZm8gd2l0aCBgcHJvamVjdC1jdXJyZW50LWRpcmVjdG9yeS1vdmVycmlkZScuICBPdGhl cndpc2UsCitgZGVmYXVsdC1kaXJlY3RvcnknIGlzIHRlbXBvcmFyaWx5IHNldCB0byB0aGUg Y3VycmVudCBwcm9qZWN0J3MKK3Jvb3QuIgorICAoaW50ZXJhY3RpdmUpCisgIChsZXQqICgo cHIgKHByb2plY3QtY3VycmVudCB0KSkKKyAgICAgICAgIDs7IFZhcmlhdGlvbjogY291bGQg YmUgYSBzZXBhcmF0ZSBjb21tYW5kLCBvciBhbiBvcHRpb24uCisgICAgICAgICA7OyAoY29t bWFuZCAobGV0ICgob3ZlcnJpZGluZy1sb2NhbC1tYXAgcHJvamVjdC1wcmVmaXgtbWFwKSkK KyAgICAgICAgIDs7ICAgICAgICAgICAgKGtleS1iaW5kaW5nIChyZWFkLWtleS1zZXF1ZW5j ZQorICAgICAgICAgOzsgICAgICAgICAgICAgICAgICAgICAgICAgIChmb3JtYXQgIltleGVj dXRlIGluICVzXToiIChwcm9qZWN0LXJvb3QgcHIpKSkKKyAgICAgICAgIDs7ICAgICAgICAg ICAgICAgICAgICAgICAgIHQpKSkKKyAgICAgICAgIChjb21tYW5kIChrZXktYmluZGluZyAo cmVhZC1rZXktc2VxdWVuY2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZv cm1hdCAiW2V4ZWN1dGUgaW4gJXNdOiIgKHByb2plY3Qtcm9vdCBwcikpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHQpKQorICAgICAgICAgKHJvb3QgKHByb2plY3Qtcm9v dCBwcikpCisgICAgICAgICBmb3VuZCkKKyAgICAod2hlbiBjb21tYW5kCisgICAgICA7OyBX ZSBjb3VsZCBhbHNvIGNoZWNrIHRoZSBjb21tYW5kIG5hbWUgYWdhaW5zdCAiXFxgcHJvamVj dC0iLAorICAgICAgOzsgYW5kL29yIChnZXQgY29tbWFuZCAncHJvamVjdC1jb21tYW5kKS4K KyAgICAgIChtYXAta2V5bWFwCisgICAgICAgKGxhbWJkYSAoX2V2dCBjbWQpIChpZiAoZXEg Y21kIGNvbW1hbmQpIChzZXRxIGZvdW5kIHQpKSkKKyAgICAgICBwcm9qZWN0LXByZWZpeC1t YXApCisgICAgICAoaWYgZm91bmQKKyAgICAgICAgICAobGV0ICgocHJvamVjdC1jdXJyZW50 LWRpcmVjdG9yeS1vdmVycmlkZSByb290KSkKKyAgICAgICAgICAgIChjYWxsLWludGVyYWN0 aXZlbHkgY29tbWFuZCkpCisgICAgICAgIChsZXQgKChkZWZhdWx0LWRpcmVjdG9yeSByb290 KSkKKyAgICAgICAgICAoY2FsbC1pbnRlcmFjdGl2ZWx5IGNvbW1hbmQpKSkpKSkKKwogKGRl ZnVuIHByb2plY3QtcmVtZW1iZXItcHJvamVjdHMtdW5kZXIgKGRpciAmb3B0aW9uYWwgcmVj dXJzaXZlKQogICAiSW5kZXggYWxsIHByb2plY3RzIGJlbG93IGEgZGlyZWN0b3J5IERJUi4K IElmIFJFQ1VSU0lWRSBpcyBub24tbmlsLCByZWN1cnNlIGludG8gYWxsIHN1YmRpcmVjdG9y aWVzIHRvIGZpbmQKQEAgLTE4OTEsNyArMTkyMyw4IEBAIHByb2plY3Qtc3dpdGNoLWNvbW1h bmRzCiAgICAgKHByb2plY3QtZmluZC1yZWdleHAgIkZpbmQgcmVnZXhwIikKICAgICAocHJv amVjdC1maW5kLWRpciAiRmluZCBkaXJlY3RvcnkiKQogICAgIChwcm9qZWN0LXZjLWRpciAi VkMtRGlyIikKLSAgICAocHJvamVjdC1lc2hlbGwgIkVzaGVsbCIpKQorICAgIChwcm9qZWN0 LWVzaGVsbCAiRXNoZWxsIikKKyAgICAocHJvamVjdC1hbnktY29tbWFuZCAiT3RoZXIiKSkK ICAgIkFsaXN0IG1hcHBpbmcgY29tbWFuZHMgdG8gZGVzY3JpcHRpb25zLgogVXNlZCBieSBg cHJvamVjdC1zd2l0Y2gtcHJvamVjdCcgdG8gY29uc3RydWN0IGEgZGlzcGF0Y2ggbWVudSBv ZgogY29tbWFuZHMgYXZhaWxhYmxlIHVwb24gXCJzd2l0Y2hpbmdcIiB0byBhbm90aGVyIHBy b2plY3QuCg== --------------RtqMHK0l4UL5ctmRBoCYbu60-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 13:36:26 2023 Received: (at 63648) by debbugs.gnu.org; 23 Oct 2023 17:36:26 +0000 Received: from localhost ([127.0.0.1]:51567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quyqo-0004mN-A5 for submit@debbugs.gnu.org; Mon, 23 Oct 2023 13:36:26 -0400 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:48821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quyql-0004m4-Sz for 63648@debbugs.gnu.org; Mon, 23 Oct 2023 13:36:24 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id A66211BF206; Mon, 23 Oct 2023 17:35:45 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> (Dmitry Gutov's message of "Mon, 23 Oct 2023 20:24:08 +0300") Organization: LINKOV.NET References: <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> Date: Mon, 23 Oct 2023 20:34:58 +0300 Message-ID: <86bkcpnsxp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Now can't type 'C-x p p C-x v d' completely because >> 'C-x p p C-x v' opens vc-dir after typing 'v'. > > Huh. That actually works for me now, after I ran 'make' and restarted. > > But I thought you wanted this? 'C-x v d' ends with vc-dir, so if 'C-x > p p C-x v' opens vc-dir, then isn't this what you expected? Then can't use other vc commands like 'C-x p p C-x v L' >> Maybe adding a new option 'project-switch-use-global-map' would help? > > Try the attached, it's another iteration on the latest patch > (prefix-command-echo-keystrokes-functions doesn't seem to work reliably in > this context). Try it together with > > (setq project-switch-commands 'project-any-command) > > Also see the "Variation" in the comment (it allows for short bindings). I tried it out but don't like that it requires an additional key 'o'. I believe it should be possible to add a new option 'project-switch-use-global-map' (or a new value 'global' for existing 'project-switch-use-entire-map') that will combine 'project-prefix-map' with global-map before reading a key sequence. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 13:37:25 2023 Received: (at 63648) by debbugs.gnu.org; 23 Oct 2023 17:37:25 +0000 Received: from localhost ([127.0.0.1]:51572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quyrk-0004nv-M2 for submit@debbugs.gnu.org; Mon, 23 Oct 2023 13:37:24 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quyri-0004ni-7r for 63648@debbugs.gnu.org; Mon, 23 Oct 2023 13:37:23 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 5D1A95C0377; Mon, 23 Oct 2023 13:36:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 23 Oct 2023 13:36:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698082607; x=1698169007; bh=aaTkkIpRyhkY11QTgbUUTOjlfU6gYbxOFbw T+2O9ovc=; b=AL092KYF/BI7yKm9aocUdFB5uT0d0rKTRt07qGykZ6nzXBzh3ws H4sRKQoxrusDNdrXfFvLjPgeOo9dQ/pJVdaMTNWakAgWpCiIW6gNypEsOB4U7iKJ ATsQzHdmBphtXTdwO14nphVbwuOl0NE1B0c9Q0oSF0SIFNTAR7H4Sqh9t8A0UDyi otE/tnF3xVIHRhRJ88WJKzlLrAC8pFxa22KC/4yPVGSDRe6O8tsPHPVGQvgTaSs8 zvqHbNwzE0zaOqPH1z01pfsLnIMClFanBeFYwwsdZuJMtF35PyA+tmj4JI/idDJC qX2mQHGH4Y+ZUssPEBAQd044gY/OMSF3enQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698082607; x=1698169007; bh=aaTkkIpRyhkY11QTgbUUTOjlfU6gYbxOFbw T+2O9ovc=; b=hfmsmYLQmEsFv0Ba98S8H2GC5vYbSW1fGVIJ7fkbuYckkTM/Lwv 4THdKhXpaRJH5LnmZ6PwJSwrbvwpYaLw6tgK6ySnXnWtrV17MBzrKPFncPylv7EH hsNTbikv9QLotaEjz/Tge5WoxlIQxytJghTMtXg3AJxGuQrnVZEKeunyYRWSAJ46 CmmQSruPGslba287lpoPtJ3+QCyd//cum/1Oz2k0zkvzBFnnOLYRwNlVoBByqpvH 4X0Uvep1s9CqyDua5yKg9bxDD9knConPso3e30PTLKrS1EWm4F3AkXRldaqO9GAI hwt7JvoyAwMqVoDTC9tkLn7XeBdMy1Eo3/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Oct 2023 13:36:46 -0400 (EDT) Message-ID: Date: Mon, 23 Oct 2023 20:36:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86bkcpnsxp.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86bkcpnsxp.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 23/10/2023 20:34, Juri Linkov wrote: >>> Maybe adding a new option 'project-switch-use-global-map' would help? >> Try the attached, it's another iteration on the latest patch >> (prefix-command-echo-keystrokes-functions doesn't seem to work reliably in >> this context). Try it together with >> >> (setq project-switch-commands 'project-any-command) >> >> Also see the "Variation" in the comment (it allows for short bindings). > I tried it out but don't like that it requires an additional key 'o'. > > I believe it should be possible to add a new option > 'project-switch-use-global-map' (or a new value 'global' for existing > 'project-switch-use-entire-map') that will combine 'project-prefix-map' > with global-map before reading a key sequence. Have you tried it together with (setq project-switch-commands 'project-any-command) ? From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 14:43:57 2023 Received: (at 63648) by debbugs.gnu.org; 23 Oct 2023 18:43:57 +0000 Received: from localhost ([127.0.0.1]:51677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quzu8-0006aP-NR for submit@debbugs.gnu.org; Mon, 23 Oct 2023 14:43:56 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:59399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quzu6-0006aB-G1 for 63648@debbugs.gnu.org; Mon, 23 Oct 2023 14:43:55 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 992D7E0004; Mon, 23 Oct 2023 18:43:17 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Mon, 23 Oct 2023 20:36:44 +0300") Organization: LINKOV.NET References: <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86bkcpnsxp.fsf@mail.linkov.net> Date: Mon, 23 Oct 2023 21:42:54 +0300 Message-ID: <8634y1npsh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> Maybe adding a new option 'project-switch-use-global-map' would help? >>> Try the attached, it's another iteration on the latest patch >>> (prefix-command-echo-keystrokes-functions doesn't seem to work reliably in >>> this context). Try it together with >>> >>> (setq project-switch-commands 'project-any-command) >>> >>> Also see the "Variation" in the comment (it allows for short bindings). >> I tried it out but don't like that it requires an additional key 'o'. >> I believe it should be possible to add a new option >> 'project-switch-use-global-map' (or a new value 'global' for existing >> 'project-switch-use-entire-map') that will combine 'project-prefix-map' >> with global-map before reading a key sequence. > > Have you tried it together with > > (setq project-switch-commands 'project-any-command) > > ? It doesn't allow using short keys from 'project-prefix-map'. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 14:50:17 2023 Received: (at 63648) by debbugs.gnu.org; 23 Oct 2023 18:50:17 +0000 Received: from localhost ([127.0.0.1]:51688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qv00G-0006pv-RO for submit@debbugs.gnu.org; Mon, 23 Oct 2023 14:50:17 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:43491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qv00F-0006ph-8W for 63648@debbugs.gnu.org; Mon, 23 Oct 2023 14:50:16 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id E6A253200994; Mon, 23 Oct 2023 14:49:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 23 Oct 2023 14:49:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698086979; x=1698173379; bh=/x09aqDzgprw2JxtMJ8gHxoQ+EELrJlJDAh 3Y5xEeZE=; b=iKxVxwHG3jFXjYdNlw9A2GiLSPyxmagpExOQN4ZQPgMUjbWL9Un cf3QYgCAc9cJyhLEQqd5txZ7kXyIvg1SzwhfExPSEOEJ5kU29G6OEMVDRv3hxrtQ 3EdOxqngxQq8pX+vYUnQtZxMOOl/nJOv/jxBf+lTLTe9FGv6rIDnAw1VH9Pmb1bQ RN0p7aJUJSOIBDs3oMlOQjMggq82h7Te5VFNzEc6bbbZOkaVjbJm01qdd7NwMy0P Ghey/yToQHIf3LWXD3gvShSqiYm5yW2JDzfWQl3EGHC++xUtx+CddVY13NdrMSlY 7lYTJdOXJ7FG0ybZSEJW2mr+MD12sbbL1ZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698086979; x=1698173379; bh=/x09aqDzgprw2JxtMJ8gHxoQ+EELrJlJDAh 3Y5xEeZE=; b=RAsfspHkSbKpcZji22XSifgLvBmi6PRrgkrX+Vk4sL/vB9Okkep +BYnWMw6TYCqCHsrZNdj4r8nq+AMbs0pV7fo4Fmy4AkCQQug9l3eZTp/h2IBEDZl UNDkQes54Eir2DF9iSJ9owofZSYw/YskY2N8GV4RQ6go8tBpfKUlCDmqhg58Y+3M 4ndXpLxRD9rGAPBHF+6i245VuEsyD58g6YyhnJoMSWIrvXWROOTEUvto08bY7BrY jXeAiyOB8fPh6/7yRJ25pvpceTyirJfJFV98HQIRHbm0AHAhk2axqjlXKgmOKiMZ Tzwan3H+JNyJjv/ntEuPUFAYw5UWItKgZ1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Oct 2023 14:49:38 -0400 (EDT) Message-ID: <5c1cbc58-9246-e8c5-87fa-93905578474d@gutov.dev> Date: Mon, 23 Oct 2023 21:49:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86bkcpnsxp.fsf@mail.linkov.net> <8634y1npsh.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <8634y1npsh.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 23/10/2023 21:42, Juri Linkov wrote: >>>>> Maybe adding a new option 'project-switch-use-global-map' would help? >>>> Try the attached, it's another iteration on the latest patch >>>> (prefix-command-echo-keystrokes-functions doesn't seem to work reliably in >>>> this context). Try it together with >>>> >>>> (setq project-switch-commands 'project-any-command) >>>> >>>> Also see the "Variation" in the comment (it allows for short bindings). >>> I tried it out but don't like that it requires an additional key 'o'. >>> I believe it should be possible to add a new option >>> 'project-switch-use-global-map' (or a new value 'global' for existing >>> 'project-switch-use-entire-map') that will combine 'project-prefix-map' >>> with global-map before reading a key sequence. >> Have you tried it together with >> >> (setq project-switch-commands 'project-any-command) >> >> ? > It doesn't allow using short keys from 'project-prefix-map'. As per the GGGP email, see the "Variation" in the comment. Uncomment it, comment out the next binding (for the same variable), and re-evaluate. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 25 13:12:19 2023 Received: (at 63648) by debbugs.gnu.org; 25 Oct 2023 17:12:19 +0000 Received: from localhost ([127.0.0.1]:59935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvhQY-0005eW-SE for submit@debbugs.gnu.org; Wed, 25 Oct 2023 13:12:19 -0400 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:60443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvhQW-0005eG-Q5 for 63648@debbugs.gnu.org; Wed, 25 Oct 2023 13:12:17 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id A68C9240003; Wed, 25 Oct 2023 17:11:38 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> (Dmitry Gutov's message of "Mon, 23 Oct 2023 20:24:08 +0300") Organization: LINKOV.NET References: <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> Date: Wed, 25 Oct 2023 19:53:25 +0300 Message-ID: <86wmva7iey.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > + ;; Variation: could be a separate command, or an option. > + ;; (command (let ((overriding-local-map project-prefix-map)) > + ;; (key-binding (read-key-sequence > + ;; (format "[execute in %s]:" (project-root pr))) > + ;; t))) Thanks, it works nicely. Any reason not to use this by default? > + (if found > + (let ((project-current-directory-override root)) > + (call-interactively command)) > + (let ((default-directory root)) > + (call-interactively command)))))) Not sure why need to let-bind project-current-directory-override here. It seems to work with and without it. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 25 18:27:39 2023 Received: (at 63648) by debbugs.gnu.org; 25 Oct 2023 22:27:39 +0000 Received: from localhost ([127.0.0.1]:60172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvmLi-00062W-NN for submit@debbugs.gnu.org; Wed, 25 Oct 2023 18:27:39 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:36947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvmLd-00062C-Jv for 63648@debbugs.gnu.org; Wed, 25 Oct 2023 18:27:37 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id C10BE320015C; Wed, 25 Oct 2023 18:26:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 25 Oct 2023 18:26:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1698272816; x=1698359216; bh=7W /BTWGxZAwrKTwIqtYLSHuuqYLK2IldCgCfqhLYf5Y=; b=F12c35QpfOCqU3Xa68 oPuoK7ahDQYw0YlNsEMyop0ckj4UNMsFTBl4TaUqwrz31gnbuD7s0hxDhV0GB1pn kxMO9AG9+78sKFoYiffKaNh/GxBgS3USSergDj4OLBqLVrrKezh8+b+ibhGc4yPQ mhM2dxc5jvmFKeRHwqMDstDmOT7Uj7+b2vhrhrKKAumYrl4y9gJJcLS+/7v0qJ9a AY7wTmLni7aMJzfabof9AsCVYlnnrJ9poZJv4JgThO+gEDFvfEw6xHhd9V68ud+z cvLSzcbGYszFSpFAFJwglQ3NXg/zB7IaVv8rXQDVwuhu5ANQHWmlMCwIrNWnCnu2 t5Xw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698272816; x=1698359216; bh=7W/BTWGxZAwrK TwIqtYLSHuuqYLK2IldCgCfqhLYf5Y=; b=aur3Y5sI3YxDxD5W6vDDuTKZR83Xn KqANi2dXz3h+Wc1XtC9acAoba7y8ny4YdguQ0xG5/0OFWaNZqncawRaAWfrrO+7o MAVnykr195Vf1ldifmo3An7j2ppo6Z83Vk9DIwVJLharRJ2MeAR7F5drDIEnPC6l Ma/kExW2AqYumEG73GhY2vGGCpNOd/8vyXkOzv8o+PgqJpGP6vpwzcMhi2kNQQj2 SMjLiCs4T5zGpYytMuiBDlVo9fvVYvisaTFvNTMTYtaQo8n+wnXkBR5XELo1kT7a srgrOONL3Y6+zjkYgW7BkXDJK3KISjbY00udS2IfimP45py2E67LzB0vg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrledugddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtkfffgggfuffvvehfhfgjsehmtderredtfeejnecuhfhrohhmpeffmhhithhr hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg hrnhepheetkefgteeiueejuedvtddvleetffeljeetuddvfeffjeeiheehueetffevieej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih htrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Oct 2023 18:26:54 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------OCO24ptx9HbRJUVDT6K3X4E6" Message-ID: Date: Thu, 26 Oct 2023 01:26:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86edj6hyem.fsf@mail.linkov.net> <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86wmva7iey.fsf@mail.linkov.net> X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) This is a multi-part message in MIME format. --------------OCO24ptx9HbRJUVDT6K3X4E6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 25/10/2023 19:53, Juri Linkov wrote: >> + ;; Variation: could be a separate command, or an option. >> + ;; (command (let ((overriding-local-map project-prefix-map)) >> + ;; (key-binding (read-key-sequence >> + ;; (format "[execute in %s]:" (project-root pr))) >> + ;; t))) > > Thanks, it works nicely. > Any reason not to use this by default? Nothing critical, but it might not fit the expectations without additional instructions in the prompt, or it can be unnecessary if the user had reached this command through 'C-x p o'. In the latter case there is also a small chance that the user had set up some advanced sub-maps inside project-prefix-map which would shadow some global bindings. So maybe a separate command is best. Please see how you like the attached new version together with (setq project-switch-commands #'project-prefix-or-any-command) I'm not sure about project-prefix-or-any-command's prompt, though (phrasing feels awkward). Improvements welcome. >> + (if found >> + (let ((project-current-directory-override root)) >> + (call-interactively command)) >> + (let ((default-directory root)) >> + (call-interactively command)))))) > > Not sure why need to let-bind project-current-directory-override here. > It seems to work with and without it. You mean with found=nil? Indeed, rebinding project-current-directory-override instead of just doing that with default-directory is critical for only a small subset of commands (such as project-switch-buffer or bug#58784). So this will be a 99% solution that, however, leads to more straightforward code. BTW, let me know if you prefer the "prefix command" style from your last patch for this command. My main sticking point with it was the change of logic used to indicate a different project root, but it can just as well be transplanted there. So if the prefix command approach is better for some scenarios, we can switch to it. --------------OCO24ptx9HbRJUVDT6K3X4E6 Content-Type: text/x-patch; charset=UTF-8; name="project-other-command-v4.diff" Content-Disposition: attachment; filename="project-other-command-v4.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IGZkYTEwODFlYjYyLi4zNjAxMzdlNjdiYiAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC04NDcsNiArODQ3LDcgQEAgcHJvamVjdC1wcmVmaXgtbWFwCiAgICAgKGRl ZmluZS1rZXkgbWFwICJHIiAncHJvamVjdC1vci1leHRlcm5hbC1maW5kLXJlZ2V4cCkKICAg ICAoZGVmaW5lLWtleSBtYXAgInIiICdwcm9qZWN0LXF1ZXJ5LXJlcGxhY2UtcmVnZXhwKQog ICAgIChkZWZpbmUta2V5IG1hcCAieCIgJ3Byb2plY3QtZXhlY3V0ZS1leHRlbmRlZC1jb21t YW5kKQorICAgIChkZWZpbmUta2V5IG1hcCAibyIgJ3Byb2plY3QtYW55LWNvbW1hbmQpCiAg ICAgKGRlZmluZS1rZXkgbWFwICJcQy1iIiAncHJvamVjdC1saXN0LWJ1ZmZlcnMpCiAgICAg bWFwKQogICAiS2V5bWFwIGZvciBwcm9qZWN0IGNvbW1hbmRzLiIpCkBAIC0xODEzLDYgKzE4 MTQsNTAgQEAgcHJvamVjdC1leGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQKICAgKGxldCAoKGRl ZmF1bHQtZGlyZWN0b3J5IChwcm9qZWN0LXJvb3QgKHByb2plY3QtY3VycmVudCB0KSkpKQog ICAgIChjYWxsLWludGVyYWN0aXZlbHkgIydleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQpKSkK IAorOzs7IyMjYXV0b2xvYWQKKyhkZWZ1biBwcm9qZWN0LWFueS1jb21tYW5kICgmb3B0aW9u YWwgb3ZlcnJpZGluZy1tYXAgcHJvbXB0LWZvcm1hdCkKKyAgIlJ1biB0aGUgbmV4dCBjb21t YW5kIGluIHRoZSBjdXJyZW50IHByb2plY3QuCitJZiB0aGUgY29tbWFuZCBpcyBpbiBgcHJv amVjdC1wcmVmaXgtbWFwJywgaXQgZ2V0cyBwYXNzZWQgdGhhdAoraW5mbyB3aXRoIGBwcm9q ZWN0LWN1cnJlbnQtZGlyZWN0b3J5LW92ZXJyaWRlJy4gIE90aGVyd2lzZSwKK2BkZWZhdWx0 LWRpcmVjdG9yeScgaXMgdGVtcG9yYXJpbHkgc2V0IHRvIHRoZSBjdXJyZW50IHByb2plY3Qn cworcm9vdC4KKworSWYgT1ZFUlJJRElORy1NQVAgaXMgbm9uLW5pbCwgaXQgd2lsbCBiZSB1 c2VkIGFzCitgb3ZlcnJpZGluZy1sb2NhbC1tYXAnIHRvIHByb3ZpZGUgc2hvcnRlciBiaW5k aW5ncyBmcm9tIHRoYXQgbWFwCit3aGljaCB3aWxsIHRha2UgcHJpb3JpdHkgb3ZlciB0aGUg Z2xvYmFsIG9uZXMuIgorICAoaW50ZXJhY3RpdmUpCisgIChsZXQqICgocHIgKHByb2plY3Qt Y3VycmVudCB0KSkKKyAgICAgICAgIChwcm9tcHQtZm9ybWF0IChvciBwcm9tcHQtZm9ybWF0 ICJbZXhlY3V0ZSBpbiAlc106IikpCisgICAgICAgICAoY29tbWFuZCAobGV0ICgob3ZlcnJp ZGluZy1sb2NhbC1tYXAgb3ZlcnJpZGluZy1tYXApKQorICAgICAgICAgICAgICAgICAgICAo a2V5LWJpbmRpbmcgKHJlYWQta2V5LXNlcXVlbmNlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGZvcm1hdCBwcm9tcHQtZm9ybWF0IChwcm9qZWN0LXJvb3QgcHIpKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQpKSkKKyAgICAgICAgIChyb290 IChwcm9qZWN0LXJvb3QgcHIpKQorICAgICAgICAgZm91bmQpCisgICAgKHdoZW4gY29tbWFu ZAorICAgICAgOzsgV2UgY291bGQgYWxzbyBjaGVjayB0aGUgY29tbWFuZCBuYW1lIGFnYWlu c3QgIlxcYHByb2plY3QtIiwKKyAgICAgIDs7IGFuZC9vciAoZ2V0IGNvbW1hbmQgJ3Byb2pl Y3QtY29tbWFuZCkuCisgICAgICAobWFwLWtleW1hcAorICAgICAgIChsYW1iZGEgKF9ldnQg Y21kKSAoaWYgKGVxIGNtZCBjb21tYW5kKSAoc2V0cSBmb3VuZCB0KSkpCisgICAgICAgcHJv amVjdC1wcmVmaXgtbWFwKQorICAgICAgKGlmIGZvdW5kCisgICAgICAgICAgKGxldCAoKHBy b2plY3QtY3VycmVudC1kaXJlY3Rvcnktb3ZlcnJpZGUgcm9vdCkpCisgICAgICAgICAgICAo Y2FsbC1pbnRlcmFjdGl2ZWx5IGNvbW1hbmQpKQorICAgICAgICAobGV0ICgoZGVmYXVsdC1k aXJlY3Rvcnkgcm9vdCkpCisgICAgICAgICAgKGNhbGwtaW50ZXJhY3RpdmVseSBjb21tYW5k KSkpKSkpCisKKzs7OyMjI2F1dG9sb2FkCisoZGVmdW4gcHJvamVjdC1wcmVmaXgtb3ItYW55 LWNvbW1hbmQgKCkKKyAgIlJ1biB0aGUgbmV4dCBjb21tYW5kIGluIHRoZSBjdXJyZW50IHBy b2plY3QuCitXb3JrcyBsaWtlIGBwcm9qZWN0LWFueS1jb21tYW5kJywgYnV0IGFsc28gbWl4 ZXMgaW4gdGhlIHNob3J0ZXIKK2JpbmRpbmdzIGZyb20gYHByb2plY3QtcHJlZml4LW1hcCcu IgorICAoaW50ZXJhY3RpdmUpCisgIChwcm9qZWN0LWFueS1jb21tYW5kIHByb2plY3QtcHJl Zml4LW1hcAorICAgICAgICAgICAgICAgICAgICAgICAoY29uY2F0CisgICAgICAgICAgICAg ICAgICAgICAgICAiW2luICVzXSBQcmVzcyAiCisgICAgICAgICAgICAgICAgICAgICAgICAo cHJvamVjdC0ta2V5bWFwLXByb21wdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICIgb3Ig b3RoZXI6IikpKQorCiAoZGVmdW4gcHJvamVjdC1yZW1lbWJlci1wcm9qZWN0cy11bmRlciAo ZGlyICZvcHRpb25hbCByZWN1cnNpdmUpCiAgICJJbmRleCBhbGwgcHJvamVjdHMgYmVsb3cg YSBkaXJlY3RvcnkgRElSLgogSWYgUkVDVVJTSVZFIGlzIG5vbi1uaWwsIHJlY3Vyc2UgaW50 byBhbGwgc3ViZGlyZWN0b3JpZXMgdG8gZmluZApAQCAtMTg5MSw3ICsxOTM2LDggQEAgcHJv amVjdC1zd2l0Y2gtY29tbWFuZHMKICAgICAocHJvamVjdC1maW5kLXJlZ2V4cCAiRmluZCBy ZWdleHAiKQogICAgIChwcm9qZWN0LWZpbmQtZGlyICJGaW5kIGRpcmVjdG9yeSIpCiAgICAg KHByb2plY3QtdmMtZGlyICJWQy1EaXIiKQotICAgIChwcm9qZWN0LWVzaGVsbCAiRXNoZWxs IikpCisgICAgKHByb2plY3QtZXNoZWxsICJFc2hlbGwiKQorICAgIChwcm9qZWN0LWFueS1j b21tYW5kICJPdGhlciIpKQogICAiQWxpc3QgbWFwcGluZyBjb21tYW5kcyB0byBkZXNjcmlw dGlvbnMuCiBVc2VkIGJ5IGBwcm9qZWN0LXN3aXRjaC1wcm9qZWN0JyB0byBjb25zdHJ1Y3Qg YSBkaXNwYXRjaCBtZW51IG9mCiBjb21tYW5kcyBhdmFpbGFibGUgdXBvbiBcInN3aXRjaGlu Z1wiIHRvIGFub3RoZXIgcHJvamVjdC4K --------------OCO24ptx9HbRJUVDT6K3X4E6-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 27 03:16:32 2023 Received: (at 63648) by debbugs.gnu.org; 27 Oct 2023 07:16:32 +0000 Received: from localhost ([127.0.0.1]:34991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwH56-0005Nq-BQ for submit@debbugs.gnu.org; Fri, 27 Oct 2023 03:16:32 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:54147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwH54-0005NX-1i for 63648@debbugs.gnu.org; Fri, 27 Oct 2023 03:16:30 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id AA85E240004; Fri, 27 Oct 2023 07:15:50 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Thu, 26 Oct 2023 01:26:52 +0300") Organization: LINKOV.NET References: <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> Date: Fri, 27 Oct 2023 09:50:35 +0300 Message-ID: <86bkckwnf8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> + ;; Variation: could be a separate command, or an option. >>> + ;; (command (let ((overriding-local-map project-prefix-map)) >>> + ;; (key-binding (read-key-sequence >>> + ;; (format "[execute in %s]:" (project-root pr))) >>> + ;; t))) >> Thanks, it works nicely. >> Any reason not to use this by default? > > Nothing critical, but it might not fit the expectations without additional > instructions in the prompt, or it can be unnecessary if the user had > reached this command through 'C-x p o'. Indeed, this is needed only for 'C-x p p' that supports the global map. > In the latter case there is also a small chance that the user had set up > some advanced sub-maps inside project-prefix-map which would shadow some > global bindings. So maybe a separate command is best. Please see how you > like the attached new version together with > > (setq project-switch-commands #'project-prefix-or-any-command) A separate command that is not used anywhere looks strange. Why not a simple option like 'project-switch-use-entire-map'? > I'm not sure about project-prefix-or-any-command's prompt, though (phrasing > feels awkward). Improvements welcome. I'm not a fan of the long prompt especially that wraps to the second line. > BTW, let me know if you prefer the "prefix command" style from your last > patch for this command. My main sticking point with it was the change of > logic used to indicate a different project root, but it can just as well be > transplanted there. So if the prefix command approach is better for some > scenarios, we can switch to it. Also I'm not a fan of ad-hoc reimplementation of the command loop with read-key-sequence and call-interactively. In my last patch this is avoided by using post-command-hook and set-transient-map. OTOH, since migrating from the former to the latter makes code more complicated, I'm fine with dropping my last patch as long as the former still can do everything that was supported by the latter. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 27 05:39:36 2023 Received: (at 63648) by debbugs.gnu.org; 27 Oct 2023 09:39:36 +0000 Received: from localhost ([127.0.0.1]:35087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwJJY-0000oM-0i for submit@debbugs.gnu.org; Fri, 27 Oct 2023 05:39:36 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:34749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwJJU-0000o6-3b for 63648@debbugs.gnu.org; Fri, 27 Oct 2023 05:39:34 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 35A353200970; Fri, 27 Oct 2023 05:38:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 27 Oct 2023 05:38:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698399533; x=1698485933; bh=0i306tuYDeSU2jeA/ggD7d8irSJzPaWZ7XH vbZdQx7o=; b=pPPIVhE/wUowPnGo4S1ttg6/W7QZ3zvfun5m4cXVUTuUO+32V7Y aGLYzx0vEqZ5MpX/TS8vh7+kb1AwysY6b9zi0RakVjUCKMf1gL3vq5N0efN4LW1L 8qud29lnH8R8wqcyAFR0Oh/tSQc3hPdBvStVPO+lxyc4AlqIElppIBc0JMesi/a0 6jeN8KD7a/6iZzOiSGKicUw9sajD6yi11INofDo8ynd8+7V4yRj8hFoEdtNvyBMl 5rV88JgnoVVfyleRMMsTU4W/CR0UA25Ip6+aATpMANacucHT0xGKskucnTwzL/0a 0zlYbK6a/Xri32EMMcvTams5nXI7htkZdJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698399533; x=1698485933; bh=0i306tuYDeSU2jeA/ggD7d8irSJzPaWZ7XH vbZdQx7o=; b=eDz03z8LSKdR5JbSdS+DEc5C4YgymQIilG/IYR0lpf4vRteU0tr dmMqMkXsWJHlTnHAjha3L9Yx26GaXihkUjmh6Dom2e0EgmCuonlNY6ZMBsCQQ1TY lav2ugQGWdYD8uIM1NirNICgHfxEf6+X/ISSPEi44TWo98TiEwzFrUXDu3qBc5uN CF5fuz8Xw6pcDOltUHYkN9EE7dd+XpUS76MxAkrgo1aTxP/HldNtpcg1r6WrETC8 XLtleZZIeCtcw5Uj5MXOrpuPVL4fr/g3ks7bkHyJTNWhveEWmMm17y0c3jYHKK53 ghBi4s8XP8YwHzguGWhzzMyBsVzhEeZ9/DA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleeggddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Oct 2023 05:38:52 -0400 (EDT) Message-ID: Date: Fri, 27 Oct 2023 12:38:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <8634zitwoy.fsf@mail.linkov.net> <50d46d30-a796-b855-0d4c-690d6cb3d15b@gutov.dev> <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86bkckwnf8.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 27/10/2023 09:50, Juri Linkov wrote: >>>> + ;; Variation: could be a separate command, or an option. >>>> + ;; (command (let ((overriding-local-map project-prefix-map)) >>>> + ;; (key-binding (read-key-sequence >>>> + ;; (format "[execute in %s]:" (project-root pr))) >>>> + ;; t))) >>> Thanks, it works nicely. >>> Any reason not to use this by default? >> >> Nothing critical, but it might not fit the expectations without additional >> instructions in the prompt, or it can be unnecessary if the user had >> reached this command through 'C-x p o'. > > Indeed, this is needed only for 'C-x p p' that supports the global map. > >> In the latter case there is also a small chance that the user had set up >> some advanced sub-maps inside project-prefix-map which would shadow some >> global bindings. So maybe a separate command is best. Please see how you >> like the attached new version together with >> >> (setq project-switch-commands #'project-prefix-or-any-command) > > A separate command that is not used anywhere looks strange. > Why not a simple option like 'project-switch-use-entire-map'? You would still need to change project-switch-commands, right? Or what would the option be called? >> I'm not sure about project-prefix-or-any-command's prompt, though (phrasing >> feels awkward). Improvements welcome. > > I'm not a fan of the long prompt especially that wraps to the second line. It didn't wrap for me. But if it's too long, how would you like it changed? Remove everything? Just keep [executing in ...]? >> BTW, let me know if you prefer the "prefix command" style from your last >> patch for this command. My main sticking point with it was the change of >> logic used to indicate a different project root, but it can just as well be >> transplanted there. So if the prefix command approach is better for some >> scenarios, we can switch to it. > > Also I'm not a fan of ad-hoc reimplementation of the command loop > with read-key-sequence and call-interactively. In my last patch > this is avoided by using post-command-hook and set-transient-map. > OTOH, since migrating from the former to the latter makes code > more complicated, I'm fine with dropping my last patch as long as > the former still can do everything that was supported by the latter. It shouldn't be hard to migrate in either direction, as long as the logic to choose which variable to modify is the same. This approach (with read-key-sequence, etc) looks a little shorter, but if any problems crop up, this is changeable. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 28 13:07:51 2023 Received: (at 63648) by debbugs.gnu.org; 28 Oct 2023 17:07:51 +0000 Received: from localhost ([127.0.0.1]:39470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwmms-0000aV-Vc for submit@debbugs.gnu.org; Sat, 28 Oct 2023 13:07:51 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:56811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwmmq-0000aE-O5 for 63648@debbugs.gnu.org; Sat, 28 Oct 2023 13:07:49 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0B425C0002; Sat, 28 Oct 2023 17:07:08 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Fri, 27 Oct 2023 12:38:50 +0300") Organization: LINKOV.NET References: <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> Date: Sat, 28 Oct 2023 19:56:08 +0300 Message-ID: <86h6mag077.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>>> + ;; Variation: could be a separate command, or an option. >>>>> + ;; (command (let ((overriding-local-map project-prefix-map)) >>>>> + ;; (key-binding (read-key-sequence >>>>> + ;; (format "[execute in %s]:" (project-root pr))) >>>>> + ;; t))) >>>> Thanks, it works nicely. >>>> Any reason not to use this by default? >>> >>> Nothing critical, but it might not fit the expectations without additional >>> instructions in the prompt, or it can be unnecessary if the user had >>> reached this command through 'C-x p o'. >> Indeed, this is needed only for 'C-x p p' that supports the global map. >> >>> In the latter case there is also a small chance that the user had set up >>> some advanced sub-maps inside project-prefix-map which would shadow some >>> global bindings. So maybe a separate command is best. Please see how you >>> like the attached new version together with >>> >>> (setq project-switch-commands #'project-prefix-or-any-command) >> A separate command that is not used anywhere looks strange. >> Why not a simple option like 'project-switch-use-entire-map'? > > You would still need to change project-switch-commands, right? Or what > would the option be called? I expected 'project-switch-use-global-map' to be used by 'project--switch-project-command' without the need to customize 'project-switch-commands'. >>> I'm not sure about project-prefix-or-any-command's prompt, though (phrasing >>> feels awkward). Improvements welcome. >> I'm not a fan of the long prompt especially that wraps to the second >> line. > > It didn't wrap for me. Because the length depends on the deepness of the project root. > But if it's too long, how would you like it changed? > Remove everything? Just keep [executing in ...]? I'd prefer keeping only [executing in ...] because it's useful to confirm in which directory the command will be executed. But all available keys are usually useless except in such modes as help-quick for novices. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 01 17:13:12 2023 Received: (at 63648) by debbugs.gnu.org; 1 Nov 2023 21:13:12 +0000 Received: from localhost ([127.0.0.1]:52725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyIWS-0005O3-EV for submit@debbugs.gnu.org; Wed, 01 Nov 2023 17:13:12 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyIWJ-0005NP-Oc for 63648@debbugs.gnu.org; Wed, 01 Nov 2023 17:13:06 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 5DFF35C028F; Wed, 1 Nov 2023 17:12:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 01 Nov 2023 17:12:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1698873139; x=1698959539; bh=Ll XVYf4L7nqk/x6F7Ko2ubw2BPb9HkdU6WJlPYuZn5w=; b=JfItaLjfzUS6de2fhN Q/l9IssUYs/Qr6po9TtrURY1ndtfMKXnsp7EJkektafQALNalfXHGxtQ6Bd/37Mj XjUczMEnJQxYHOZVg5NmqAw7zFn7AuogOQoW0Ydol8KeGC0/XOOHyvR60y5E/LkM k1qdwq3+50UK8YakLc9WAZdBH1xQqc+gizrIdlAKZOsTAGNSoe4kuuh6ACdxIOCV woiIi993q2VDmG8PdXHmLO0WTUoWglJR2wQjPhK0kQRVEhxCLoKXAmf0/dADCaME V2MJ7Y/MTyV1JiN17DOCkpWqpVGjuE3Vtmp78ZERvhGZUj0LKZjvZUdxuD5E+GHT R26Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698873139; x=1698959539; bh=LlXVYf4L7nqk/ x6F7Ko2ubw2BPb9HkdU6WJlPYuZn5w=; b=ukAeDGQrkvnH7f4RN4pbBGhJ+p23i Qz0wCKoTlt6Djj/isww8eqSud/GmxBp1dPnBqM8HFPqrjLJudfyG8YZKyG3Npj+C Ta0B095ActqmOYjS0qo+4z0aj2EFYwu3x3MVAog6CbS3BPf1RBlhF0111nMKWT4i Lz8P2Mh3LQgnuibc3yE/TH2KRsKHSIes/38czAQbvKZXlIRX0eGTBpK55x5XXMNv OLwR5eQVhlU1dtijWWM2kWYkpZn4ExpUwX81zffBWIAy3cfWYwa8CrKzeZn1JbTg RX4R3Q45h5V9ZIIrvkEbIhUq66tRoc8927JIEzEZ5gOYXYPTOJSM+acpw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtgedgudeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfuffvvehfhfgjsehmtderredtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepheetkefgteeiueejuedvtddvleetffeljeetuddvfeffjeeiheehueetffev ieejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Nov 2023 17:12:17 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------hSjSvt90mR6XL6E0EM0Ud0al" Message-ID: Date: Wed, 1 Nov 2023 23:12:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86il88x9cy.fsf@mail.linkov.net> <4367c45c-95b3-6a29-4ba3-068a3c748452@gutov.dev> <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> <86h6mag077.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86h6mag077.fsf@mail.linkov.net> X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) This is a multi-part message in MIME format. --------------hSjSvt90mR6XL6E0EM0Ud0al Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 28/10/2023 19:56, Juri Linkov wrote: >>>>>> + ;; Variation: could be a separate command, or an option. >>>>>> + ;; (command (let ((overriding-local-map project-prefix-map)) >>>>>> + ;; (key-binding (read-key-sequence >>>>>> + ;; (format "[execute in %s]:" (project-root pr))) >>>>>> + ;; t))) >>>>> Thanks, it works nicely. >>>>> Any reason not to use this by default? >>>> >>>> Nothing critical, but it might not fit the expectations without additional >>>> instructions in the prompt, or it can be unnecessary if the user had >>>> reached this command through 'C-x p o'. >>> Indeed, this is needed only for 'C-x p p' that supports the global map. >>> >>>> In the latter case there is also a small chance that the user had set up >>>> some advanced sub-maps inside project-prefix-map which would shadow some >>>> global bindings. So maybe a separate command is best. Please see how you >>>> like the attached new version together with >>>> >>>> (setq project-switch-commands #'project-prefix-or-any-command) >>> A separate command that is not used anywhere looks strange. >>> Why not a simple option like 'project-switch-use-entire-map'? >> >> You would still need to change project-switch-commands, right? Or what >> would the option be called? > > I expected 'project-switch-use-global-map' to be used > by 'project--switch-project-command' without the need > to customize 'project-switch-commands'. How about this, then? project-switch-use-global-map is obsoleted, all variations are accessible through customizing project-switch-commands. Should have better discoverability for project-prefix-or-any-command than simply having it included. >>>> I'm not sure about project-prefix-or-any-command's prompt, though (phrasing >>>> feels awkward). Improvements welcome. >>> I'm not a fan of the long prompt especially that wraps to the second >>> line. >> >> It didn't wrap for me. > > Because the length depends on the deepness of the project root. > >> But if it's too long, how would you like it changed? >> Remove everything? Just keep [executing in ...]? > > I'd prefer keeping only [executing in ...] because it's useful > to confirm in which directory the command will be executed. > But all available keys are usually useless except in such modes > as help-quick for novices. I don't like having a prompt that requires prior knowledge to use, but fair enough, let's just use [executing in ...] for now. Perhaps someone will suggest an alternative later. The new revision is attached, have a look. --------------hSjSvt90mR6XL6E0EM0Ud0al Content-Type: text/x-patch; charset=UTF-8; name="project-other-command-v5.diff" Content-Disposition: attachment; filename="project-other-command-v5.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwgYi9saXNwL3Byb2dtb2Rl cy9wcm9qZWN0LmVsCmluZGV4IDU3ZDlkOGU5OWFiLi45MTg2YWY2NjNjYiAxMDA2NDQKLS0t IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9q ZWN0LmVsCkBAIC04NTUsNiArODU1LDcgQEAgcHJvamVjdC1wcmVmaXgtbWFwCiAgICAgKGRl ZmluZS1rZXkgbWFwICJHIiAncHJvamVjdC1vci1leHRlcm5hbC1maW5kLXJlZ2V4cCkKICAg ICAoZGVmaW5lLWtleSBtYXAgInIiICdwcm9qZWN0LXF1ZXJ5LXJlcGxhY2UtcmVnZXhwKQog ICAgIChkZWZpbmUta2V5IG1hcCAieCIgJ3Byb2plY3QtZXhlY3V0ZS1leHRlbmRlZC1jb21t YW5kKQorICAgIChkZWZpbmUta2V5IG1hcCAibyIgJ3Byb2plY3QtYW55LWNvbW1hbmQpCiAg ICAgKGRlZmluZS1rZXkgbWFwICJcQy1iIiAncHJvamVjdC1saXN0LWJ1ZmZlcnMpCiAgICAg bWFwKQogICAiS2V5bWFwIGZvciBwcm9qZWN0IGNvbW1hbmRzLiIpCkBAIC0xODE3LDYgKzE4 MTgsNDYgQEAgcHJvamVjdC1leGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQKICAgKGxldCAoKGRl ZmF1bHQtZGlyZWN0b3J5IChwcm9qZWN0LXJvb3QgKHByb2plY3QtY3VycmVudCB0KSkpKQog ICAgIChjYWxsLWludGVyYWN0aXZlbHkgIydleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQpKSkK IAorOzs7IyMjYXV0b2xvYWQKKyhkZWZ1biBwcm9qZWN0LWFueS1jb21tYW5kICgmb3B0aW9u YWwgb3ZlcnJpZGluZy1tYXAgcHJvbXB0LWZvcm1hdCkKKyAgIlJ1biB0aGUgbmV4dCBjb21t YW5kIGluIHRoZSBjdXJyZW50IHByb2plY3QuCitJZiB0aGUgY29tbWFuZCBpcyBpbiBgcHJv amVjdC1wcmVmaXgtbWFwJywgaXQgZ2V0cyBwYXNzZWQgdGhhdAoraW5mbyB3aXRoIGBwcm9q ZWN0LWN1cnJlbnQtZGlyZWN0b3J5LW92ZXJyaWRlJy4gIE90aGVyd2lzZSwKK2BkZWZhdWx0 LWRpcmVjdG9yeScgaXMgdGVtcG9yYXJpbHkgc2V0IHRvIHRoZSBjdXJyZW50IHByb2plY3Qn cworcm9vdC4KKworSWYgT1ZFUlJJRElORy1NQVAgaXMgbm9uLW5pbCwgaXQgd2lsbCBiZSB1 c2VkIGFzCitgb3ZlcnJpZGluZy1sb2NhbC1tYXAnIHRvIHByb3ZpZGUgc2hvcnRlciBiaW5k aW5ncyBmcm9tIHRoYXQgbWFwCit3aGljaCB3aWxsIHRha2UgcHJpb3JpdHkgb3ZlciB0aGUg Z2xvYmFsIG9uZXMuIgorICAoaW50ZXJhY3RpdmUpCisgIChsZXQqICgocHIgKHByb2plY3Qt Y3VycmVudCB0KSkKKyAgICAgICAgIChwcm9tcHQtZm9ybWF0IChvciBwcm9tcHQtZm9ybWF0 ICJbZXhlY3V0ZSBpbiAlc106IikpCisgICAgICAgICAoY29tbWFuZCAobGV0ICgob3ZlcnJp ZGluZy1sb2NhbC1tYXAgb3ZlcnJpZGluZy1tYXApKQorICAgICAgICAgICAgICAgICAgICAo a2V5LWJpbmRpbmcgKHJlYWQta2V5LXNlcXVlbmNlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGZvcm1hdCBwcm9tcHQtZm9ybWF0IChwcm9qZWN0LXJvb3QgcHIpKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQpKSkKKyAgICAgICAgIChyb290 IChwcm9qZWN0LXJvb3QgcHIpKQorICAgICAgICAgZm91bmQpCisgICAgKHdoZW4gY29tbWFu ZAorICAgICAgOzsgV2UgY291bGQgYWxzbyBjaGVjayB0aGUgY29tbWFuZCBuYW1lIGFnYWlu c3QgIlxcYHByb2plY3QtIiwKKyAgICAgIDs7IGFuZC9vciAoZ2V0IGNvbW1hbmQgJ3Byb2pl Y3QtY29tbWFuZCkuCisgICAgICAobWFwLWtleW1hcAorICAgICAgIChsYW1iZGEgKF9ldnQg Y21kKSAoaWYgKGVxIGNtZCBjb21tYW5kKSAoc2V0cSBmb3VuZCB0KSkpCisgICAgICAgcHJv amVjdC1wcmVmaXgtbWFwKQorICAgICAgKGlmIGZvdW5kCisgICAgICAgICAgKGxldCAoKHBy b2plY3QtY3VycmVudC1kaXJlY3Rvcnktb3ZlcnJpZGUgcm9vdCkpCisgICAgICAgICAgICAo Y2FsbC1pbnRlcmFjdGl2ZWx5IGNvbW1hbmQpKQorICAgICAgICAobGV0ICgoZGVmYXVsdC1k aXJlY3Rvcnkgcm9vdCkpCisgICAgICAgICAgKGNhbGwtaW50ZXJhY3RpdmVseSBjb21tYW5k KSkpKSkpCisKKzs7OyMjI2F1dG9sb2FkCisoZGVmdW4gcHJvamVjdC1wcmVmaXgtb3ItYW55 LWNvbW1hbmQgKCkKKyAgIlJ1biB0aGUgbmV4dCBjb21tYW5kIGluIHRoZSBjdXJyZW50IHBy b2plY3QuCitXb3JrcyBsaWtlIGBwcm9qZWN0LWFueS1jb21tYW5kJywgYnV0IGFsc28gbWl4 ZXMgaW4gdGhlIHNob3J0ZXIKK2JpbmRpbmdzIGZyb20gYHByb2plY3QtcHJlZml4LW1hcCcu IgorICAoaW50ZXJhY3RpdmUpCisgIChwcm9qZWN0LWFueS1jb21tYW5kIHByb2plY3QtcHJl Zml4LW1hcCAiW2V4ZWN1dGUgaW4gJXNdOiIpKQorCiAoZGVmdW4gcHJvamVjdC1yZW1lbWJl ci1wcm9qZWN0cy11bmRlciAoZGlyICZvcHRpb25hbCByZWN1cnNpdmUpCiAgICJJbmRleCBh bGwgcHJvamVjdHMgYmVsb3cgYSBkaXJlY3RvcnkgRElSLgogSWYgUkVDVVJTSVZFIGlzIG5v bi1uaWwsIHJlY3Vyc2UgaW50byBhbGwgc3ViZGlyZWN0b3JpZXMgdG8gZmluZApAQCAtMTg5 NSw3ICsxOTM2LDggQEAgcHJvamVjdC1zd2l0Y2gtY29tbWFuZHMKICAgICAocHJvamVjdC1m aW5kLXJlZ2V4cCAiRmluZCByZWdleHAiKQogICAgIChwcm9qZWN0LWZpbmQtZGlyICJGaW5k IGRpcmVjdG9yeSIpCiAgICAgKHByb2plY3QtdmMtZGlyICJWQy1EaXIiKQotICAgIChwcm9q ZWN0LWVzaGVsbCAiRXNoZWxsIikpCisgICAgKHByb2plY3QtZXNoZWxsICJFc2hlbGwiKQor ICAgIChwcm9qZWN0LWFueS1jb21tYW5kICJPdGhlciIpKQogICAiQWxpc3QgbWFwcGluZyBj b21tYW5kcyB0byBkZXNjcmlwdGlvbnMuCiBVc2VkIGJ5IGBwcm9qZWN0LXN3aXRjaC1wcm9q ZWN0JyB0byBjb25zdHJ1Y3QgYSBkaXNwYXRjaCBtZW51IG9mCiBjb21tYW5kcyBhdmFpbGFi bGUgdXBvbiBcInN3aXRjaGluZ1wiIHRvIGFub3RoZXIgcHJvamVjdC4KQEAgLTE5MDcsNyAr MTk0OSwxNyBAQCBwcm9qZWN0LXN3aXRjaC1jb21tYW5kcwoga2V5IGlzIGxvb2tlZCB1cCBp biB0aGF0IG1hcC4KIAogVGhlIHZhbHVlIGNhbiBhbHNvIGJlIGEgc3ltYm9sLCB0aGUgbmFt ZSBvZiB0aGUgY29tbWFuZCB0byBiZQotaW52b2tlZCBpbW1lZGlhdGVseSB3aXRob3V0IGFu eSBkaXNwYXRjaCBtZW51LiIKK2ludm9rZWQgaW1tZWRpYXRlbHkgd2l0aG91dCBhbnkgZGlz cGF0Y2ggbWVudS4KKworT3IgaXQgY2FuIGJlIG9uZSBvZiB0d28gc3BlY2lhbCBzeW1ib2xz OgorCitgc2hvcnQta2V5cycgbWVhbnMgdGhlIGRpc3BhdGNoIG1lbnUgd2lsbCBmZWF0dXJl IGFsbCB0aGUKK29uZS1jaGFyYWN0ZXIgYmluZGluZ3MgZnJvbSBgcHJvamVjdC1wcmVmaXgt bWFwJy4gIFRoZSBwcm9tcHQKK3dpbGwgbG9vcCB1bnRpbCBvbmUgb2YgdGhvc2UgY2hhcmFj dGVycyBpcyBwcmVzc2VkLgorCitgc2hvcnQtb3ItYW55JyBtZWFucyB0aGF0IHRoZSBkaXNw YXRjaCB3aWxsIGFjY2VwdCBlaXRoZXIgYQorc2hvcnQga2V5IGZyb20gdGhlIGFib3ZlIG1h cCwgb3IgYW55IGdsb2JhbCBiaW5kaW5nIG5vdCBzaGFkb3dlZAorYnkgdGhlIGFib3ZlIGtl eXMuIgogICA6dmVyc2lvbiAiMjguMSIKICAgOmdyb3VwICdwcm9qZWN0CiAgIDpwYWNrYWdl LXZlcnNpb24gJyhwcm9qZWN0IC4gIjAuNi4wIikKQEAgLTE5MTksNyArMTk3MSw5IEBAIHBy b2plY3Qtc3dpdGNoLWNvbW1hbmRzCiAgICAgICAgICAgICAoY2hvaWNlIDp0YWcgIktleSB0 byBwcmVzcyIKICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IDp0YWcgIkluZmVyIGZyb20g dGhlIGtleW1hcCIgbmlsKQogICAgICAgICAgICAgICAgICAgICAoY2hhcmFjdGVyIDp0YWcg IkV4cGxpY2l0IGtleSIpKSkpCi0gICAgICAgICAgKHN5bWJvbCA6dGFnICJTaW5nbGUgY29t bWFuZCIpKSkKKyAgICAgICAgICAoc3ltYm9sIDp0YWcgIlNpbmdsZSBjb21tYW5kIikKKyAg ICAgICAgICAoY29uc3QgOnRhZyAiVXNlIHNob3J0IGtleXMgZnJvbSBgcHJvamVjdC1wcmVm aXgtbWFwJyIgc2hvcnQta2V5cykKKyAgICAgICAgICAoY29uc3QgOnRhZyAiVXNlIHNob3J0 IGtleXMgYW5kIGdsb2JhbCBiaW5kaW5ncyIgc2hvcnQtb3ItYW55KSkpCiAKIChkZWZjdXN0 b20gcHJvamVjdC1zd2l0Y2gtdXNlLWVudGlyZS1tYXAgbmlsCiAgICJXaGV0aGVyIGBwcm9q ZWN0LXN3aXRjaC1wcm9qZWN0JyB3aWxsIHVzZSB0aGUgZW50aXJlIGBwcm9qZWN0LXByZWZp eC1tYXAnLgpAQCAtMTkzMiw2ICsxOTg2LDEzIEBAIHByb2plY3Qtc3dpdGNoLXVzZS1lbnRp cmUtbWFwCiAgIDpncm91cCAncHJvamVjdAogICA6dmVyc2lvbiAiMjguMSIpCiAKKyhtYWtl LW9ic29sZXRlLXZhcmlhYmxlCisgJ3Byb2plY3Qtc3dpdGNoLXVzZS1lbnRpcmUtbWFwCisg KGZvcm1hdC1tZXNzYWdlCisgICJzZXQgYHByb2plY3Qtc3dpdGNoLWNvbW1hbmRzJyB0byB0 aGUgdmFsdWUgYHNob3J0LWtleXMnIGluc3RlYWQuIikKKyAiMzAuMSIKKyAnc2V0KQorCiAo ZGVmY3VzdG9tIHByb2plY3Qta2V5LXByb21wdC1zdHlsZSAoaWYgKGZhY2VwICdoZWxwLWtl eS1iaW5kaW5nKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2JyYWNrZXRzKQpAQCAt MTk4NCw3ICsyMDQ1LDggQEAgcHJvamVjdC0tc3dpdGNoLXByb2plY3QtY29tbWFuZAogICAg ICAgICAgICAgICAgICA7OyBYWFg6IEFkZCBhIHdhcm5pbmcgYWJvdXQgaXQ/CiAgICAgICAg ICAgICAgICAgIChyZXZlcnNlIHJvdykKICAgICAgICAgICAgICAgIHJvdykpCi0gICAgICAg ICAgIHByb2plY3Qtc3dpdGNoLWNvbW1hbmRzKSkKKyAgICAgICAgICAgKGFuZCAobGlzdHAg cHJvamVjdC1zd2l0Y2gtY29tbWFuZHMpCisgICAgICAgICAgICAgICAgcHJvamVjdC1zd2l0 Y2gtY29tbWFuZHMpKSkKICAgICAgICAgIChjb21tYW5kcy1tYXAKICAgICAgICAgICAobGV0 ICgodGVtcC1tYXAgKG1ha2Utc3BhcnNlLWtleW1hcCkpKQogICAgICAgICAgICAgKHNldC1r ZXltYXAtcGFyZW50IHRlbXAtbWFwIHByb2plY3QtcHJlZml4LW1hcCkKQEAgLTE5OTIsMTEg KzIwNTQsMTMgQEAgcHJvamVjdC0tc3dpdGNoLXByb2plY3QtY29tbWFuZAogICAgICAgICAg ICAgICAod2hlbi1sZXQgKChjbWQgKG50aCAwIHJvdykpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgKGtleWNoYXIgKG50aCAyIHJvdykpKQogICAgICAgICAgICAgICAgIChkZWZpbmUt a2V5IHRlbXAtbWFwICh2ZWN0b3Iga2V5Y2hhcikgY21kKSkpKSkKKyAgICAgICAgICh1c2Ut YWxsLXNob3J0LWtleXMgKG9yIHByb2plY3Qtc3dpdGNoLXVzZS1lbnRpcmUtbWFwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXEgcHJvamVjdC1zd2l0Y2gtY29tbWFu ZHMgJ3Nob3J0LWtleXMpKSkKICAgICAgICAgIGNvbW1hbmQKICAgICAgICAgIGNob2ljZSkK ICAgICAod2hpbGUgKG5vdCBjb21tYW5kKQogICAgICAgKGxldCogKChvdmVycmlkaW5nLWxv Y2FsLW1hcCBjb21tYW5kcy1tYXApCi0gICAgICAgICAgICAgKHByb21wdCAoaWYgcHJvamVj dC1zd2l0Y2gtdXNlLWVudGlyZS1tYXAKKyAgICAgICAgICAgICAocHJvbXB0IChpZiB1c2Ut YWxsLXNob3J0LWtleXMKICAgICAgICAgICAgICAgICAgICAgICAgICAocHJvamVjdC0ta2V5 bWFwLXByb21wdCkKICAgICAgICAgICAgICAgICAgICAgICAgKHByb2plY3QtLW1lbnUtcHJv bXB0KSkpKQogICAgICAgICAod2hlbiBjaG9pY2UKQEAgLTIwMDgsNyArMjA3Miw3IEBAIHBy b2plY3QtLXN3aXRjaC1wcm9qZWN0LWNvbW1hbmQKICAgICAgICAgKHNldHEgY2hvaWNlIChy ZWFkLWtleS1zZXF1ZW5jZSAoY29uY2F0ICJDaG9vc2U6ICIgcHJvbXB0KSkpCiAgICAgICAg ICh3aGVuIChzZXRxIGNvbW1hbmQgKGxvb2t1cC1rZXkgY29tbWFuZHMtbWFwIGNob2ljZSkp CiAgICAgICAgICAgKHdoZW4gKG51bWJlcnAgY29tbWFuZCkgKHNldHEgY29tbWFuZCBuaWwp KQotICAgICAgICAgICh1bmxlc3MgKG9yIHByb2plY3Qtc3dpdGNoLXVzZS1lbnRpcmUtbWFw CisgICAgICAgICAgKHVubGVzcyAob3IgdXNlLWFsbC1zaG9ydC1rZXlzCiAgICAgICAgICAg ICAgICAgICAgICAgKGFzc3EgY29tbWFuZCBjb21tYW5kcy1tZW51KSkKICAgICAgICAgICAg IChzZXRxIGNvbW1hbmQgbmlsKSkpCiAgICAgICAgIChsZXQgKChnbG9iYWwtY29tbWFuZCAo bG9va3VwLWtleSAoY3VycmVudC1nbG9iYWwtbWFwKSBjaG9pY2UpKSkKQEAgLTIwMjcsOSAr MjA5MSwxNCBAQCBwcm9qZWN0LXN3aXRjaC1wcm9qZWN0CiBXaGVuIGNhbGxlZCBpbiBhIHBy b2dyYW0sIGl0IHdpbGwgdXNlIHRoZSBwcm9qZWN0IGNvcnJlc3BvbmRpbmcKIHRvIGRpcmVj dG9yeSBESVIuIgogICAoaW50ZXJhY3RpdmUgKGxpc3QgKGZ1bmNhbGwgcHJvamVjdC1wcm9t cHRlcikpKQotICAobGV0ICgoY29tbWFuZCAoaWYgKHN5bWJvbHAgcHJvamVjdC1zd2l0Y2gt Y29tbWFuZHMpCi0gICAgICAgICAgICAgICAgICAgICBwcm9qZWN0LXN3aXRjaC1jb21tYW5k cwotICAgICAgICAgICAgICAgICAgIChwcm9qZWN0LS1zd2l0Y2gtcHJvamVjdC1jb21tYW5k KSkpCisgIChsZXQgKChjb21tYW5kCisgICAgICAgICAoY29uZAorICAgICAgICAgICgoZXEg cHJvamVjdC1zd2l0Y2gtY29tbWFuZHMgJ3Nob3J0LW9yLWFueSkKKyAgICAgICAgICAgIydw cm9qZWN0LXByZWZpeC1vci1hbnktY29tbWFuZCkKKyAgICAgICAgICAoKGFuZCAoc3ltYm9s cCBwcm9qZWN0LXN3aXRjaC1jb21tYW5kcykKKyAgICAgICAgICAgICAgICAobm90IChlcSBw cm9qZWN0LXN3aXRjaC1jb21tYW5kcyAnc2hvcnQta2V5cykpKQorICAgICAgICAgICBwcm9q ZWN0LXN3aXRjaC1jb21tYW5kcykKKyAgICAgICAgICAodCAocHJvamVjdC0tc3dpdGNoLXBy b2plY3QtY29tbWFuZCkpKSkKICAgICAgICAgKGJ1ZmZlciAoY3VycmVudC1idWZmZXIpKSkK ICAgICAodW53aW5kLXByb3RlY3QKICAgICAgICAgKHByb2duCg== --------------hSjSvt90mR6XL6E0EM0Ud0al-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 02 13:26:20 2023 Received: (at 63648) by debbugs.gnu.org; 2 Nov 2023 17:26:20 +0000 Received: from localhost ([127.0.0.1]:55972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qybSV-0001l2-Vz for submit@debbugs.gnu.org; Thu, 02 Nov 2023 13:26:20 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:38287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qybSR-0001kR-Hl for 63648@debbugs.gnu.org; Thu, 02 Nov 2023 13:26:18 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id C165840003; Thu, 2 Nov 2023 17:25:30 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Wed, 1 Nov 2023 23:12:15 +0200") Organization: LINKOV.NET References: <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> <86h6mag077.fsf@mail.linkov.net> Date: Thu, 02 Nov 2023 19:20:53 +0200 Message-ID: <86v8akoyve.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > How about this, then? > > project-switch-use-global-map is obsoleted, all variations are accessible > through customizing project-switch-commands. Should have better > discoverability for project-prefix-or-any-command than simply having it > included. I don't know, it's extra trouble for users to migrate from the obsoleted project-switch-use-entire-map. But maybe ok. > I don't like having a prompt that requires prior knowledge to use, but fair > enough, let's just use [executing in ...] for now. Perhaps someone will > suggest an alternative later. > > The new revision is attached, have a look. Thanks, tried, it works nicely. One minor question is why project-prefix-or-any-command is a command. Would anyone want to bind it in project-prefix-map, like project-any-command that makes sense to run commands in root. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 02 17:34:50 2023 Received: (at 63648) by debbugs.gnu.org; 2 Nov 2023 21:34:50 +0000 Received: from localhost ([127.0.0.1]:56296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyfKv-0002dz-RU for submit@debbugs.gnu.org; Thu, 02 Nov 2023 17:34:50 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:36715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyfKq-0002dd-MW for 63648@debbugs.gnu.org; Thu, 02 Nov 2023 17:34:45 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E46275C01C4; Thu, 2 Nov 2023 17:33:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 02 Nov 2023 17:33:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698960838; x=1699047238; bh=F2smjJAGqa4QLADqrzcs/q6hdcn+zlGeywa uwbCJOsk=; b=OC/PUHcnwvgL3QZOioerF3bLIDjXCKOZWhGLbHvoAJ4yMa42TP+ ThJCfcq6ERl//ObTOxCyjRQ0U9L5mvBFg4D2tBmqoqMQCQlDJ3eieWyWdkYx0jd9 MQFsytwiMP/oWL8lcxX4RmhX15J4GPVJdUYpe+Zyed/hLyxftfFvROb5ZrxPq/Qs qRJYnMLZGohkURTbrf+HJt8Fzdumm/H3VuCsRnz0noJKWe3ngmH5QcyH1ILh5o1G eqkDGxS1zxL8MYmLblVfwve5BkbhohKq3IMvbgTKtTAo0PXquUXBq94G+EUdOko4 EJYMhZEKMMXKi2bY1YZXEBY4xjSQo9or6RA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698960838; x=1699047238; bh=F2smjJAGqa4QLADqrzcs/q6hdcn+zlGeywa uwbCJOsk=; b=T87SEBg6V9t4xBki+ippP9/HzMyJq6XAlEZSKUfRlhuC5wKgvR5 c4XszfA5IpmVpM98lq1NQtjtQEPjyPkBD/rHHTkircWMDN0ThCDZn3745E7+gH4/ VhbAnwf53ZqkNZ5oPYB8YPUuvJcbFHvvI/9hy6lKaKN1FPN2hH4DaiI8mecRpAhy 4oRN/vw+piHNh39AMzHvV5WwUcjrYfIQJQ9e+Yi1xraI1D5smRmJ9jYeQzCaknJ2 Zq5VDQ06YVpflneUIIuw8gnHKpZBey8tyNgV06SZ0/9auemAV0WfX5JH8TgEp5+O nrmTPB4wBkIBj7zSjJmLY42D0dfHgky5Q1w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Nov 2023 17:33:56 -0400 (EDT) Message-ID: Date: Thu, 2 Nov 2023 23:33:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <2e34e515-a921-a969-0915-bea94c745f8b@gutov.dev> <868r9258oi.fsf@mail.linkov.net> <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> <86h6mag077.fsf@mail.linkov.net> <86v8akoyve.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86v8akoyve.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 02/11/2023 19:20, Juri Linkov wrote: >> How about this, then? >> >> project-switch-use-global-map is obsoleted, all variations are accessible >> through customizing project-switch-commands. Should have better >> discoverability for project-prefix-or-any-command than simply having it >> included. > > I don't know, it's extra trouble for users to migrate > from the obsoleted project-switch-use-entire-map. > But maybe ok. I couldn't find a better alternative to keep the behavior compatible. Either we have the user customize an existing var (this was the option where they'd set project-switch-commands to `project-prefix-or-any-command', which you didn't like), or we would add a yet another custom var which would, conceptually, conflict with the two existing ones. Unifying all three alternatives in one option seems like the logical choice. >> I don't like having a prompt that requires prior knowledge to use, but fair >> enough, let's just use [executing in ...] for now. Perhaps someone will >> suggest an alternative later. >> >> The new revision is attached, have a look. > > Thanks, tried, it works nicely. > > One minor question is why project-prefix-or-any-command > is a command. Would anyone want to bind it in project-prefix-map, > like project-any-command that makes sense to run commands in root. It's done this way basically for the ease and brevity of implementation. But someone could also advise it, or copy and do their own alternative, e.g. changing the prompt. Hopefully having this piece of behavior so localized will make it easier to grok for future contributors as well. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 04 13:30:42 2023 Received: (at 63648) by debbugs.gnu.org; 4 Nov 2023 17:30:42 +0000 Received: from localhost ([127.0.0.1]:35674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzKTp-0000uZ-Tg for submit@debbugs.gnu.org; Sat, 04 Nov 2023 13:30:42 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:50785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzKTo-0000uE-CT for 63648@debbugs.gnu.org; Sat, 04 Nov 2023 13:30:41 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5C4AD1C0008; Sat, 4 Nov 2023 17:29:54 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Thu, 2 Nov 2023 23:33:54 +0200") Organization: LINKOV.NET References: <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> <86h6mag077.fsf@mail.linkov.net> <86v8akoyve.fsf@mail.linkov.net> Date: Sat, 04 Nov 2023 19:28:47 +0200 Message-ID: <86sf5lxyow.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> How about this, then? >>> >>> project-switch-use-global-map is obsoleted, all variations are accessible >>> through customizing project-switch-commands. Should have better >>> discoverability for project-prefix-or-any-command than simply having it >>> included. >> I don't know, it's extra trouble for users to migrate >> from the obsoleted project-switch-use-entire-map. >> But maybe ok. > > I couldn't find a better alternative to keep the behavior compatible. > > Either we have the user customize an existing var (this was the option > where they'd set project-switch-commands to > `project-prefix-or-any-command', which you didn't like), or we would add > a yet another custom var which would, conceptually, conflict with the two > existing ones. I don't dislike it. I proposed a new option project-switch-use-global-map. But when project-switch-commands should be customized instead of new option, then I'd prefer to use function names like `project-prefix-or-any-command' instead of symbols `short-or-any' and `short-keys'. > Unifying all three alternatives in one option seems like the logical choice. To avoid obsoleting `project-switch-use-entire-map', `short-keys' could be removed. Then `short-or-any' could be replaced by `project-prefix-or-any-command'. This will introduce minimal changes. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 04 20:56:30 2023 Received: (at 63648) by debbugs.gnu.org; 5 Nov 2023 00:56:30 +0000 Received: from localhost ([127.0.0.1]:35912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzRRG-0005Yn-6m for submit@debbugs.gnu.org; Sat, 04 Nov 2023 20:56:30 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzRRD-0005YX-Ex for 63648@debbugs.gnu.org; Sat, 04 Nov 2023 20:56:28 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B97C85C00D6; Sat, 4 Nov 2023 20:55:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 04 Nov 2023 20:55:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1699145744; x=1699232144; bh=6Gxr6Y1/58CEl4GDz+rzw3U72gzB6TajorQ XWjKmsNk=; b=MkRUT/2ttvygIfaD/Jq12G8kMQDxyFhiWlm7hxeBB90az9An8CS 6R//ix8DZM6JmygN1vE2rGyx7Aq6iePqisiFX4AkG+t4uvaARsH4yUE2C/36m7kv LUgm0+f+ifYXVcXfHv+YnOK7VHVoDE+ulVaSOKdaaKySenvWH+apIuEAaYS0fzhi 8YZeOjIueAcbjTdGwnOLiofpKVogmDOtqeQtU65WS2puH1WyxrdJ/LHy82n89Ved lljXRYvIr8RS5npcBZ9oSUJZCowx/WmOhN7aoObGspfUEjG67nujP8G43cuTOUf6 iv1xybdE2+jPa5yv79InGLCkAxN9nX9eNeQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699145744; x=1699232144; bh=6Gxr6Y1/58CEl4GDz+rzw3U72gzB6TajorQ XWjKmsNk=; b=tSSrjAY7+iIiGbZ4F4c+qqqVuZ/jOsZHJG8XBWN9jWMTPnhchIZ 6qCHYynFM6a8eJXM5et/gXkSl7CDPt532Teep47R8Kq+ivPn2A+eZtvJE9fZvv3v atlsfb+TwX0buSQv8udVNPBlnIsehkhXntfEgBkNBB3t0oVqgHdCAHblW2Vb24gu o/76AogmAD/rhupyawhvbudZkMa/SNFlKIPnz1vM/DTIj2sukS0e3/wObhtwdT1j 4kmOQo77/3a89lO6A6BxNKyvsBrNDVNTfLlnmeqhOsweIrTr223yO4efaAV9VV0i zEaJ1g2YIucGsD8zLf2WRmsy3ODNZSdrvug== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduuddgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 4 Nov 2023 20:55:43 -0400 (EDT) Message-ID: Date: Sun, 5 Nov 2023 02:55:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <86edishisp.fsf@mail.linkov.net> <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> <86h6mag077.fsf@mail.linkov.net> <86v8akoyve.fsf@mail.linkov.net> <86sf5lxyow.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86sf5lxyow.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 04/11/2023 19:28, Juri Linkov wrote: >>>> How about this, then? >>>> >>>> project-switch-use-global-map is obsoleted, all variations are accessible >>>> through customizing project-switch-commands. Should have better >>>> discoverability for project-prefix-or-any-command than simply having it >>>> included. >>> I don't know, it's extra trouble for users to migrate >>> from the obsoleted project-switch-use-entire-map. >>> But maybe ok. >> >> I couldn't find a better alternative to keep the behavior compatible. >> >> Either we have the user customize an existing var (this was the option >> where they'd set project-switch-commands to >> `project-prefix-or-any-command', which you didn't like), or we would add >> a yet another custom var which would, conceptually, conflict with the two >> existing ones. > > I don't dislike it. Very good. > I proposed a new option project-switch-use-global-map. I didn't know how the reconcile the existence of both project-switch-use-entire-map and project-switch-use-global-map. Saying in both docstrings that one takes priority over the other (and possibly repeating that in the doc for project-switch-commands) would be awkward. > But when project-switch-commands should be customized instead of new option, > then I'd prefer to use function names like `project-prefix-or-any-command' > instead of symbols `short-or-any' and `short-keys'. > >> Unifying all three alternatives in one option seems like the logical choice. > > To avoid obsoleting `project-switch-use-entire-map', `short-keys' > could be removed. Then `short-or-any' could be replaced by > `project-prefix-or-any-command'. This will introduce minimal changes. All right, that sounds like a mix between v4 and v5. I've pushed 41e801fea1c to master, please take a look. In the future, perhaps we'd want to obsolete the option project-switch-use-entire-map anyway, replacing it with a separate command to be used in the same way as the newly-added one. But for now the change is maximally backward-compatible. I'm still not sure personally about the prompt in project-prefix-or-any-command (short and not differentiating from project-any-command), but let's see what others think and propose later. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 02:32:53 2023 Received: (at 63648) by debbugs.gnu.org; 6 Nov 2023 07:32:53 +0000 Received: from localhost ([127.0.0.1]:38587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzu6O-00079M-RJ for submit@debbugs.gnu.org; Mon, 06 Nov 2023 02:32:53 -0500 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:46289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzu6M-00078p-TC for 63648@debbugs.gnu.org; Mon, 06 Nov 2023 02:32:51 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 86E98FF80A; Mon, 6 Nov 2023 07:32:05 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands In-Reply-To: (Dmitry Gutov's message of "Sun, 5 Nov 2023 02:55:41 +0200") Organization: LINKOV.NET References: <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> <86h6mag077.fsf@mail.linkov.net> <86v8akoyve.fsf@mail.linkov.net> <86sf5lxyow.fsf@mail.linkov.net> Date: Mon, 06 Nov 2023 09:16:01 +0200 Message-ID: <86r0l3crbq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 63648 Cc: Spencer Baugh , 63648@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I proposed a new option project-switch-use-global-map. > > I didn't know how the reconcile the existence of both > project-switch-use-entire-map and project-switch-use-global-map. Saying in > both docstrings that one takes priority over the other (and possibly > repeating that in the doc for project-switch-commands) would be awkward. Then another variant would be to allow a new value 'global' in the existing 'project-switch-use-entire-map'. >> But when project-switch-commands should be customized instead of new option, >> then I'd prefer to use function names like `project-prefix-or-any-command' >> instead of symbols `short-or-any' and `short-keys'. >> >>> Unifying all three alternatives in one option seems like the logical choice. >> To avoid obsoleting `project-switch-use-entire-map', `short-keys' >> could be removed. Then `short-or-any' could be replaced by >> `project-prefix-or-any-command'. This will introduce minimal changes. > > All right, that sounds like a mix between v4 and v5. > > I've pushed 41e801fea1c to master, please take a look. Thanks, I tested and it works great. > In the future, perhaps we'd want to obsolete the option > project-switch-use-entire-map anyway, replacing it with a separate command > to be used in the same way as the newly-added one. But for now the change > is maximally backward-compatible. Indeed, this is the safest change for now. More changes either will bring trouble to users requiring to migrate from the obsolete variable, or will make code more complicated. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 17:50:36 2023 Received: (at 63648-done) by debbugs.gnu.org; 6 Nov 2023 22:50:37 +0000 Received: from localhost ([127.0.0.1]:40987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r08QW-0000PS-E9 for submit@debbugs.gnu.org; Mon, 06 Nov 2023 17:50:36 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r08QU-0000PC-VG for 63648-done@debbugs.gnu.org; Mon, 06 Nov 2023 17:50:35 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 39AA15C027D; Mon, 6 Nov 2023 17:49:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 06 Nov 2023 17:49:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1699310992; x=1699397392; bh=ab1LlP0W5/MYxaor1iEeBgp3sTwNSX2mQbw zK8xUptE=; b=NIQO2MZO1qkkHDj7uyB9hngR/ajdj/Wgsz3bJXok3C0Ct3dx/mI sPsQfCCDcAmhs6ukOWag6eDV7jEQ7cD9vdWMYup3eA+utii3Bmr7ICUDnXkAqIpM Jeth3NT4pbfU8q3ijgXS0PkcJmJSEPcba4Hv8pjE0dwv9igfz9jHjCdL68YT+WBB eo79LUXa8z9srtdsFoCOpmBGAYZn2oqOnB7uf3K052ixNmnOya2FMZZhBqxlQMnp EB1AtJvUllQsou5iUdWG8vqpTyHhGHkzUSa1YINowIMwmHKvXHWJ2qCZhyg7qB/X 9KpvC4KcLY0PGVjCmHepNeQe9kK/YuvfkQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699310992; x=1699397392; bh=ab1LlP0W5/MYxaor1iEeBgp3sTwNSX2mQbw zK8xUptE=; b=P1F1dzFoe3Eoyy1ezwNND34bJ7/4f4Cx8cTFjQLnuy0Rd4Vq6uU TQQfBcol3uKuKVdhb+KjmAPb6kVMXb4j7ZMzxYHjgxDvn22U4sJLefCG3GdCfKT/ cvCzYuMrfKamUwKOVk7EUJhXTvXbnxqi1zTX2gQLwoWIsR68LpxWqv779jrG7kmf cPCp7vIzpprT6JKlURusaRRpbO7Z1tQrJ04L81JSu92Y/faOgL0nNPnbrHZPB8GN g+BlAm3Xxqose3YN9MivUMMq0hXMG+JwJAp6znvgV2pYKVi/yNMTN49gxC5Nbnse 09iQUpru05ojv5ewQ/Krs2f+QHKCvtMbIEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduhedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Nov 2023 17:49:50 -0500 (EST) Message-ID: <6be78df5-f9f5-9423-92d0-a5b4e329b0d2@gutov.dev> Date: Tue, 7 Nov 2023 00:49:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands Content-Language: en-US To: Juri Linkov References: <6fc81cbf-a21f-c5b4-aa56-e8518b8570d7@gutov.dev> <86msxgatuy.fsf@mail.linkov.net> <86y1gynr2u.fsf@mail.linkov.net> <7c72fd8c-c3f6-a974-8a4b-a081f7a9fe1a@gutov.dev> <86ttqmv7c6.fsf@mail.linkov.net> <56e7d865-0456-db7d-3a5d-1235e62508bf@gutov.dev> <865y31onju.fsf@mail.linkov.net> <8562bdad-e487-886a-af49-7f67d8d14b7a@gutov.dev> <86msw9g5yb.fsf@mail.linkov.net> <56909bdd-14ee-f68c-178f-5057efcd6150@gutov.dev> <86wmva7iey.fsf@mail.linkov.net> <86bkckwnf8.fsf@mail.linkov.net> <86h6mag077.fsf@mail.linkov.net> <86v8akoyve.fsf@mail.linkov.net> <86sf5lxyow.fsf@mail.linkov.net> <86r0l3crbq.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86r0l3crbq.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 63648-done Cc: Spencer Baugh , 63648-done@debbugs.gnu.org, sbaugh@catern.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 06/11/2023 09:16, Juri Linkov wrote: >>> I proposed a new option project-switch-use-global-map. >> >> I didn't know how the reconcile the existence of both >> project-switch-use-entire-map and project-switch-use-global-map. Saying in >> both docstrings that one takes priority over the other (and possibly >> repeating that in the doc for project-switch-commands) would be awkward. > > Then another variant would be to allow a new value 'global' > in the existing 'project-switch-use-entire-map'. Ah indeed. That could also look sensible. >>> But when project-switch-commands should be customized instead of new option, >>> then I'd prefer to use function names like `project-prefix-or-any-command' >>> instead of symbols `short-or-any' and `short-keys'. >>> >>>> Unifying all three alternatives in one option seems like the logical choice. >>> To avoid obsoleting `project-switch-use-entire-map', `short-keys' >>> could be removed. Then `short-or-any' could be replaced by >>> `project-prefix-or-any-command'. This will introduce minimal changes. >> >> All right, that sounds like a mix between v4 and v5. >> >> I've pushed 41e801fea1c to master, please take a look. > > Thanks, I tested and it works great. > >> In the future, perhaps we'd want to obsolete the option >> project-switch-use-entire-map anyway, replacing it with a separate command >> to be used in the same way as the newly-added one. But for now the change >> is maximally backward-compatible. > > Indeed, this is the safest change for now. More changes either will > bring trouble to users requiring to migrate from the obsolete variable, > or will make code more complicated. I guess it's time to close this bug? Thank you all for participation, and thanks for testing. From unknown Sun Jun 22 22:42:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Dec 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator