Subject: 31.0.50; Feature Request: Make the project switch message customizable or optional

From: Rahul Juliato <[email-masked]>
Date: Wed, 9 Apr 2025 20:52:27 -0300

Thank you for your continued work on =project.el=.

I’d like to suggest a small usability improvement related to commit
[[https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=86e17fbcbddb57b0653b7046202e54624c477836][86e17fbcbddb]],
which modified the prompt shown when invoking =project-switch-project=:

#+begin_src emacs-lisp
(setq choice (read-key-sequence (concat
  (if dir
      (format-message "Command in `%s': "
                      (propertize dir 'face 'font-lock-string-face))
    "Command: ")
  prompt)))
#+end_src

=project-switch-project=. Specifically, this part:

#+begin_src emacs-lisp
(setq choice (read-key-sequence (concat
  (if dir
      (format-message "Command in `%s': "
                      (propertize dir 'face 'font-lock-string-face))
    "Command: ")
  prompt)))
#+end_src

While I appreciate the intention of giving more context by showing the
current project path, in practice, the dynamic length of this path
shifts the position of the command hints in the minibuffer. This causes
a jarring and inconsistent experience every time I switch projects. This
happens especially for projects with longer paths, where the options
appear far to the right or wrapped in a new line at some random
position.

Would it be possible to make this message:
- Optional via a user-facing variable, or
- Customizable (e.g., via a custom formatting function or hook)?

I think this would provide a more stable and predictable UI, while still
preserving the enhanced context for users who want it.

Thanks again for your time and consideration!

Best regards,  
Rahul Martim Juliato

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.4.0, NS
appkit-2575.50 Version 15.4 (Build 24E248)) of 2025-04-09 built on
MacBook-Pro.local
Repository revision: 686032ddaf31cacae9a6cd963d9fcbc85ba3905a
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.4

Configured using:
'configure --with-mailutils --with-imagemagick --with-ns'

Configured features:
ACL GNUTLS IMAGEMAGICK LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER
PNG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP ZLIB

Important settings:
  value of $LANG: pt_BR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  display-line-numbers-mode: t
  flymake-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  electric-pair-mode: t
  which-key-mode: t
  minibuffer-electric-default-mode: t
  minibuffer-depth-indicate-mode: t
  xterm-mouse-mode: t
  winner-mode: t
  save-place-mode: t
  savehist-mode: t
  repeat-mode: t
  recentf-mode: t
  global-auto-revert-mode: t
  pixel-scroll-precision-mode: t
  delete-selection-mode: t
  override-global-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug qp utf-7 reveal misearch multi-isearch
dired-aux dired-x epa-file network-stream nsm gnus-ml gnus-topic nndraft
nnmh nnmaildir whitespace nnnil gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime gnutls dig nntp gnus-cache 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 message sendmail yank-media puny dired dired-loaddefs rfc822
mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
gmm-utils mailheader gnus-win .gnus noutline outline vc-git files-x
vc-dispatcher bookmark cursor-sensor display-line-numbers eglot
external-completion jsonrpc xref diff diff-mode track-changes ert ewoc
debug backtrace find-func pcase imenu checkdoc lisp-mnt flymake project
thingatpt private icomplete elec-pair which-key init rx finder-inf
package browse-url xdg 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 url-vars modus-vivendi-tinted-theme modus-themes
minibuf-eldef mb-depth gnus nnheader gnus-util mail-utils range mm-util
mail-prsvr rcirc parse-time iso8601 auth-source eieio eieio-core
password-cache json map time-date disp-table time xt-mouse winner
cus-edit pp saveplace savehist repeat warnings icons recentf tree-widget
wid-edit autorevert filenotify grep compile text-property-search comint
ansi-osc ansi-color pixel-scroll cua-base ring subr-x delsel cus-load
edmacro kmacro byte-opt cl-macs gv cl-extra help-mode
use-package-bind-key bind-key easy-mmode use-package-ensure cl-seq
use-package-core cl-loaddefs cl-lib bytecomp byte-compile early-init rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win 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 kqueue cocoa ns lcms2
multi-tty make-network-process tty-child-frames emacs)

Memory information:
((conses 16 311490 849047) (symbols 48 26051 333)
(strings 32 71441 29650) (string-bytes 1 2018323) (vectors 16 41663)
(vector-slots 8 394879 255642) (floats 8 315 9159)
(intervals 56 1605 904) (buffers 992 25))