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

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

diff terminates silently


From: Roland Winkler
Subject: diff terminates silently
Date: Sun, 24 Mar 2002 12:19:06 +0100

In GNU Emacs 21.1.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-02-01 on tfkp12
configured using `configure  --prefix=/nfs/common --libexecdir=/nfs/common/lib 
--bindir=/nfs/common/lib/emacs/21.1/bin/i686-Linux 
--mandir=/nfs/common/share/man --infodir=/nfs/common/share/info --with-gcc 
--with-pop --with-x --with-x-toolkit=athena i386-pc-linux'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: nil

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


I've been running emacs diff in a dired buffer on a bunch of files
essentially in order to see whether the files have the same content
or not. I was rather surprised that the output of diff goes into the
*diff* buffer ONLY. So I always had to switch to the *diff* buffer
which can be annoying.

Finally, after some digging in diff.el I found that adding three
messages to diff-process-setup (see below) solved my problem. I want
to suggest that this should be included in diff.el. Or can these
messages interfere with anything else? (I haven't tested it yet very
much.) This could require a switch that only `ordinary' calls of
diff give these messages.

Roland


(defun diff-process-setup ()
  "Set up \`compilation-exit-message-function' for \`diff'."
  ;; Avoid frightening people with "abnormally terminated"
  ;; if diff finds differences.
  (set (make-local-variable 'compilation-exit-message-function)
       (lambda (status code msg)
         (cond ((not (eq status 'exit))
                (message "%s" msg)
                (cons msg code))
               ((zerop code)
                (message "no differences")
                '("finished (no differences)\n" . "no differences"))
               ((= code 1)
                (message "differences found")
                '("finished\n" . "differences found"))
               (t
                (cons msg code))))))





reply via email to

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