GNU bug report logs - #3033
23.0.92; Try to auto fix whitespace loss? (y/n)

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Fri, 17 Apr 2009 21:40:03 UTC

Severity: normal

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3033 in the body.
You can then email your comments to 3033 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3033; Package emacs. (Fri, 17 Apr 2009 21:40:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 17 Apr 2009 21:40:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.92; Try to auto fix whitespace loss? (y/n)
Date: Fri, 17 Apr 2009 12:38:08 +0100
[Message part 1 (text/plain, inline)]
When I try to open by drag and drop the attached file, Emacs keep asking
me 'Try to auto fix whitespace loss? (y/n)'. No matter y or n, the
dialogue will appear again and again until I kill the buffer.

I enable whitespace mode using (add-hook 'diff-mode-hook
'whitespace-mode).

GNU Emacs 23.0.92.1 (i386-apple-darwin9.6.0, NS apple-appkit-949.43) of
2009-04-15 on 64-71-7-214.static.wiline.com

[emacs-gnus-ticked-doc.patch (text/x-patch, attachment)]

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3033; Package emacs. (Sat, 18 Apr 2009 02:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 18 Apr 2009 02:00:03 GMT) Full text and rfc822 format available.

Message #10 received at 3033 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Leo <sdl.web <at> gmail.com>
Cc: 3033 <at> debbugs.gnu.org
Subject: Re: 23.0.92; Try to auto fix whitespace loss? (y/n)
Date: Fri, 17 Apr 2009 21:55:08 -0400
> When I try to open by drag and drop the attached file, Emacs keep asking
> me 'Try to auto fix whitespace loss? (y/n)'. No matter y or n, the
> dialogue will appear again and again until I kill the buffer.
>
> I enable whitespace mode using (add-hook 'diff-mode-hook
> 'whitespace-mode).

I can't reproduce this.  Do you see the bug with a .emacs containing
only `(add-hook 'diff-mode-hook 'whitespace-mode)' and nothing else?




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3033; Package emacs. (Sat, 18 Apr 2009 13:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 18 Apr 2009 13:30:03 GMT) Full text and rfc822 format available.

Message #15 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#3033: 23.0.92; Try to auto fix whitespace loss? (y/n)
Date: Sat, 18 Apr 2009 14:24:59 +0100
On 2009-04-18 02:55 +0100, Chong Yidong wrote:
>> When I try to open by drag and drop the attached file, Emacs keep asking
>> me 'Try to auto fix whitespace loss? (y/n)'. No matter y or n, the
>> dialogue will appear again and again until I kill the buffer.
>>
>> I enable whitespace mode using (add-hook 'diff-mode-hook
>> 'whitespace-mode).
>
> I can't reproduce this.  Do you see the bug with a .emacs containing
> only `(add-hook 'diff-mode-hook 'whitespace-mode)' and nothing else?

I have used edebug and error-on-quit to trace the culprit and find a
reproducible recipe. It turns out it has nothing to do with whitespace.

1. emacs -q
2. M-x which-func-mode
3. C-x C-f emacs-gnus-ticked-doc.patch

You should be able to see a dialogue pop up as in this screenshot
http://imagebin.org/46002.

In my experience, I have found which-func-mode to be intrusive and
unreliable. So I guess I will have to disable it to avoid further
trouble.

Best wishes,
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .: I use Emacs :.

               www.git-scm.com
    git - the one true version control system






Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3033; Package emacs. (Mon, 20 Apr 2009 08:10:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 20 Apr 2009 08:10:05 GMT) Full text and rfc822 format available.

Message #20 received at 3033 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Leo <sdl.web <at> gmail.com>, 3033 <at> debbugs.gnu.org
Subject: Re: bug#3033: 23.0.92; Try to auto fix whitespace loss? (y/n)
Date: Mon, 20 Apr 2009 09:58:19 +0200
[Message part 1 (text/plain, inline)]
> I have used edebug and error-on-quit to trace the culprit and find a
> reproducible recipe. It turns out it has nothing to do with whitespace.
>
> 1. emacs -q
> 2. M-x which-func-mode
> 3. C-x C-f emacs-gnus-ticked-doc.patch
>
[...]
> In my experience, I have found which-func-mode to be intrusive and
> unreliable. So I guess I will have to disable it to avoid further
> trouble.

Looks to me like a bug in `diff-sanity-check-hunk' which fails to make
the hunk well-formed.  However, I think `diff-find-source-location'
shouldn't do any sanity checks in the first place when called with a
non-nil NOPROMPT argument.  So could you try whether the attached patch
solves your problem?

Thanks, martin.
[diff-mode.el.diff (text/plain, inline)]
*** diff-mode.el.~1.157.~	2009-01-13 15:55:57.000000000 +0100
--- diff-mode.el	2009-04-20 09:39:22.515625000 +0200
***************
*** 1575,1581 ****
             ;; the user may disagree on what constitutes the hunk
             ;; (e.g. because an empty line truncates the hunk mid-course),
             ;; leading to potentially nasty surprises for the user.
!            (_ (diff-sanity-check-hunk))
  	   (hunk (buffer-substring
                    (point) (save-excursion (diff-end-of-hunk) (point))))
  	   (old (diff-hunk-text hunk reverse char-offset))
--- 1575,1581 ----
             ;; the user may disagree on what constitutes the hunk
             ;; (e.g. because an empty line truncates the hunk mid-course),
             ;; leading to potentially nasty surprises for the user.
!            (_ (unless noprompt (diff-sanity-check-hunk)))
  	   (hunk (buffer-substring
                    (point) (save-excursion (diff-end-of-hunk) (point))))
  	   (old (diff-hunk-text hunk reverse char-offset))

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3033; Package emacs. (Mon, 20 Apr 2009 16:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 20 Apr 2009 16:00:03 GMT) Full text and rfc822 format available.

Message #25 received at 3033 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 3033 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>
Subject: Re: bug#3033: 23.0.92; Try to auto fix whitespace loss? (y/n)
Date: Mon, 20 Apr 2009 11:53:33 -0400
> the hunk well-formed.  However, I think `diff-find-source-location'
> shouldn't do any sanity checks in the first place when called with a
> non-nil NOPROMPT argument.

Indeed, thank you,


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3033; Package emacs. (Mon, 20 Apr 2009 16:40:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> googlemail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 20 Apr 2009 16:40:03 GMT) Full text and rfc822 format available.

Message #30 received at 3033 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> googlemail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 3033 <at> debbugs.gnu.org
Subject: Re: bug#3033: 23.0.92; Try to auto fix whitespace loss? (y/n)
Date: Mon, 20 Apr 2009 17:30:56 +0100
2009/4/20 martin rudalics <rudalics <at> gmx.at>:
>> I have used edebug and error-on-quit to trace the culprit and find a
>> reproducible recipe. It turns out it has nothing to do with whitespace.
>>
>> 1. emacs -q
>> 2. M-x which-func-mode
>> 3. C-x C-f emacs-gnus-ticked-doc.patch
>>
> [...]
>> In my experience, I have found which-func-mode to be intrusive and
>> unreliable. So I guess I will have to disable it to avoid further
>> trouble.
>
> Looks to me like a bug in `diff-sanity-check-hunk' which fails to make
> the hunk well-formed.  However, I think `diff-find-source-location'
> shouldn't do any sanity checks in the first place when called with a
> non-nil NOPROMPT argument.  So could you try whether the attached patch
> solves your problem?
>
> Thanks, martin.

I tried the patch and it seems to work.

Thank you.

Leo




Reply sent to martin rudalics <rudalics <at> gmx.at>:
You have taken responsibility. (Tue, 21 Apr 2009 07:30:03 GMT) Full text and rfc822 format available.

Notification sent to Leo <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Tue, 21 Apr 2009 07:30:03 GMT) Full text and rfc822 format available.

Message #35 received at 3033-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Leo <sdl.web <at> googlemail.com>
Cc: 3033-done <at> debbugs.gnu.org
Subject: Re: bug#3033: 23.0.92; Try to auto fix whitespace loss? (y/n)
Date: Tue, 21 Apr 2009 09:18:50 +0200
> I tried the patch and it seems to work.

Thanks for testing.  So this has been fixed as:

	* diff-mode.el (diff-find-source-location): Don't call
	diff-sanity-check-hunk when NOPROMPT is non-nil.  (Bug#3033)

martin





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Tue, 19 May 2009 14:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 113 days ago.

Previous Next


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