GNU bug report logs - #37182
24.5; 24.5.1: C-u vc-dir-mark-all-files should not mark directories

Previous Next

Package: emacs;

Reported by: Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>

Date: Sun, 25 Aug 2019 18:42:02 UTC

Severity: normal

Found in version 24.5

Fixed in version 27.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37182 in the body.
You can then email your comments to 37182 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37182; Package emacs. (Sun, 25 Aug 2019 18:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 25 Aug 2019 18:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; 24.5.1: C-u vc-dir-mark-all-files should not mark directories
Date: Sun, 25 Aug 2019 19:54:22 +0200
In a *vc-dir* buffer of a mercurial or git repository, it appears to be
the intention, that marking both a directory and files inside the
directory is invalid.

1. When a directory is marked,

   - trying to mark a file in the directory raises the error:

       vc-dir-mark-file: Parent directory `./' is already marked

   - trying to mark all files with `C-u M' raises the error:

       Cannot mark all files, directory `./' marked

2. When a file is marked,

   - trying to mark the parent directory raises the error:

       vc-dir-mark-file: File `xx' in this directory is already marked

3. However, when no directories are marked,

   - marking all files with the key sequence `C-u M', results in all
     directories and all files to be marked

   - trying to mark all files again with `C-u M' raises the error:

       Cannot mark all files, directory `./' marked

This behavior is inconsistent.

The following patch against the savannah repository fixes it:

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 9a6f6bb..567da65 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -667,7 +667,8 @@ share the same state."
      vc-ewoc)
     (ewoc-map
      (lambda (filearg)
-       (unless (vc-dir-fileinfo->marked filearg)
+       (unless (or (vc-dir-fileinfo->directory filearg)
+               (vc-dir-fileinfo->marked filearg))
          (setf (vc-dir-fileinfo->marked filearg) t)
          t))
      vc-ewoc))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37182; Package emacs. (Mon, 26 Aug 2019 23:07:01 GMT) Full text and rfc822 format available.

Message #8 received at 37182 <at> debbugs.gnu.org (full text, mbox):

From: Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>
To: 37182 <at> debbugs.gnu.org
Subject: Re: bug#37182: Acknowledgement (24.5; 24.5.1: C-u
 vc-dir-mark-all-files should not mark directories)
Date: Tue, 27 Aug 2019 01:06:36 +0200
[Message part 1 (text/plain, inline)]
Patch with commit message attached.
[0001-Do-not-mark-directories-in-vc-dir-mark-all-files.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37182; Package emacs. (Wed, 05 Feb 2020 00:29:01 GMT) Full text and rfc822 format available.

Message #11 received at 37182 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>, 37182 <at> debbugs.gnu.org
Subject: Re: bug#37182: Acknowledgement (24.5; 24.5.1: C-u
 vc-dir-mark-all-files should not mark directories)
Date: Wed, 5 Feb 2020 03:28:24 +0300
On 27.08.2019 2:06, Wolfgang Scherer wrote:
>   	(ewoc-map
>   	 (lambda (filearg)
> -	   (unless (vc-dir-fileinfo->marked filearg)
> +	   (unless (or (vc-dir-fileinfo->directory filearg)
> +		       (vc-dir-fileinfo->marked filearg))
>   	     (setf (vc-dir-fileinfo->marked filearg) t)
>   	     t))
>   	 vc-ewoc))

LGTM (works, too).

Eli, this okay for emacs-27?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37182; Package emacs. (Wed, 05 Feb 2020 14:25:01 GMT) Full text and rfc822 format available.

Message #14 received at 37182 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 37182 <at> debbugs.gnu.org, Wolfgang.Scherer <at> gmx.de
Subject: Re: bug#37182: Acknowledgement (24.5;
 24.5.1: C-u vc-dir-mark-all-files should not mark directories)
Date: Wed, 05 Feb 2020 16:24:44 +0200
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Wed, 5 Feb 2020 03:28:24 +0300
> 
> On 27.08.2019 2:06, Wolfgang Scherer wrote:
> >   	(ewoc-map
> >   	 (lambda (filearg)
> > -	   (unless (vc-dir-fileinfo->marked filearg)
> > +	   (unless (or (vc-dir-fileinfo->directory filearg)
> > +		       (vc-dir-fileinfo->marked filearg))
> >   	     (setf (vc-dir-fileinfo->marked filearg) t)
> >   	     t))
> >   	 vc-ewoc))
> 
> LGTM (works, too).
> 
> Eli, this okay for emacs-27?

Yes, but please also fix the doc string to clearly say what happens
with directories.

Thanks.




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Tue, 11 Feb 2020 22:32:01 GMT) Full text and rfc822 format available.

Notification sent to Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>:
bug acknowledged by developer. (Tue, 11 Feb 2020 22:32:01 GMT) Full text and rfc822 format available.

Message #19 received at 37182-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 37182-done <at> debbugs.gnu.org, Wolfgang.Scherer <at> gmx.de
Subject: Re: bug#37182: Acknowledgement (24.5; 24.5.1: C-u
 vc-dir-mark-all-files should not mark directories)
Date: Wed, 12 Feb 2020 00:31:30 +0200
Version: 27.1

On 05.02.2020 16:24, Eli Zaretskii wrote:
> Yes, but please also fix the doc string to clearly say what happens
> with directories.

Done, I think.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 Mar 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.