unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Shuguang Sun via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 54281@debbugs.gnu.org
Subject: bug#54281: 29.0.50; project-try-vc not return the root
Date: Mon, 07 Mar 2022 12:41:11 +0800	[thread overview]
Message-ID: <tencent_3FF3710E6539010F984AD1FDF20B9C7FAC0A@qq.com> (raw)

Hi all,

The `project-current' and `project-try-vc' can't return the root but
just a list of `(vc Git)'. It is found that an `and' should be used in
the function `project-try-vc' instead of `or'.

The patch below fixs it.

```
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index daaf86f327..e8bd203979 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -418,7 +418,7 @@ project-vc-external-roots-function
 backend implementation of `project-external-roots'.")
 
 (defun project-try-vc (dir)
-  (or (vc-file-getprop dir 'project-vc)
+  (and (vc-file-getprop dir 'project-vc)
       (let* ((backend (ignore-errors (vc-responsible-backend dir)))
              (root
               (pcase backend
```

Best Regards,
Shuguang Sun



In GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32)
 of 2022-03-07 built on 
Repository revision: 36b31d38cd9bde7ad1ec18c136854cddba0d6bbe
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Pro (v10.0.2009.19044.1526)

Configured using:
 'configure --without-pop --with-native-image-api
 --with-native-compilation --without-compress-install
 '--program-transform-name=s/^ctags$/ctags.emacs/''

Configured features:
ACL DBUS GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP XPM ZLIB

Important settings:
  value of $LANG: CHS
  locale-coding-system: cp936






             reply	other threads:[~2022-03-07  4:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07  4:41 Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-03-07  5:05 ` bug#54282: 29.0.50; project-try-vc not return the root Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-07 14:42   ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=tencent_3FF3710E6539010F984AD1FDF20B9C7FAC0A@qq.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=54281@debbugs.gnu.org \
    --cc=shuguang79@qq.com \
    /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 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).