GNU bug report logs - #32093
27.0.50; M-x grep appends /dev/null to command line

Previous Next

Package: emacs;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Sun, 8 Jul 2018 09:34:02 UTC

Severity: minor

Tags: fixed

Found in version 27.0.50

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32093 <at> debbugs.gnu.org, dak <at> gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#32093: 27.0.50; M-x grep appends /dev/null to command line
Date: Mon, 09 Jul 2018 17:43:46 -0400
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> But is there a good reason why we use HELLO for that?  Why not README,
> say, whose first line will always start with "Copyright"?

I don't think there's a reason to use HELLO in particular.  etc/README
doesn't have Copyright on the first line, but it does have COPYRIGHT at
the beginning of a line (I think we do want something specifically in
etc/, because we know `data-directory' tells us where to find it).

[v1-0001-Use-README-instead-of-HELLO-for-grep-probing-Bug-.patch (text/x-diff, inline)]
From 3b0f302b7d06c37cc6fbff2f1e18904020de51f2 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Mon, 9 Jul 2018 17:38:40 -0400
Subject: [PATCH v1] Use README instead of HELLO for grep probing (Bug#32093)

* lisp/progmodes/grep.el (grep-compute-defaults): Check README for the
string COPYRIGHT; HELLO no longer has "English" at the beginning of a
line since 2018-05-19 "Use Enriched mode in etc/HELLO to keep charset
information".
---
 lisp/progmodes/grep.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index b7c44d6083..b466e205b8 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -626,28 +626,28 @@ grep-compute-defaults
     (unless (or (not grep-use-null-device) (eq grep-use-null-device t))
       (setq grep-use-null-device
 	    (with-temp-buffer
-	      (let ((hello-file (expand-file-name "HELLO" data-directory)))
+	      (let ((hello-file (expand-file-name "README" data-directory)))
 		(not
 		 (and (if grep-command
 			  ;; `grep-command' is already set, so
 			  ;; use that for testing.
 			  (grep-probe grep-command
-				      `(nil t nil "^English" ,hello-file)
+				      `(nil t nil "^COPYRIGHT" ,hello-file)
 				      #'call-process-shell-command)
 			;; otherwise use `grep-program'
 			(grep-probe grep-program
-				    `(nil t nil "-nH" "^English" ,hello-file)))
+				    `(nil t nil "-nH" "^COPYRIGHT" ,hello-file)))
 		      (progn
 			(goto-char (point-min))
 			(looking-at
 			 (concat (regexp-quote hello-file)
-				 ":[0-9]+:English")))))))))
+				 ":[0-9]+:COPYRIGHT")))))))))
 
     (when (eq grep-use-null-filename-separator 'auto-detect)
       (setq grep-use-null-filename-separator
             (with-temp-buffer
-              (let* ((hello-file (expand-file-name "HELLO" data-directory))
-                     (args `("--null" "-ne" "^English" ,hello-file)))
+              (let* ((hello-file (expand-file-name "README" data-directory))
+                     (args `("--null" "-ne" "^COPYRIGHT" ,hello-file)))
                 (if grep-use-null-device
                     (setq args (append args (list null-device)))
                   (push "-H" args))
@@ -656,7 +656,7 @@ grep-compute-defaults
                        (goto-char (point-min))
                        (looking-at
                         (concat (regexp-quote hello-file)
-                                "\0[0-9]+:English"))))))))
+                                "\0[0-9]+:COPYRIGHT"))))))))
 
     (when (eq grep-highlight-matches 'auto-detect)
       (setq grep-highlight-matches
-- 
2.11.0


This bug report was last modified 6 years and 314 days ago.

Previous Next


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