all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [iampure@gmail.com: Re: View Changes In File failure]
@ 2006-09-15 22:56 Richard Stallman
  2006-09-18 21:16 ` Chong Yidong
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2006-09-15 22:56 UTC (permalink / raw)


Would someone please DTRT, then ack?

------- Start of forwarded message -------
Date: Fri, 15 Sep 2006 12:14:57 +0200
From: Ron <iampure@gmail.com>
To: rms@gnu.org
Subject: Re: View Changes In File failure
In-Reply-To: <E1GO4AU-0006Ms-1A@fencepost.gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Disposition: inline
X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=failed 
	version=3.0.4

2006/9/15, Richard Stallman <rms@gnu.org>:
> Can you please provide a _precise_ test case, not leaving any details
> unstated?
Ok
>
> Please read the Bugs section in the Emacs manual, which provides
> guidelines on how to write a bug report to give us the
> necessary information so we can fix the bug.
>
Ok, I see I did exactly what was the typical undesired behaviour for
reporting a bug. Sorry about that.

Now, for a complete transscript:
$ emacs -q -Q
C-x C-f nonexistingfile RET
Emacs reports (New File) in the minibar
Type letter 'a' by pressing the 'a' key.
C-x C-s
C-x C-c
$ emacs -q -Q
C-x C-f nonexistingfile RET
Press End key
Press b
I press the cross in the upper right corner of my screen with the
intention of closing Emacs.

Now, a small modeless frame is displayed, with "Question" in the
titlebar. The question is: Save /home/<my username>/nonexistingfile?

 I am giving the options by means of buttons between
- - Yes
- - No
- - View This File
- - View Changes In File
- - Save This But No More
- - Save All Buffers
- - No For All

I choose View Changes In File by using the left mouse button of my
mouse which is <down-mouse-1>.

The result is now as per the original bug report: it loads diff-mode
behind the modeless window,
flashes the screen (due to a redraw), and then does nothing. The
expected behaviour of "View Changes In File", which would be to show
some buffer with the changes presumably, does not occur. Clicking the
View Changes In File button repeatedly upto 5 times does not show any
difference.

Another bug I found was trying to find out to what function or
"procedure" (to use Lisp terms) is bound to pressing the cross. I did
C-h k and then I pressed the left mouse button on that cross.  I
expected to see documentation, but I only got that (the same as I
speak of above) frame again.

I hope this helps

Ron
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [iampure@gmail.com: Re: View Changes In File failure]
  2006-09-15 22:56 [iampure@gmail.com: Re: View Changes In File failure] Richard Stallman
@ 2006-09-18 21:16 ` Chong Yidong
  2006-09-19 15:57   ` Richard Stallman
       [not found]   ` <87d4647e0609190339g4b233ebaj6a1f7a195c95ea47@mail.gmail.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Chong Yidong @ 2006-09-18 21:16 UTC (permalink / raw)
  Cc: emacs-devel

> $ emacs -q -Q
> C-x C-f nonexistingfile RET
> Emacs reports (New File) in the minibar
> Type letter 'a' by pressing the 'a' key.
> C-x C-s
> C-x C-c
> $ emacs -q -Q
> C-x C-f nonexistingfile RET
> Press End key
> Press b
> I press the cross in the upper right corner of my screen with the
> intention of closing Emacs.
>
> Now, a small modeless frame is displayed, with "Question" in the
> titlebar. The question is: Save /home/<my username>/nonexistingfile?
>
> I choose View Changes In File by using the left mouse button of my
> mouse which is <down-mouse-1>.
>
> The result is now as per the original bug report: it loads diff-mode
> behind the modeless window, flashes the screen (due to a redraw),
> and then does nothing. The expected behaviour of "View Changes In
> File", which would be to show some buffer with the changes
> presumably, does not occur.

I can't reproduce this on

  Emacs 22.0.50.172 (i686-pc-linux-gnu, GTK+ Version 2.8.20)

which is the same configuration you said in your original bug report.

The *Diff* buffer is correctly populated with the difference between
the two files.

Can you check that the M-x diff command works properly?  It may be
that you don't have diff installed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [iampure@gmail.com: Re: View Changes In File failure]
  2006-09-18 21:16 ` Chong Yidong
@ 2006-09-19 15:57   ` Richard Stallman
       [not found]   ` <87d4647e0609190339g4b233ebaj6a1f7a195c95ea47@mail.gmail.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2006-09-19 15:57 UTC (permalink / raw)
  Cc: emacs-devel, iampure

    Can you check that the M-x diff command works properly?  It may be
    that you don't have diff installed.

If Diff is not installed, View Changes in File ought to give a clear
and explicit error message, not present incorrect output.

Maybe it already does.  I think that missing diff is unlikely to be
the cause.  iampure is using GNU/Linux.  It is unlikely that a
GNU/Linux system fails to have diff.

It could be that there's something else wierd about his system.  If
so, we want to find out what it is, and make Emacs cope with it
better.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [iampure@gmail.com: Re: View Changes In File failure]
       [not found]   ` <87d4647e0609190339g4b233ebaj6a1f7a195c95ea47@mail.gmail.com>
@ 2006-09-19 21:54     ` Chong Yidong
  2006-09-20 11:51       ` Ron
  0 siblings, 1 reply; 8+ messages in thread
From: Chong Yidong @ 2006-09-19 21:54 UTC (permalink / raw)
  Cc: emacs-devel

Ron <iampure@gmail.com> writes:

>> I can't reproduce this on
>>
>>   Emacs 22.0.50.172 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
>>
>> which is the same configuration you said in your original bug report.
>>
>> The *Diff* buffer is correctly populated with the difference between
>> the two files.
>>
>> Can you check that the M-x diff command works properly?  It may be
>> that you don't have diff installed.
>>
> Yes, M-x diff works properly. What happens exactly  when you press
> View Changes In File? As I said in my report diff-mode is loaded
> (which could be consistent with  your  "The *Diff* buffer is correctly
> populated" , but other than that nothing happens.

For me, the Diff buffer shows the diff between the current buffer
contents and the original file:

diff -c /home/cyd/nonexistingfile /tmp/buffer-content-18622n-F
*** /home/cyd/nonexistingfile	2006-09-19 17:49:40.000000000 -0400
--- /tmp/buffer-content-18622n-F	2006-09-19 17:52:12.000000000 -0400
***************
*** 1 ****
! a
\ No newline at end of file
--- 1 ----
! ab
\ No newline at end of file

Diff finished.  Tue Sep 19 17:52:12 2006

> I strongly suspect that either the bug has been fixed (which I don't
> think is likely) or you do not follow my instructions to the letter.
> I suggest that you try again (I reproduced it again with my
> instructions here to be absolutely sure).  When you still cannot
> reproduce it, could you give me a small guide of upgrading to your
> exact version?

I followed your instructions precisely.  No bug.  The first thing you
should try is to use the latest version of Emacs in CVS, and see if
the bug is present.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [iampure@gmail.com: Re: View Changes In File failure]
  2006-09-19 21:54     ` Chong Yidong
@ 2006-09-20 11:51       ` Ron
  2006-09-20 15:17         ` Chong Yidong
                           ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ron @ 2006-09-20 11:51 UTC (permalink / raw)
  Cc: emacs-devel

> I followed your instructions precisely.  No bug.  The first thing you
> should try is to use the latest version of Emacs in CVS, and see if
> the bug is present.
>
I installed the latest version from CVS using the following configure options:
./configure  \
  --with-xpm \
  --with-jpeg\
  --with-tiff \
  --with-gif   \
  --with-png   \
  --with-x     \
  --with-gtk

When I do the same as in the original bug-report I get in the lower
half of my screen a *Diff* buffer which is filled with a diff, which
looks at good at first sight. The only problem now is that the
modeless window with the question buttons still is modeless, so I
can't click on the *Diff* buffer to see it. I can however do View This
File, and then get to the original file buffer and then do C-x o to
switch to the *Diff* buffer. This seems better behaviour, but when I
open and close a few buffers and actually do something it seems to
stop working after some time. This description won't help you as I am
well aware, but I would like to mention it. For now, it would be nice
if the above behaviour when someone clicks on the View Changes In File
would be changed to:
-hide modeless question window
-switch point to the *Diff* buffer

Another rather lame property of the GTK modeless window is that when
you move it with the mouse you can wipe your screen white with it, due
to refresh bugs in either Emacs or GTK.

The quality of the code regarding to the GTK binding in Emacs seems low.

Ron

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [iampure@gmail.com: Re: View Changes In File failure]
  2006-09-20 11:51       ` Ron
@ 2006-09-20 15:17         ` Chong Yidong
  2006-09-21 17:21         ` Richard Stallman
  2006-09-21 17:21         ` Richard Stallman
  2 siblings, 0 replies; 8+ messages in thread
From: Chong Yidong @ 2006-09-20 15:17 UTC (permalink / raw)
  Cc: emacs-devel

Ron <iampure@gmail.com> writes:

>> I followed your instructions precisely.  No bug.  The first thing you
>> should try is to use the latest version of Emacs in CVS, and see if
>> the bug is present.
>>
> I installed the latest version from CVS.
>
> When I do the same as in the original bug-report I get in the lower
> half of my screen a *Diff* buffer which is filled with a diff, which
> looks at good at first sight.

So your original bug was, indeed, specific to an outdated version of
Emacs.

> The only problem now is that the modeless window with the question
> buttons still is modeless, so I can't click on the *Diff* buffer to
> see it.
>
> The quality of the code regarding to the GTK binding in Emacs seems low.

This issue is not specific to GTK; it affects the no-X-toolkit
versions too.  The following patch should solve the problem by
handling "View Changes in File" similarly to "View This File".

*** emacs/lisp/files.el.~1.856.~	2006-09-08 16:32:56.000000000 -0400
--- emacs/lisp/files.el	2006-09-20 11:08:28.000000000 -0400
***************
*** 3695,3701 ****
  		   (setq buffer-backed-up nil)))))))
      setmodes))
  
! (defun diff-buffer-with-file (&optional buffer)
    "View the differences between BUFFER and its associated file.
  This requires the external program `diff' to be in your `exec-path'."
    (interactive "bBuffer: ")
--- 3695,3701 ----
  		   (setq buffer-backed-up nil)))))))
      setmodes))
  
! (defun diff-buffer-with-file (&optional buffer diff-buffer)
    "View the differences between BUFFER and its associated file.
  This requires the external program `diff' to be in your `exec-path'."
    (interactive "bBuffer: ")
***************
*** 3707,3713 ****
  	      (save-restriction
  		(widen)
  		(write-region (point-min) (point-max) tempfile nil 'nomessage)
! 		(diff buffer-file-name tempfile nil t)
  		(sit-for 0))
  	    (when (file-exists-p tempfile)
  	      (delete-file tempfile))))
--- 3707,3713 ----
  	      (save-restriction
  		(widen)
  		(write-region (point-min) (point-max) tempfile nil 'nomessage)
! 		(diff buffer-file-name tempfile nil t diff-buffer)
  		(sit-for 0))
  	    (when (file-exists-p tempfile)
  	      (delete-file tempfile))))
***************
*** 3729,3735 ****
         ;; Return nil to ask about BUF again.
         nil)
       "view this file")
!     (?d diff-buffer-with-file
  	"view changes in file"))
    "ACTION-ALIST argument used in call to `map-y-or-n-p'.")
  
--- 3729,3741 ----
         ;; Return nil to ask about BUF again.
         nil)
       "view this file")
!     (?d (lambda (buf)
! 	  (let ((diff-buffer (get-buffer-create "*Diff*")))
! 	    (diff-buffer-with-file buf diff-buffer)
! 	    (view-buffer diff-buffer (lambda (ignore)
! 				       (exit-recursive-edit))))
! 	  (recursive-edit)
! 	  nil)
  	"view changes in file"))
    "ACTION-ALIST argument used in call to `map-y-or-n-p'.")
  
*** emacs/lisp/diff.el.~1.60.~	2006-06-15 14:32:50.000000000 -0400
--- emacs/lisp/diff.el	2006-09-20 11:11:19.000000000 -0400
***************
*** 73,84 ****
  		      (current-time-string))))))
  
  ;;;###autoload
! (defun diff (old new &optional switches no-async)
    "Find and display the differences between OLD and NEW files.
  Interactively the current buffer's file name is the default for NEW
  and a backup file for NEW is the default for OLD.
  If NO-ASYNC is non-nil, call diff synchronously.
! With prefix arg, prompt for diff switches."
    (interactive
     (let (oldf newf)
       (setq newf (buffer-file-name)
--- 73,86 ----
  		      (current-time-string))))))
  
  ;;;###autoload
! (defun diff (old new &optional switches no-async diff-buffer)
    "Find and display the differences between OLD and NEW files.
  Interactively the current buffer's file name is the default for NEW
  and a backup file for NEW is the default for OLD.
  If NO-ASYNC is non-nil, call diff synchronously.
! With prefix arg, prompt for diff switches.
! If DIFF-BUFFER is non-nil, insert the diff in that buffer instead
! of displaying it."
    (interactive
     (let (oldf newf)
       (setq newf (buffer-file-name)
***************
*** 112,122 ****
  		       ,(shell-quote-argument (or old-alt old))
  		       ,(shell-quote-argument (or new-alt new)))
  		     " "))
! 	 (buf (get-buffer-create "*Diff*"))
  	 (thisdir default-directory)
  	 proc)
      (save-excursion
!       (display-buffer buf)
        (set-buffer buf)
        (setq buffer-read-only nil)
        (buffer-disable-undo (current-buffer))
--- 114,125 ----
  		       ,(shell-quote-argument (or old-alt old))
  		       ,(shell-quote-argument (or new-alt new)))
  		     " "))
! 	 (buf (or diff-buffer (get-buffer-create "*Diff*")))
  	 (thisdir default-directory)
  	 proc)
      (save-excursion
!       (unless diff-buffer
! 	(display-buffer buf))
        (set-buffer buf)
        (setq buffer-read-only nil)
        (buffer-disable-undo (current-buffer))

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [iampure@gmail.com: Re: View Changes In File failure]
  2006-09-20 11:51       ` Ron
  2006-09-20 15:17         ` Chong Yidong
@ 2006-09-21 17:21         ` Richard Stallman
  2006-09-21 17:21         ` Richard Stallman
  2 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2006-09-21 17:21 UTC (permalink / raw)
  Cc: cyd, emacs-devel

     The only problem now is that the
    modeless window with the question buttons still is modeless, so I
    can't click on the *Diff* buffer to see it.

What do you mean by calling a window "modeless"?
Modes in Emacs apply to buffers, not windows.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [iampure@gmail.com: Re: View Changes In File failure]
  2006-09-20 11:51       ` Ron
  2006-09-20 15:17         ` Chong Yidong
  2006-09-21 17:21         ` Richard Stallman
@ 2006-09-21 17:21         ` Richard Stallman
  2 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2006-09-21 17:21 UTC (permalink / raw)
  Cc: cyd, emacs-devel

    The quality of the code regarding to the GTK binding in Emacs seems low.

That is a totally unconstructive thing to say.  If it reflects some
sort of real problem, it is too vague and subjective to help anyone do
anything to correct the problem.

Please make sure your criticism here is constructive.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-09-21 17:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 22:56 [iampure@gmail.com: Re: View Changes In File failure] Richard Stallman
2006-09-18 21:16 ` Chong Yidong
2006-09-19 15:57   ` Richard Stallman
     [not found]   ` <87d4647e0609190339g4b233ebaj6a1f7a195c95ea47@mail.gmail.com>
2006-09-19 21:54     ` Chong Yidong
2006-09-20 11:51       ` Ron
2006-09-20 15:17         ` Chong Yidong
2006-09-21 17:21         ` Richard Stallman
2006-09-21 17:21         ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.