all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Olum <kdo@cosmos.phy.tufts.edu>
To: eliz@gnu.org, 16433@debbugs.gnu.org
Subject: bug#16433: Test case for newline cache corruption
Date: Thu, 22 May 2014 16:38:27 -0400	[thread overview]
Message-ID: <q52egzllfb0.fsf@cosmos.phy.tufts.edu> (raw)
In-Reply-To: <E1W2nJv-0001gS-S3@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

Here is a procedure which I can use to reproduce the newline cache
corruption.

1.  Detach attached files test.mbox, test.in, and test.emacs.  

2.  Put test.emacs in place of your .emacs file.

3.  Run emacs.  I used a compilation from trunk revision 117139.

Because I had to try this many, many times, test.emacs puts testing
commands on keys F3 and F4.  So

3.  Push F3 to run rmail on test.mbox

4.  Push F4 to get new mail from test.in

5.  Push "p" to go to the previous message.  You should get a warning
about cache corruption.

The details of the "new mail" in test.in don't seem to matter much, but
it is very sensitive to precisely what is in the existing message in
test.mbox.  I removed everything that I could to simplify the test case.

I hope this is helpful.

                                        Ken


[-- Attachment #2: test.mbox --]
[-- Type: application/octet-stream, Size: 2042 bytes --]

From kdo@cosmos.phy.tufts.edu Wed May 21 15:19:31 2014
Envelope-to: kdo@cosmos.phy.tufts.edu
Delivery-date: Wed, 21 May 2014 15:19:31 -0400
From: kdo@cosmos.phy.tufts.edu
To: kdo@cosmos.phy.tufts.edu
Subject: test
Date: Wed, 21 May 2014 19:18:25 +0000
Message-ID: <A08616A381DDDA4F907CE430F65C67FE01C5118AA7@RMSMBX01.rms-law.com>
X-RMAIL-ATTRIBUTES: --------

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Times New Roman" size="3"><span style="font-size:12pt;"><a name="OLE_LINK1"></a>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Send us your photographs and articles, reflections, reminiscences.&nbsp; Sail a multihull and write about it!&nbsp; </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">--Andy Houlding</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">&nbsp;</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">&nbsp;</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">&nbsp;</span></font></div>
</span></font>
</body>
</html>

From kdo@cosmos.phy.tufts.edu Thu May 22 10:43:50 2014
Return-path: <kdo@cosmos.phy.tufts.edu>
Envelope-to: kdo@cosmos.phy.tufts.edu
Delivery-date: Thu, 22 May 2014 10:43:50 -0400
Received: from kdo by cosmos.phy.tufts.edu ([local]:local)
	with local id 1WnUDm-0007g8-1A - Using Exim-4.80.1 (MandrivaLinux) MTA 
	(return-path <kdo@cosmos.phy.tufts.edu>); Thu, 22 May 2014 10:43:50 -0400
Date: Thu, 22 May 2014 10:43:50 -0400
To: kdo@cosmos.phy.tufts.edu
Subject: test
Message-Id: <E1WnUDm-0007g8-1A@cosmos.phy.tufts.edu>
From: Ken Olum <kdo@cosmos.phy.tufts.edu>
X-RMAIL-ATTRIBUTES: ------U-



[-- Attachment #3: test.in --]
[-- Type: application/octet-stream, Size: 565 bytes --]

From kdo@cosmos.phy.tufts.edu Thu May 22 10:43:50 2014
Return-path: <kdo@cosmos.phy.tufts.edu>
Envelope-to: kdo@cosmos.phy.tufts.edu
Delivery-date: Thu, 22 May 2014 10:43:50 -0400
Received: from kdo by cosmos.phy.tufts.edu ([local]:local)
	with local id 1WnUDm-0007g8-1A - Using Exim-4.80.1 (MandrivaLinux) MTA 
	(return-path <kdo@cosmos.phy.tufts.edu>); Thu, 22 May 2014 10:43:50 -0400
Date: Thu, 22 May 2014 10:43:50 -0400
To: kdo@cosmos.phy.tufts.edu
Subject: test
Message-Id: <E1WnUDm-0007g8-1A@cosmos.phy.tufts.edu>
From: Ken Olum <kdo@cosmos.phy.tufts.edu>



[-- Attachment #4: test.emacs --]
[-- Type: application/octet-stream, Size: 693 bytes --]

(require 'rmail)

(defun maybe-check-newline-cache ()
  (if (eq major-mode 'rmail-mode)
      (progn
	(check-newline-cache)
	(if rmail-view-buffer
	    (with-current-buffer rmail-view-buffer
	      (check-newline-cache))))))

(defun check-newline-cache ()
  (let ((newlines (newline-cache-check)))
    (if (and newlines
	     (not (equal (aref newlines 0) (aref newlines 1))))
	(message "Newline cache corrupted in %s" (current-buffer)))))

(add-hook 'post-command-hook 'maybe-check-newline-cache)

(defun do-test ()
  (interactive)
  (rmail "test.mbox"))

(global-set-key [f3] 'do-test)

(defun do-test-1 ()
  (interactive)
  (rmail-get-new-mail "test.in"))

(global-set-key [f4] 'do-test-1)

  parent reply	other threads:[~2014-05-22 20:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 19:37 bug#16433: 24.3.50; find_newline screws up in Rmail buffers Richard Stallman
2014-01-13 20:31 ` Eli Zaretskii
2014-01-14 17:06   ` Richard Stallman
2014-01-14 17:36     ` Eli Zaretskii
2014-01-15 12:29       ` Richard Stallman
2014-01-15 15:52         ` Eli Zaretskii
2014-05-22 20:38 ` Ken Olum [this message]
2014-05-23  5:50   ` bug#16433: Test case for newline cache corruption Eli Zaretskii
2014-05-24  8:24   ` Eli Zaretskii
2014-05-26 15:29     ` Ken Olum
2014-05-26 19:28       ` Eli Zaretskii
2014-05-27 15:14         ` Ken Olum
2014-05-27 16:20         ` Ken Olum
2014-05-27 18:04           ` Eli Zaretskii
2014-05-31 10:13           ` Eli Zaretskii
2014-05-31 18:27             ` Eli Zaretskii
2014-06-01 22:30               ` Ken Olum
2014-06-02  2:44                 ` Eli Zaretskii
2014-06-05 16:57               ` Ken Olum
2014-06-05 17:31                 ` Eli Zaretskii
2014-06-06 15:07                   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=q52egzllfb0.fsf@cosmos.phy.tufts.edu \
    --to=kdo@cosmos.phy.tufts.edu \
    --cc=16433@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.