bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48471: 28.0.50; Incorrect handling of `project-ignores' on macOS (BS


From: Dmitry Gutov
Subject: bug#48471: 28.0.50; Incorrect handling of `project-ignores' on macOS (BSD find?) if project root is a directory name
Date: Sun, 30 May 2021 00:44:40 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 23.05.2021 14:08, Philipp wrote:
though it would be better to use a version of it which fixes the same behavior 
in two other related functions as well. The previous patch for that approach is 
here:https://lists.gnu.org/archive/html/emacs-devel/2021-01/txtDduOxGoiGz.txt

(From the 
messagehttps://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00345.html).

Also, since it will fix the double-slash problem, we can undo the change from 
331e40a8fd491ceb35c08a3345785dab61bc60d9, the one that made our comparisons lax 
(to match both single and double slashes).
I'm also fine with either of those, but we should first make sure that the code 
in question is well-covered by unit tests to avoid regressions.

Tests are good to have, yes.

Speaking of the implementation, any chance we would want to have "-H" inside grep-find-template by default?

Has that been considered in the past perhaps? Eli, Lars, Stefan?

The simplest change to that effect should look like this:

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index e9fbcbbfcd..9956ba79d0 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -777,19 +777,19 @@ grep-compute-defaults
                                (format "%s " (null-device))
                              "")))
                  (cond ((eq grep-find-use-xargs 'gnu)
-                        (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
+                        (format "%s -H <D> <X> -type f <F> -print0 | \"%s\" -0 
%s"
                                 find-program xargs-program gcmd))
                        ((eq grep-find-use-xargs 'gnu-sort)
-                        (format "%s <D> <X> -type f <F> -print0 | sort -z | \"%s\" 
-0 %s"
+                        (format "%s -H <D> <X> -type f <F> -print0 | sort -z | 
\"%s\" -0 %s"
                                 find-program xargs-program gcmd))
                        ((eq grep-find-use-xargs 'exec)
-                        (format "%s <D> <X> -type f <F> -exec %s %s %s%s"
+                        (format "%s -H <D> <X> -type f <F> -exec %s %s %s%s"
                                 find-program gcmd quot-braces null 
quot-scolon))
                        ((eq grep-find-use-xargs 'exec-plus)
-                        (format "%s <D> <X> -type f <F> -exec %s %s%s +"
+                        (format "%s -H <D> <X> -type f <F> -exec %s %s%s +"
                                 find-program gcmd null quot-braces))
                        (t
-                        (format "%s <D> <X> -type f <F> -print | \"%s\" %s"
+                        (format "%s -H <D> <X> -type f <F> -print | \"%s\" %s"
                                 find-program xargs-program gcmd))))))))

     ;; Save defaults for this host.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]