emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 d6c8d5dbc9: When redirecting in Eshell, check for "/dev/null" s


From: Jim Porter
Subject: emacs-29 d6c8d5dbc9: When redirecting in Eshell, check for "/dev/null" specifically
Date: Wed, 21 Dec 2022 20:17:16 -0500 (EST)

branch: emacs-29
commit d6c8d5dbc9fc4786e91b76654058e904c96f0e11
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>

    When redirecting in Eshell, check for "/dev/null" specifically
    
    This is so that users can type "cmd ... > /dev/null" in Eshell no
    matter what their system's null device is called.  (Users can still
    use their system's null device name when redirecting, too.  Eshell
    doesn't need to do anything special to support that.)  This partially
    reverts 67a8bdb90c9b5865b7f17290c7135b1a5458c36d.  See bug#59545.
    
    Do not merge to master.
    
    * lisp/eshell/esh-io.el (eshell-set-output-handle): Use "/dev/null"
    literally.
---
 lisp/eshell/esh-io.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index 4620565f85..d223be680f 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -342,7 +342,11 @@ If HANDLES is nil, use `eshell-current-handles'."
   (when target
     (let ((handles (or handles eshell-current-handles)))
       (if (and (stringp target)
-               (string= target (null-device)))
+               ;; The literal string "/dev/null" is intentional here.
+               ;; It just provides compatibility so that users can
+               ;; redirect to "/dev/null" no matter the actual value
+               ;; of `null-device'.
+               (string= target "/dev/null"))
           (aset handles index nil)
         (let ((where (eshell-get-target target mode))
               (current (car (aref handles index))))



reply via email to

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