unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54281: 29.0.50; project-try-vc not return the root
@ 2022-03-07  4:41 Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-03-07  5:05 ` bug#54282: " Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-03-07  4:41 UTC (permalink / raw)
  To: 54281

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






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

* bug#54282: 29.0.50; project-try-vc not return the root
  2022-03-07  4:41 bug#54281: 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  5:05 ` Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-03-07 14:42   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-03-07  5:05 UTC (permalink / raw)
  To: 54282

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

My fault. Please ignore it.




------------------ Original ------------------
Date: Mon,Mar 7,2022 0:41 PM
To: bug-gnu-emacs <bug-gnu-emacs@gnu.org&gt;
Subject: Re: 29.0.50; project-try-vc not return the root



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
&nbsp;backend implementation of `project-external-roots'.")
&nbsp;
&nbsp;(defun project-try-vc (dir)
-&nbsp; (or (vc-file-getprop dir 'project-vc)
+&nbsp; (and (vc-file-getprop dir 'project-vc)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let* ((backend (ignore-errors (vc-responsible-backend dir)))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (root
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (pcase backend
```

Best Regards,
Shuguang Sun



In GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32)
&nbsp;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:
&nbsp;'configure --without-pop --with-native-image-api
&nbsp;--with-native-compilation --without-compress-install
&nbsp;'--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:
&nbsp; value of $LANG: CHS
&nbsp; locale-coding-system: cp936

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

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

* bug#54282: 29.0.50; project-try-vc not return the root
  2022-03-07  5:05 ` bug#54282: " Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-03-07 14:42   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-07 14:42 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: 54282

"Shuguang Sun" <shuguang79@qq.com> writes:

> My fault. Please ignore it.

OK; I'm closing this bug report, then.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2022-03-07 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07  4:41 bug#54281: 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  5:05 ` bug#54282: " Shuguang Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-07 14:42   ` Lars Ingebrigtsen

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).