all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: "Óscar Fuentes" <oscarfv@telefonica.net>, 74826@debbugs.gnu.org
Subject: bug#74826: 30.0.50; project-buffers not consistent with project-files
Date: Fri, 13 Dec 2024 05:46:32 +0200	[thread overview]
Message-ID: <b2f8495c-7bd6-40e1-853a-619bcc9d9f33@gutov.dev> (raw)
In-Reply-To: <87ldwlxfr4.fsf@telefonica.net>

Hi! Thanks for the report.

On 12/12/2024 14:11, Óscar Fuentes wrote:
> On a git repo there are several projects.
> `project-vc-extra-root-markers` is used to differentiate them.
> 
> (setopt project-vc-extra-root-markers (list "client.lp0" "pubspec.yaml"))
> 
> Although there are no submodules for now, I also have this setting:
> 
> (setopt project-vc-merge-submodules nil)
> 
> Evaluating the following expression while on a buffer that is visiting
> any given file of those projects:
> 
> (project-files (project-current))
> 
> gives the list of files of the project.
> 
> However, evaluating this fails:
> 
> (project-buffers (project-current))

This change should fix that.

Not sure if it should go to emacs-30 (this bug is there since 2022) - 
but happy to install it there if approved.

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 2b0d508cc66..59a8832711a 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -858,7 +858,9 @@ project--value-in-dir
  (cl-defmethod project-buffers ((project (head vc)))
    (let* ((root (expand-file-name (file-name-as-directory (project-root 
project))))
           (modules (unless (or (project--vc-merge-submodules-p root)
-                              (project--submodule-p root))
+                              (condition-case nil
+                                  (project--submodule-p root)
+                                (file-missing nil)))
                      (mapcar
                       (lambda (m) (format "%s%s/" root m))
                       (project--git-submodules))))






  reply	other threads:[~2024-12-13  3:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 12:11 bug#74826: 30.0.50; project-buffers not consistent with project-files Óscar Fuentes
2024-12-13  3:46 ` Dmitry Gutov [this message]
2024-12-14 11:00   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2f8495c-7bd6-40e1-853a-619bcc9d9f33@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=74826@debbugs.gnu.org \
    --cc=oscarfv@telefonica.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.