* bug#65609: 30.0.50; inhibit-eol-conversion breaks revert-buffer
2023-08-30 13:26 ` Eli Zaretskii
@ 2023-08-30 13:42 ` Gerd Möllmann
2023-08-30 14:22 ` Eli Zaretskii
2023-08-30 13:43 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-30 17:06 ` Herbert J. Skuhra
2 siblings, 1 reply; 8+ messages in thread
From: Gerd Möllmann @ 2023-08-30 13:42 UTC (permalink / raw)
To: Eli Zaretskii, Andrew Scott, Po Lu, Herbert J. Skuhra; +Cc: 65609
On 30.08.23 15:26, Eli Zaretskii wrote:
> Po Lu, I think we need the patch below to fix this. Gerd, does this
> solve your problem as well, including the abort during bootstrap?
> Herbert, I think this could also be related to the problems you see,
> so please try the patch below.
>
> diff --git a/src/fileio.c b/src/fileio.c
> index 23e1a83..8919e08 100644
> --- a/src/fileio.c
> +++ b/src/fileio.c
> @@ -4805,7 +4805,7 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
>
> /* 'try' is reserved in some compilers (Microsoft C). */
> ptrdiff_t trytry = min (gap_size, READ_BUF_SIZE);
> - if (!NILP (end))
> + if (seekable || !NILP (end))
> trytry = min (trytry, total - inserted);
>
> if (!seekable && NILP (end))
With this patch, the abort during bootstrap no longer happens.
Thanks! That was quick ;-).
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#65609: 30.0.50; inhibit-eol-conversion breaks revert-buffer
2023-08-30 13:42 ` Gerd Möllmann
@ 2023-08-30 14:22 ` Eli Zaretskii
0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2023-08-30 14:22 UTC (permalink / raw)
To: Gerd Möllmann; +Cc: luangruo, herbert, 65609, andj.scott
> Date: Wed, 30 Aug 2023 15:42:48 +0200
> Cc: 65609@debbugs.gnu.org
> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>
> On 30.08.23 15:26, Eli Zaretskii wrote:
> > Po Lu, I think we need the patch below to fix this. Gerd, does this
> > solve your problem as well, including the abort during bootstrap?
> > Herbert, I think this could also be related to the problems you see,
> > so please try the patch below.
> >
> > diff --git a/src/fileio.c b/src/fileio.c
> > index 23e1a83..8919e08 100644
> > --- a/src/fileio.c
> > +++ b/src/fileio.c
> > @@ -4805,7 +4805,7 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
> >
> > /* 'try' is reserved in some compilers (Microsoft C). */
> > ptrdiff_t trytry = min (gap_size, READ_BUF_SIZE);
> > - if (!NILP (end))
> > + if (seekable || !NILP (end))
> > trytry = min (trytry, total - inserted);
> >
> > if (!seekable && NILP (end))
>
> With this patch, the abort during bootstrap no longer happens.
Thanks for testing.
> Thanks! That was quick ;-).
It was an easy test case and a stunning failure.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#65609: 30.0.50; inhibit-eol-conversion breaks revert-buffer
2023-08-30 13:26 ` Eli Zaretskii
2023-08-30 13:42 ` Gerd Möllmann
@ 2023-08-30 13:43 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-30 14:18 ` Eli Zaretskii
2023-08-30 17:06 ` Herbert J. Skuhra
2 siblings, 1 reply; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-30 13:43 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Gerd Möllmann, Herbert J. Skuhra, 65609, Andrew Scott
Eli Zaretskii <eliz@gnu.org> writes:
> Thanks for an easy test case. We are reading too much from the file
> on disk when reverting in this case.
>
> Po Lu, I think we need the patch below to fix this. Gerd, does this
> solve your problem as well, including the abort during bootstrap?
> Herbert, I think this could also be related to the problems you see,
> so please try the patch below.
>
> diff --git a/src/fileio.c b/src/fileio.c
> index 23e1a83..8919e08 100644
> --- a/src/fileio.c
> +++ b/src/fileio.c
> @@ -4805,7 +4805,7 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
>
> /* 'try' is reserved in some compilers (Microsoft C). */
> ptrdiff_t trytry = min (gap_size, READ_BUF_SIZE);
> - if (!NILP (end))
> + if (seekable || !NILP (end))
> trytry = min (trytry, total - inserted);
>
> if (!seekable && NILP (end))
I don't believe this should incur any difficulties upon the Android
port, so please proceed with installing it if it works.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#65609: 30.0.50; inhibit-eol-conversion breaks revert-buffer
2023-08-30 13:43 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-30 14:18 ` Eli Zaretskii
[not found] ` <CAEtA7Wfv8UauiVpjJ669-R=QdC-u32mOhn_S+hQTUr3_9_zK=g@mail.gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-08-30 14:18 UTC (permalink / raw)
To: Po Lu; +Cc: gerd.moellmann, herbert, 65609, andj.scott
> From: Po Lu <luangruo@yahoo.com>
> Cc: Andrew Scott <andj.scott@gmail.com>, Gerd Möllmann
> <gerd.moellmann@gmail.com>, "Herbert J. Skuhra" <herbert@gojira.at>,
> 65609@debbugs.gnu.org
> Date: Wed, 30 Aug 2023 21:43:23 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Thanks for an easy test case. We are reading too much from the file
> > on disk when reverting in this case.
> >
> > Po Lu, I think we need the patch below to fix this. Gerd, does this
> > solve your problem as well, including the abort during bootstrap?
> > Herbert, I think this could also be related to the problems you see,
> > so please try the patch below.
> >
> > diff --git a/src/fileio.c b/src/fileio.c
> > index 23e1a83..8919e08 100644
> > --- a/src/fileio.c
> > +++ b/src/fileio.c
> > @@ -4805,7 +4805,7 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
> >
> > /* 'try' is reserved in some compilers (Microsoft C). */
> > ptrdiff_t trytry = min (gap_size, READ_BUF_SIZE);
> > - if (!NILP (end))
> > + if (seekable || !NILP (end))
> > trytry = min (trytry, total - inserted);
> >
> > if (!seekable && NILP (end))
>
> I don't believe this should incur any difficulties upon the Android
> port, so please proceed with installing it if it works.
Thanks, installed on master. I will wait to hear from Andrew before
closing the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#65609: 30.0.50; inhibit-eol-conversion breaks revert-buffer
2023-08-30 13:26 ` Eli Zaretskii
2023-08-30 13:42 ` Gerd Möllmann
2023-08-30 13:43 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-30 17:06 ` Herbert J. Skuhra
2 siblings, 0 replies; 8+ messages in thread
From: Herbert J. Skuhra @ 2023-08-30 17:06 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Po Lu, Gerd Möllmann, 65609, Andrew Scott
On Wed, 30 Aug 2023 15:26:35 +0200, Eli Zaretskii wrote:
>
> > From: Andrew Scott <andj.scott@gmail.com>
> > Date: Tue, 29 Aug 2023 16:45:39 +0100
> >
> > It appears that inhibit-eol-conversion breaks insert-file-contents's
> > replace functionality when a change was made in the middle of the file
> > to be reverted as the file contents get duplicated in the buffer. The
> > issue can be reproduced on a fresh Emacs with a file named bug.el with
> > contents:
> >
> > ;; 1. Launch Emacs: nix run emacs-overlay#emacs-git -- bug.el -Q --load bug.el
> > ;; 2. Outside of Emacs, add text in below empty line:
> > ;; 3. In Emacs, revert-buffer
> >
> > (setq inhibit-eol-conversion t)
> >
> > The contents of the buffer after revert-buffer:
> >
> > ;; 1. Launch Emacs: nix run emacs-overlay#emacs-git -- bug.el -Q --load bug.el
> > ;; 2. Outside of Emacs, add text in below empty line:
> > ;; 3. In Emacs, revert-buffer
> > foo
> > (setq inhibit-eol-conversion t)
> >
> > (setq inhibit-eol-conversion t)
>
> Thanks for an easy test case. We are reading too much from the file
> on disk when reverting in this case.
>
> Po Lu, I think we need the patch below to fix this. Gerd, does this
> solve your problem as well, including the abort during bootstrap?
> Herbert, I think this could also be related to the problems you see,
> so please try the patch below.
Thanks. Unfortunately this change does not resolve my issue opening
org-files. I still have to revert 4e8d579f3da.
--
Herbert
^ permalink raw reply [flat|nested] 8+ messages in thread