unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
@ 2023-04-20 18:37 Spencer Baugh
  2023-04-20 18:55 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Spencer Baugh @ 2023-04-20 18:37 UTC (permalink / raw)
  To: 62974


1. emacs -Q (in a directory not in a project)
2. Note current default-directory: some/dir
3. C-x p b (so that it will prompt for a project)
4. Select some project and RET
5. Enter a nonexisting buffer name and RET
6. The new buffer's default-directory is some/dir

Expected behavior:
6. The new buffer's default-directory is the project root of the project
you picked.

Ideally we'd fix this by just wrapping switch-to-buffer in
(let ((default-directory (project-root pr))) ...)

But that's non-trivial because pr is computed by prompting the user, and
that prompt takes place in project--read-project-buffer, which is in the
interactive spec of project-switch-to-buffer.


In GNU Emacs 29.0.60 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2023-03-13 built on
 igm-qws-u22796a
Repository revision: e759905d2e0828eac4c8164b09113b40f6899656
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-modules
 --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: Dired by name

Minor modes in effect:
  jane-fe-minor-mode: t
  editorconfig-mode: t
  dired-omit-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/jane/vc-fe hides /home/sbaugh/.local/src/emacs29/lisp/vc/vc-fe
/usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/csharp-mode hides /home/sbaugh/.local/src/emacs29/lisp/progmodes/csharp-mode
/usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/eldoc hides /home/sbaugh/.local/src/emacs29/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/.local/src/emacs29/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/.local/src/emacs29/lisp/org/org-version hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-version
/home/sbaugh/.local/src/emacs29/lisp/org/org-loaddefs hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-loaddefs
/home/sbaugh/.local/src/emacs29/lisp/org/org-keys hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-keys
/home/sbaugh/.local/src/emacs29/lisp/org/ol hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol
/home/sbaugh/.local/src/emacs29/lisp/org/ob-perl hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-perl
/home/sbaugh/.local/src/emacs29/lisp/org/ob-core hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-core
/home/sbaugh/.local/src/emacs29/lisp/org/ox hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox
/home/sbaugh/.local/src/emacs29/lisp/org/ol-rmail hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-rmail
/home/sbaugh/.local/src/emacs29/lisp/org/ob-octave hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-octave
/home/sbaugh/.local/src/emacs29/lisp/org/ob-comint hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-comint
/home/sbaugh/.local/src/emacs29/lisp/org/ol-w3m hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-w3m
/home/sbaugh/.local/src/emacs29/lisp/org/ob-org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-org
/home/sbaugh/.local/src/emacs29/lisp/org/ox-texinfo hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-texinfo
/home/sbaugh/.local/src/emacs29/lisp/org/org-inlinetask hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-inlinetask
/home/sbaugh/.local/src/emacs29/lisp/org/ol-mhe hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-mhe
/home/sbaugh/.local/src/emacs29/lisp/org/ob-ocaml hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ocaml
/home/sbaugh/.local/src/emacs29/lisp/org/ob-clojure hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-clojure
/home/sbaugh/.local/src/emacs29/lisp/org/ox-publish hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-publish
/home/sbaugh/.local/src/emacs29/lisp/org/ol-irc hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-irc
/home/sbaugh/.local/src/emacs29/lisp/org/ob-calc hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-calc
/home/sbaugh/.local/src/emacs29/lisp/org/ox-odt hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-odt
/home/sbaugh/.local/src/emacs29/lisp/org/org-id hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-id
/home/sbaugh/.local/src/emacs29/lisp/org/ol-gnus hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-gnus
/home/sbaugh/.local/src/emacs29/lisp/org/ob-matlab hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-matlab
/home/sbaugh/.local/src/emacs29/lisp/org/ox-icalendar hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-icalendar
/home/sbaugh/.local/src/emacs29/lisp/org/org-footnote hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-footnote
/home/sbaugh/.local/src/emacs29/lisp/org/ol-bibtex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-bibtex
/home/sbaugh/.local/src/emacs29/lisp/org/ob-lisp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lisp
/home/sbaugh/.local/src/emacs29/lisp/org/ob-C hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-C
/home/sbaugh/.local/src/emacs29/lisp/org/ox-org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-org
/home/sbaugh/.local/src/emacs29/lisp/org/org-indent hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-indent
/home/sbaugh/.local/src/emacs29/lisp/org/ol-info hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-info
/home/sbaugh/.local/src/emacs29/lisp/org/ob-maxima hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-maxima
/home/sbaugh/.local/src/emacs29/lisp/org/ob-awk hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-awk
/home/sbaugh/.local/src/emacs29/lisp/org/ox-man hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-man
/home/sbaugh/.local/src/emacs29/lisp/org/org-goto hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-goto
/home/sbaugh/.local/src/emacs29/lisp/org/ox-md hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-md
/home/sbaugh/.local/src/emacs29/lisp/org/ol-eshell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-eshell
/home/sbaugh/.local/src/emacs29/lisp/org/ob-lua hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lua
/home/sbaugh/.local/src/emacs29/lisp/org/org-habit hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-habit
/home/sbaugh/.local/src/emacs29/lisp/org/ob-R hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-R
/home/sbaugh/.local/src/emacs29/lisp/org/ol-eww hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-eww
/home/sbaugh/.local/src/emacs29/lisp/org/ob-makefile hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-makefile
/home/sbaugh/.local/src/emacs29/lisp/org/ox-latex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-latex
/home/sbaugh/.local/src/emacs29/lisp/org/ol-docview hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-docview
/home/sbaugh/.local/src/emacs29/lisp/org/ob-lob hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lob
/home/sbaugh/.local/src/emacs29/lisp/org/ox-beamer hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-beamer
/home/sbaugh/.local/src/emacs29/lisp/org/org-faces hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-faces
/home/sbaugh/.local/src/emacs29/lisp/org/ob hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob
/home/sbaugh/.local/src/emacs29/lisp/org/ox-html hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-html
/home/sbaugh/.local/src/emacs29/lisp/org/org-feed hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-feed
/home/sbaugh/.local/src/emacs29/lisp/org/ol-bbdb hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-bbdb
/home/sbaugh/.local/src/emacs29/lisp/org/ob-lilypond hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lilypond
/home/sbaugh/.local/src/emacs29/lisp/org/ox-ascii hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-ascii
/home/sbaugh/.local/src/emacs29/lisp/org/ob-latex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-latex
/home/sbaugh/.local/src/emacs29/lisp/org/org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org
/home/sbaugh/.local/src/emacs29/lisp/org/ob-tangle hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-tangle
/home/sbaugh/.local/src/emacs29/lisp/org/org-tempo hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-tempo
/home/sbaugh/.local/src/emacs29/lisp/org/org-duration hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-duration
/home/sbaugh/.local/src/emacs29/lisp/org/ob-sqlite hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sqlite
/home/sbaugh/.local/src/emacs29/lisp/org/org-entities hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-entities
/home/sbaugh/.local/src/emacs29/lisp/org/ob-table hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-table
/home/sbaugh/.local/src/emacs29/lisp/org/ob-js hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-js
/home/sbaugh/.local/src/emacs29/lisp/org/org-table hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-table
/home/sbaugh/.local/src/emacs29/lisp/org/ob-sql hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sql
/home/sbaugh/.local/src/emacs29/lisp/org/org-timer hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-timer
/home/sbaugh/.local/src/emacs29/lisp/org/org-element hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-element
/home/sbaugh/.local/src/emacs29/lisp/org/ob-java hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-java
/home/sbaugh/.local/src/emacs29/lisp/org/org-ctags hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-ctags
/home/sbaugh/.local/src/emacs29/lisp/org/ob-shell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-shell
/home/sbaugh/.local/src/emacs29/lisp/org/ob-groovy hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-groovy
/home/sbaugh/.local/src/emacs29/lisp/org/org-src hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-src
/home/sbaugh/.local/src/emacs29/lisp/org/org-datetree hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-datetree
/home/sbaugh/.local/src/emacs29/lisp/org/ob-haskell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-haskell
/home/sbaugh/.local/src/emacs29/lisp/org/org-plot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-plot
/home/sbaugh/.local/src/emacs29/lisp/org/org-compat hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-compat
/home/sbaugh/.local/src/emacs29/lisp/org/ob-screen hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-screen
/home/sbaugh/.local/src/emacs29/lisp/org/ob-fortran hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-fortran
/home/sbaugh/.local/src/emacs29/lisp/org/org-protocol hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-protocol
/home/sbaugh/.local/src/emacs29/lisp/org/org-crypt hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-crypt
/home/sbaugh/.local/src/emacs29/lisp/org/ob-sed hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sed
/home/sbaugh/.local/src/emacs29/lisp/org/ob-gnuplot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-gnuplot
/home/sbaugh/.local/src/emacs29/lisp/org/org-pcomplete hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-pcomplete
/home/sbaugh/.local/src/emacs29/lisp/org/org-colview hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-colview
/home/sbaugh/.local/src/emacs29/lisp/org/ob-scheme hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-scheme
/home/sbaugh/.local/src/emacs29/lisp/org/ob-forth hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-forth
/home/sbaugh/.local/src/emacs29/lisp/org/org-num hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-num
/home/sbaugh/.local/src/emacs29/lisp/org/org-clock hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-clock
/home/sbaugh/.local/src/emacs29/lisp/org/ob-exp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-exp
/home/sbaugh/.local/src/emacs29/lisp/org/org-mouse hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-mouse
/home/sbaugh/.local/src/emacs29/lisp/org/org-capture hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-capture
/home/sbaugh/.local/src/emacs29/lisp/org/ob-sass hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sass
/home/sbaugh/.local/src/emacs29/lisp/org/ob-eval hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-eval
/home/sbaugh/.local/src/emacs29/lisp/org/ob-ref hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ref
/home/sbaugh/.local/src/emacs29/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/.local/src/emacs29/lisp/org/org-mobile hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-mobile
/home/sbaugh/.local/src/emacs29/lisp/org/ob-ruby hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ruby
/home/sbaugh/.local/src/emacs29/lisp/org/ob-eshell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-eshell
/home/sbaugh/.local/src/emacs29/lisp/org/org-lint hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-lint
/home/sbaugh/.local/src/emacs29/lisp/org/org-agenda hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-agenda
/home/sbaugh/.local/src/emacs29/lisp/org/org-macro hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-macro
/home/sbaugh/.local/src/emacs29/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/.local/src/emacs29/lisp/org/ob-processing hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-processing
/home/sbaugh/.local/src/emacs29/lisp/org/ob-css hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-css
/home/sbaugh/.local/src/emacs29/lisp/org/ob-dot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-dot
/home/sbaugh/.local/src/emacs29/lisp/org/org-list hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-list
/home/sbaugh/.local/src/emacs29/lisp/org/org-macs hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-macs
/home/sbaugh/.local/src/emacs29/lisp/org/org-attach hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-attach
/home/sbaugh/.local/src/emacs29/lisp/org/org-archive hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-archive
/home/sbaugh/.local/src/emacs29/lisp/org/ob-python hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-python
/home/sbaugh/.local/src/emacs29/lisp/org/ob-plantuml hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-plantuml
/home/sbaugh/.local/src/emacs29/lisp/org/ob-ditaa hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ditaa
/home/sbaugh/.local/src/emacs29/lisp/org/ob-julia hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ob-julia
/home/sbaugh/.local/src/emacs29/lisp/org/ol-man hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ol-man
/home/sbaugh/.local/src/emacs29/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 dired-aux emacsbug gnus-cus gnus-demon gnus-diary nndiary
gnus-draft nndraft nnmh gnus-fun gnus-html gnus-kill gnus-logic gnus-mh
mh-comp mh-scan mh-gnus mh-e mh-buffers mh-loaddefs gnus-registry
registry eieio-base rmailsum rmail gnus-salt gnus-topic gnus-uu yenc
gnus-vm erc-pcomplete erc-goodies erc erc-backend erc-networks
erc-common erc-compat erc-loaddefs pulse dabbrev mule-util info-look
completion ediff-ptch ediff ediff-vers ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util cal-iso org-datetree
org-capture tabify cus-edit cus-start cus-load cl-print magit-imenu
git-rebase face-remap vc-annotate vc-filewise misc bug-reference smiley
gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize
uni-confusable textsec-check gnus-async gnus-bcklg gnus-agent gnus-srvr
gnus-score score-mode nnvirtual nntp gnus-ml gnus-msg disp-table nndoc
gnus-cache gnus-dup mm-archive url-http-ntlm ntlm hmac-md5 hex-util md4
network-stream url-cache debbugs-gnu debbugs-compat debbugs soap-client
url-http url-gw nsm rng-xsd rng-dt rng-util xsd-regexp man hl-line
display-line-numbers vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs
log-view misearch multi-isearch 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 wid-edit ol-docview doc-view
jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi
org-link-doi shortdoc help-fns radix-tree sort vc-fe grep find-dired
sh-script treesit executable goto-addr vc-hg vc-dir vc vc-dispatcher
tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time
iso8601 ls-lisp jane-project jane-merlin merlin-imenu merlin-xref xref
merlin-cap merlin jane-async-merlin jane-completion jane-common
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 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 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 ffap
thingatpt vundo pcase cyberpunk-theme savehist saveplace vundo-autoloads
magit-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 1061524 113123)
 (symbols 48 53622 0)
 (strings 32 219754 17365)
 (string-bytes 1 7415730)
 (vectors 16 117255)
 (vector-slots 8 2225755 176556)
 (floats 8 860 460)
 (intervals 56 41821 130)
 (buffers 976 117)
 (heap 1024 723493 153052))





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-20 18:37 bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project Spencer Baugh
@ 2023-04-20 18:55 ` Eli Zaretskii
  2023-04-20 23:55   ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2023-04-20 18:55 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: 62974

> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Thu, 20 Apr 2023 14:37:26 -0400
> 
> 
> 1. emacs -Q (in a directory not in a project)
> 2. Note current default-directory: some/dir
> 3. C-x p b (so that it will prompt for a project)
> 4. Select some project and RET
> 5. Enter a nonexisting buffer name and RET
> 6. The new buffer's default-directory is some/dir
> 
> Expected behavior:
> 6. The new buffer's default-directory is the project root of the project
> you picked.

??Really?  project.el changes the way Emacs creates new buffers?  Is
there a reason for such a deviation (if indeed there is a deviation)?
Because otherwise my expectation would exactly what you see, because
"C-x b" behaves like that.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-20 18:55 ` Eli Zaretskii
@ 2023-04-20 23:55   ` Dmitry Gutov
  2023-04-21  5:43     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2023-04-20 23:55 UTC (permalink / raw)
  To: Eli Zaretskii, Spencer Baugh; +Cc: 62974

On 20/04/2023 21:55, Eli Zaretskii wrote:
>> From: Spencer Baugh<sbaugh@janestreet.com>
>> Date: Thu, 20 Apr 2023 14:37:26 -0400
>>
>>
>> 1. emacs -Q (in a directory not in a project)
>> 2. Note current default-directory: some/dir
>> 3. C-x p b (so that it will prompt for a project)
>> 4. Select some project and RET
>> 5. Enter a nonexisting buffer name and RET
>> 6. The new buffer's default-directory is some/dir
>>
>> Expected behavior:
>> 6. The new buffer's default-directory is the project root of the project
>> you picked.
> ??Really?  project.el changes the way Emacs creates new buffers?  Is
> there a reason for such a deviation (if indeed there is a deviation)?
> Because otherwise my expectation would exactly what you see, because
> "C-x b" behaves like that.

Perhaps the idea is that the newly created buffer will be considered as 
belonging to the project right away?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-20 23:55   ` Dmitry Gutov
@ 2023-04-21  5:43     ` Eli Zaretskii
  2023-04-21 11:46       ` Spencer Baugh
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2023-04-21  5:43 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: sbaugh, 62974

> Date: Fri, 21 Apr 2023 02:55:47 +0300
> Cc: 62974@debbugs.gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
> 
> On 20/04/2023 21:55, Eli Zaretskii wrote:
> >> From: Spencer Baugh<sbaugh@janestreet.com>
> >> Date: Thu, 20 Apr 2023 14:37:26 -0400
> >>
> >>
> >> 1. emacs -Q (in a directory not in a project)
> >> 2. Note current default-directory: some/dir
> >> 3. C-x p b (so that it will prompt for a project)
> >> 4. Select some project and RET
> >> 5. Enter a nonexisting buffer name and RET
> >> 6. The new buffer's default-directory is some/dir
> >>
> >> Expected behavior:
> >> 6. The new buffer's default-directory is the project root of the project
> >> you picked.
> > ??Really?  project.el changes the way Emacs creates new buffers?  Is
> > there a reason for such a deviation (if indeed there is a deviation)?
> > Because otherwise my expectation would exactly what you see, because
> > "C-x b" behaves like that.
> 
> Perhaps the idea is that the newly created buffer will be considered as 
> belonging to the project right away?

But if it is in a subdirectory of the root, it also belongs to the
project, doesn't it?  Exactly like the buffer from which this command
is invoked, whose default-directory was a subdirectory of the root.
No?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-21  5:43     ` Eli Zaretskii
@ 2023-04-21 11:46       ` Spencer Baugh
  2023-04-21 12:00         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Spencer Baugh @ 2023-04-21 11:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Dmitry Gutov, 62974

[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]

On Fri, Apr 21, 2023, 01:43 Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Fri, 21 Apr 2023 02:55:47 +0300
> > Cc: 62974@debbugs.gnu.org
> > From: Dmitry Gutov <dmitry@gutov.dev>
> >
> > On 20/04/2023 21:55, Eli Zaretskii wrote:
> > >> From: Spencer Baugh<sbaugh@janestreet.com>
> > >> Date: Thu, 20 Apr 2023 14:37:26 -0400
> > >>
> > >>
> > >> 1. emacs -Q (in a directory not in a project)
> > >> 2. Note current default-directory: some/dir
> > >> 3. C-x p b (so that it will prompt for a project)
> > >> 4. Select some project and RET
> > >> 5. Enter a nonexisting buffer name and RET
> > >> 6. The new buffer's default-directory is some/dir
> > >>
> > >> Expected behavior:
> > >> 6. The new buffer's default-directory is the project root of the
> project
> > >> you picked.
> > > ??Really?  project.el changes the way Emacs creates new buffers?  Is
> > > there a reason for such a deviation (if indeed there is a deviation)?
> > > Because otherwise my expectation would exactly what you see, because
> > > "C-x b" behaves like that.
> >
> > Perhaps the idea is that the newly created buffer will be considered as
> > belonging to the project right away?
>
> But if it is in a subdirectory of the root, it also belongs to the
> project, doesn't it?  Exactly like the buffer from which this command
> is invoked, whose default-directory was a subdirectory of the root.
> No?
>

That's fine, I wouldn't want to change that behavior, the behavior I'd want
to change is when invoking the command from a buffer which is not in a
project, or by invoking it after C-x p p to switch projects.

>

[-- Attachment #2: Type: text/html, Size: 2604 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-21 11:46       ` Spencer Baugh
@ 2023-04-21 12:00         ` Eli Zaretskii
  2023-04-21 13:17           ` sbaugh
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2023-04-21 12:00 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: dmitry, 62974

> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Fri, 21 Apr 2023 07:46:14 -0400
> Cc: Dmitry Gutov <dmitry@gutov.dev>, 62974@debbugs.gnu.org
> 
>  But if it is in a subdirectory of the root, it also belongs to the
>  project, doesn't it?  Exactly like the buffer from which this command
>  is invoked, whose default-directory was a subdirectory of the root.
>  No?
> 
> That's fine, I wouldn't want to change that behavior, the behavior I'd want to change is when invoking
> the command from a buffer which is not in a project, or by invoking it after C-x p p to switch projects.

The recipe you posted didn't include "C-x p p", though.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-21 12:00         ` Eli Zaretskii
@ 2023-04-21 13:17           ` sbaugh
  2023-04-21 15:56             ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: sbaugh @ 2023-04-21 13:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Spencer Baugh, 62974, dmitry

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Spencer Baugh <sbaugh@janestreet.com>
>> Date: Fri, 21 Apr 2023 07:46:14 -0400
>> Cc: Dmitry Gutov <dmitry@gutov.dev>, 62974@debbugs.gnu.org
>> 
>>  But if it is in a subdirectory of the root, it also belongs to the
>>  project, doesn't it?  Exactly like the buffer from which this command
>>  is invoked, whose default-directory was a subdirectory of the root.
>>  No?
>> 
>> That's fine, I wouldn't want to change that behavior, the behavior I'd want to change is when invoking
>> the command from a buffer which is not in a project, or by invoking it after C-x p p to switch projects.
>
> The recipe you posted didn't include "C-x p p", though.

My recipe was an example of "command from a buffer which is not in a
project".  Here's a recipe for the issue using C-x p p:

1. (setq project-switch-use-entire-map t)
2. Be in a buffer in project A
3. C-x p p b to switch to project B and select a buffer in project B
4. Type a buffer name which doesn't exist
5. The resulting buffer is in project A, not B





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-21 13:17           ` sbaugh
@ 2023-04-21 15:56             ` Dmitry Gutov
  2023-04-21 16:25               ` Spencer Baugh
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2023-04-21 15:56 UTC (permalink / raw)
  To: sbaugh, Eli Zaretskii; +Cc: Spencer Baugh, 62974

On 21/04/2023 16:17, sbaugh@catern.com wrote:
> Eli Zaretskii<eliz@gnu.org>  writes:
>>> From: Spencer Baugh<sbaugh@janestreet.com>
>>> Date: Fri, 21 Apr 2023 07:46:14 -0400
>>> Cc: Dmitry Gutov<dmitry@gutov.dev>,62974@debbugs.gnu.org
>>>
>>>   But if it is in a subdirectory of the root, it also belongs to the
>>>   project, doesn't it?  Exactly like the buffer from which this command
>>>   is invoked, whose default-directory was a subdirectory of the root.
>>>   No?
>>>
>>> That's fine, I wouldn't want to change that behavior, the behavior I'd want to change is when invoking
>>> the command from a buffer which is not in a project, or by invoking it after C-x p p to switch projects.
>> The recipe you posted didn't include "C-x p p", though.
> My recipe was an example of "command from a buffer which is not in a
> project".  Here's a recipe for the issue using C-x p p:
> 
> 1. (setq project-switch-use-entire-map t)
> 2. Be in a buffer in project A
> 3. C-x p p b to switch to project B and select a buffer in project B
> 4. Type a buffer name which doesn't exist
> 5. The resulting buffer is in project A, not B

Thanks.

How does this look?

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index a18b918db62..94c7f8f547a 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1314,13 +1314,17 @@ project--read-project-buffer
              (and (memq (cdr buffer) buffers)
                   (not
                    (project--buffer-check
-                   (cdr buffer) project-ignore-buffer-conditions))))))
-    (read-buffer
-     "Switch to buffer: "
-     (when (funcall predicate (cons other-name other-buffer))
-       other-name)
-     nil
-     predicate)))
+                   (cdr buffer) project-ignore-buffer-conditions)))))
+         (buffer (read-buffer
+                  "Switch to buffer: "
+                  (when (funcall predicate (cons other-name other-buffer))
+                    other-name)
+                  nil
+                  predicate)))
+    (if (get-buffer buffer)
+        buffer
+      (let ((default-directory (project-root pr)))
+        (get-buffer-create buffer)))))

  ;;;###autoload
  (defun project-switch-to-buffer (buffer-or-name)






^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-21 15:56             ` Dmitry Gutov
@ 2023-04-21 16:25               ` Spencer Baugh
  2023-04-21 23:31                 ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: Spencer Baugh @ 2023-04-21 16:25 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 62974

Dmitry Gutov <dmitry@gutov.dev> writes:
> On 21/04/2023 16:17, sbaugh@catern.com wrote:
>> Eli Zaretskii<eliz@gnu.org>  writes:
>>>> From: Spencer Baugh<sbaugh@janestreet.com>
>>>> Date: Fri, 21 Apr 2023 07:46:14 -0400
>>>> Cc: Dmitry Gutov<dmitry@gutov.dev>,62974@debbugs.gnu.org
>>>>
>>>>   But if it is in a subdirectory of the root, it also belongs to the
>>>>   project, doesn't it?  Exactly like the buffer from which this command
>>>>   is invoked, whose default-directory was a subdirectory of the root.
>>>>   No?
>>>>
>>>> That's fine, I wouldn't want to change that behavior, the behavior I'd want to change is when invoking
>>>> the command from a buffer which is not in a project, or by invoking it after C-x p p to switch projects.
>>> The recipe you posted didn't include "C-x p p", though.
>> My recipe was an example of "command from a buffer which is not in a
>> project".  Here's a recipe for the issue using C-x p p:
>> 1. (setq project-switch-use-entire-map t)
>> 2. Be in a buffer in project A
>> 3. C-x p p b to switch to project B and select a buffer in project B
>> 4. Type a buffer name which doesn't exist
>> 5. The resulting buffer is in project A, not B
>
> Thanks.
>
> How does this look?
>
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index a18b918db62..94c7f8f547a 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -1314,13 +1314,17 @@ project--read-project-buffer
>              (and (memq (cdr buffer) buffers)
>                   (not
>                    (project--buffer-check
> -                   (cdr buffer) project-ignore-buffer-conditions))))))
> -    (read-buffer
> -     "Switch to buffer: "
> -     (when (funcall predicate (cons other-name other-buffer))
> -       other-name)
> -     nil
> -     predicate)))
> +                   (cdr buffer) project-ignore-buffer-conditions)))))
> +         (buffer (read-buffer
> +                  "Switch to buffer: "
> +                  (when (funcall predicate (cons other-name other-buffer))
> +                    other-name)
> +                  nil
> +                  predicate)))
> +    (if (get-buffer buffer)
> +        buffer
> +      (let ((default-directory (project-root pr)))
> +        (get-buffer-create buffer)))))
>
>  ;;;###autoload
>  (defun project-switch-to-buffer (buffer-or-name)

That looks good and it fixes all the bug cases I mentioned.

But what about the case where the old buffer was already in the project?

1. In a buffer visiting project-a/some/dir/file.el
2. C-x p b nonexisting-buffer RET

Existing behavior, and possibly desirable behavior:
3. default-directory in new buffer: project-a/some/dir/

With your change:
3. default-directory in new buffer: project-a/






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project
  2023-04-21 16:25               ` Spencer Baugh
@ 2023-04-21 23:31                 ` Dmitry Gutov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2023-04-21 23:31 UTC (permalink / raw)
  To: Spencer Baugh; +Cc: sbaugh, Eli Zaretskii, 62974-done

Version: 30.1

On 21/04/2023 19:25, Spencer Baugh wrote:
> That looks good and it fixes all the bug cases I mentioned.
> 
> But what about the case where the old buffer was already in the project?
> 
> 1. In a buffer visiting project-a/some/dir/file.el
> 2. C-x p b nonexisting-buffer RET
> 
> Existing behavior, and possibly desirable behavior:
> 3. default-directory in new buffer: project-a/some/dir/
> 
> With your change:
> 3. default-directory in new buffer: project-a/

Yeah, okay, I added a special check for that too.

Pushed to master, commit 4f3dae2b0d5.

Closing, but let us know if something is still amiss.





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-04-21 23:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-20 18:37 bug#62974: 29.0.60; New buffers created with project-switch-to-buffer aren't in the project Spencer Baugh
2023-04-20 18:55 ` Eli Zaretskii
2023-04-20 23:55   ` Dmitry Gutov
2023-04-21  5:43     ` Eli Zaretskii
2023-04-21 11:46       ` Spencer Baugh
2023-04-21 12:00         ` Eli Zaretskii
2023-04-21 13:17           ` sbaugh
2023-04-21 15:56             ` Dmitry Gutov
2023-04-21 16:25               ` Spencer Baugh
2023-04-21 23:31                 ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).