emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/eshell/em-unix.el,v


From: John Wiegley
Subject: [Emacs-diffs] Changes to emacs/lisp/eshell/em-unix.el,v
Date: Fri, 26 Oct 2007 08:07:19 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     John Wiegley <johnw>    07/10/26 08:07:19

Index: eshell/em-unix.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/eshell/em-unix.el,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- eshell/em-unix.el   21 Oct 2007 07:33:32 -0000      1.33
+++ eshell/em-unix.el   26 Oct 2007 08:07:17 -0000      1.34
@@ -974,6 +974,13 @@
   (if eshell-diff-window-config
       (set-window-configuration eshell-diff-window-config)))
 
+(defun nil-blank-string ( string )
+  "if a string is all blanks return nil, if there are non-blank characters
+return the string"
+  (cond
+   ((string-match "[^[:blank:]]" string ) string)
+   (nil)))
+
 (defun eshell/diff (&rest args)
   "Alias \"diff\" to call Emacs `diff' function."
   (let ((orig-args (eshell-stringify-list (eshell-flatten-list args))))
@@ -995,7 +1002,8 @@
          (setcdr (last args 3) nil))
        (with-current-buffer
            (condition-case err
-               (diff old new (eshell-flatten-and-stringify args))
+               (diff old new
+                     (nil-blank-string (eshell-flatten-and-stringify args)))
              (error
               (throw 'eshell-replace-command
                      (eshell-parse-command "*diff" orig-args))))




reply via email to

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