unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
@ 2022-05-06 23:45 Hongyi Zhao
  2022-05-07  2:45 ` Emanuel Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-06 23:45 UTC (permalink / raw)
  To: help-gnu-emacs

I try to use Emacs to open and check the file [1], which includes one
extremely long line as follows:


$ emacs -Q symbols.ts

`M-x so-long-minor-mode RET`

At this moment, Emacs still freezes. Any hints for tackling this problem?

[1] https://github.com/feisele/vscode-gap-language-support/blob/master/src/symbols.ts

Regards
-- 
Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-06 23:45 Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled Hongyi Zhao
@ 2022-05-07  2:45 ` Emanuel Berg
  2022-05-07  7:05   ` Daniel Fleischer
  2022-05-07  6:19 ` Eli Zaretskii
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 41+ messages in thread
From: Emanuel Berg @ 2022-05-07  2:45 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao wrote:

> At this moment, Emacs still freezes. Any hints for tackling
> this problem?

Don't have files "with one extremely long line".

1. It doesn't make sense.

2. Emacs freezes.

Two reasons not to do something -> don't do it.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-06 23:45 Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled Hongyi Zhao
  2022-05-07  2:45 ` Emanuel Berg
@ 2022-05-07  6:19 ` Eli Zaretskii
  2022-05-07  6:23   ` Hongyi Zhao
  2022-05-07 12:42 ` 황병희
  2022-05-07 23:35 ` Michael Heerdegen
  3 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2022-05-07  6:19 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Sat, 7 May 2022 07:45:10 +0800
> 
> I try to use Emacs to open and check the file [1], which includes one
> extremely long line as follows:
> 
> 
> $ emacs -Q symbols.ts
> 
> `M-x so-long-minor-mode RET`
> 
> At this moment, Emacs still freezes. Any hints for tackling this problem?

It doesn't exactly freeze here, it just becomes sluggish: each cursor
movement command sometimes takes several seconds to complete.

Whether there's anything to do here depends on what you want to do
with this file; "check" doesn't really explain that.



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  6:19 ` Eli Zaretskii
@ 2022-05-07  6:23   ` Hongyi Zhao
  2022-05-07  7:09     ` Eli Zaretskii
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-07  6:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Sat, May 7, 2022 at 2:20 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Sat, 7 May 2022 07:45:10 +0800
> >
> > I try to use Emacs to open and check the file [1], which includes one
> > extremely long line as follows:
> >
> >
> > $ emacs -Q symbols.ts
> >
> > `M-x so-long-minor-mode RET`
> >
> > At this moment, Emacs still freezes. Any hints for tackling this problem?
>
> It doesn't exactly freeze here, it just becomes sluggish: each cursor
> movement command sometimes takes several seconds to complete.
>
> Whether there's anything to do here depends on what you want to do
> with this file; "check" doesn't really explain that.

I mean, for example, search for some content.

HZ



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  2:45 ` Emanuel Berg
@ 2022-05-07  7:05   ` Daniel Fleischer
  2022-05-07 14:46     ` Emanuel Berg
  0 siblings, 1 reply; 41+ messages in thread
From: Daniel Fleischer @ 2022-05-07  7:05 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg [2022-05-07 Sat 04:45] wrote:

> Don't have files "with one extremely long line".
>
> 1. It doesn't make sense.
>
> 2. Emacs freezes.

One of the cases I deal with is editing JSON files. These usually don't
have any styling information because they are text-base serialized
objects and so no newlines and can range from a few bytes to hundreds of
MB, all in a single line. Sure I can open them and "beautify" them (if
they're small) but they are automatically generated and if they require
a small edit I never use Emacs for that. So easy said than done.

-- 

Daniel Fleischer



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  6:23   ` Hongyi Zhao
@ 2022-05-07  7:09     ` Eli Zaretskii
  2022-05-07  7:33       ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2022-05-07  7:09 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Sat, 7 May 2022 14:23:40 +0800
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> On Sat, May 7, 2022 at 2:20 PM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > Whether there's anything to do here depends on what you want to do
> > with this file; "check" doesn't really explain that.
> 
> I mean, for example, search for some content.

Try "M-x toggle-truncate-lines RET".



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  7:09     ` Eli Zaretskii
@ 2022-05-07  7:33       ` Hongyi Zhao
  2022-05-07  7:36         ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-07  7:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Sat, May 7, 2022 at 3:11 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Sat, 7 May 2022 14:23:40 +0800
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >
> > On Sat, May 7, 2022 at 2:20 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > >
> > > Whether there's anything to do here depends on what you want to do
> > > with this file; "check" doesn't really explain that.
> >
> > I mean, for example, search for some content.
>
> Try "M-x toggle-truncate-lines RET".

The trouble remains.

HZ



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  7:33       ` Hongyi Zhao
@ 2022-05-07  7:36         ` Hongyi Zhao
  2022-05-07  7:43           ` Eli Zaretskii
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-07  7:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

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

On Sat, May 7, 2022 at 3:33 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Sat, May 7, 2022 at 3:11 PM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > Date: Sat, 7 May 2022 14:23:40 +0800
> > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> > >
> > > On Sat, May 7, 2022 at 2:20 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > > >
> > > > Whether there's anything to do here depends on what you want to do
> > > > with this file; "check" doesn't really explain that.
> > >
> > > I mean, for example, search for some content.
> >
> > Try "M-x toggle-truncate-lines RET".
>
> The trouble remains.

BTW, I opened it in vscode. The experience is very smooth and there
are no such problems.

> HZ

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 379518 bytes --]

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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  7:36         ` Hongyi Zhao
@ 2022-05-07  7:43           ` Eli Zaretskii
  2022-05-07  8:12             ` Hongyi Zhao
  2022-05-07 11:38             ` Leo Butler
  0 siblings, 2 replies; 41+ messages in thread
From: Eli Zaretskii @ 2022-05-07  7:43 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Sat, 7 May 2022 15:36:33 +0800
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> 
> [1:text/plain Hide]
> 
> On Sat, May 7, 2022 at 3:33 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
> >
> > On Sat, May 7, 2022 at 3:11 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > >
> > > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > > Date: Sat, 7 May 2022 14:23:40 +0800
> > > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> > > >
> > > > On Sat, May 7, 2022 at 2:20 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > > > >
> > > > > Whether there's anything to do here depends on what you want to do
> > > > > with this file; "check" doesn't really explain that.
> > > >
> > > > I mean, for example, search for some content.
> > >
> > > Try "M-x toggle-truncate-lines RET".
> >
> > The trouble remains.
> 
> BTW, I opened it in vscode. The experience is very smooth and there
> are no such problems.

Then you should post this to the VSCode forum instead.



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  7:43           ` Eli Zaretskii
@ 2022-05-07  8:12             ` Hongyi Zhao
  2022-05-07 11:38             ` Leo Butler
  1 sibling, 0 replies; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-07  8:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Sat, May 7, 2022 at 3:43 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Sat, 7 May 2022 15:36:33 +0800
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >
> >
> > [1:text/plain Hide]
> >
> > On Sat, May 7, 2022 at 3:33 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
> > >
> > > On Sat, May 7, 2022 at 3:11 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > > >
> > > > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > > > Date: Sat, 7 May 2022 14:23:40 +0800
> > > > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> > > > >
> > > > > On Sat, May 7, 2022 at 2:20 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > > > > >
> > > > > > Whether there's anything to do here depends on what you want to do
> > > > > > with this file; "check" doesn't really explain that.
> > > > >
> > > > > I mean, for example, search for some content.
> > > >
> > > > Try "M-x toggle-truncate-lines RET".
> > >
> > > The trouble remains.
> >
> > BTW, I opened it in vscode. The experience is very smooth and there
> > are no such problems.
>
> Then you should post this to the VSCode forum instead.

I don't think people there will care about such a problem.

HZ



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  7:43           ` Eli Zaretskii
  2022-05-07  8:12             ` Hongyi Zhao
@ 2022-05-07 11:38             ` Leo Butler
  2022-05-07 12:15               ` Eli Zaretskii
  2022-05-08  3:42               ` Michael Heerdegen
  1 sibling, 2 replies; 41+ messages in thread
From: Leo Butler @ 2022-05-07 11:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs@gnu.org

On Sat, May 07 2022, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Hongyi Zhao <hongyi.zhao@gmail.com>
>> Date: Sat, 7 May 2022 15:36:33 +0800
>> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>> 
>> 
>> [1:text/plain Hide]
>> 
>> On Sat, May 7, 2022 at 3:33 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>> >
>> > On Sat, May 7, 2022 at 3:11 PM Eli Zaretskii <eliz@gnu.org> wrote:
>> > >
>> > > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
>> > > > Date: Sat, 7 May 2022 14:23:40 +0800
>> > > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>> > > >
>> > > > On Sat, May 7, 2022 at 2:20 PM Eli Zaretskii <eliz@gnu.org> wrote:
>> > > > >
>> > > > > Whether there's anything to do here depends on what you want to do
>> > > > > with this file; "check" doesn't really explain that.
>> > > >
>> > > > I mean, for example, search for some content.
>> > >
>> > > Try "M-x toggle-truncate-lines RET".
>> >
>> > The trouble remains.
>> 
>> BTW, I opened it in vscode. The experience is very smooth and there
>> are no such problems.
>
> Then you should post this to the VSCode forum instead.

Eli (and Emmanuel), your answers are *unsatisfactory*. The bug Hongyi is
reporting has afflicted emacs as long as I can remember (15-20
years). It has nothing to do with vscode per se: to confirm, I opened my
.newsrc.eld file, generated by gnus. Incremental search caused emacs to
crash.

Are your answers to this problem: don't use gnus, it makes no sense; or,
use vi?

Leo


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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07 11:38             ` Leo Butler
@ 2022-05-07 12:15               ` Eli Zaretskii
  2022-05-08  3:42               ` Michael Heerdegen
  1 sibling, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2022-05-07 12:15 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Leo Butler <Leo.Butler@umanitoba.ca>
> CC: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> Date: Sat, 7 May 2022 11:38:36 +0000
> 
> On Sat, May 07 2022, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> >> BTW, I opened it in vscode. The experience is very smooth and there
> >> are no such problems.
> >
> > Then you should post this to the VSCode forum instead.
> 
> Eli (and Emmanuel), your answers are *unsatisfactory*.

I didn't answer any questions in what I wrote above, so I don't think
I understand what you are alluding to here.

> The bug Hongyi is reporting has afflicted emacs as long as I can
> remember (15-20 years). It has nothing to do with vscode per se: to
> confirm, I opened my .newsrc.eld file, generated by
> gnus. Incremental search caused emacs to crash.
> 
> Are your answers to this problem: don't use gnus, it makes no sense; or,
> use vi?

If some command crashes Emacs, please submit a bug report using "M-x
report-emacs-bug RET", per the documentation.

The OP described slow responses, not a crash.  The problem with
extremely slow redisplay when lines are long is well known, and
patches to fix it are welcome, if someone knows how to do that.  Over
the years, I had my share of fixes in that area, which improved
things, but evidently not enough.



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-06 23:45 Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled Hongyi Zhao
  2022-05-07  2:45 ` Emanuel Berg
  2022-05-07  6:19 ` Eli Zaretskii
@ 2022-05-07 12:42 ` 황병희
  2022-05-07 23:35 ` Michael Heerdegen
  3 siblings, 0 replies; 41+ messages in thread
From: 황병희 @ 2022-05-07 12:42 UTC (permalink / raw)
  To: help-gnu-emacs

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

> [1]
> https://github.com/feisele/vscode-gap-language-support/blob/master/src/symbols.ts

I have no problem. GNU Emacs 27.1 under Debian 11 Bullseye (Google
Chromebook MT8173). Attached screenshot:


[-- Attachment #2: symbols.ts with emacs --]
[-- Type: image/png, Size: 509294 bytes --]

[-- Attachment #3: Type: text/plain, Size: 97 bytes --]



Sincerely, Gnus fan Byung-Hee

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//

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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07  7:05   ` Daniel Fleischer
@ 2022-05-07 14:46     ` Emanuel Berg
  0 siblings, 0 replies; 41+ messages in thread
From: Emanuel Berg @ 2022-05-07 14:46 UTC (permalink / raw)
  To: help-gnu-emacs

Daniel Fleischer wrote:

>> Don't have files "with one extremely long line".
>>
>> 1. It doesn't make sense.
>>
>> 2. Emacs freezes.
>
> One of the cases I deal with is editing JSON files.
> These usually don't have any styling information because
> they are text-base serialized objects and so no newlines and
> can range from a few bytes to hundreds of MB, all in
> a single line.

Not good.

> Sure I can open them and "beautify" them

Sure, but you shouldn't need to.

> but they are automatically generated

Nuclear missile 1: - Target area identified.

Nuclear missile 2: - Here is where we need to blow up.

Nuclear missile 3: - Auto-generated is all well and good but
tell the program that does it not to create a file like that.

Nuclear missiles 1 & 2: - ...

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-06 23:45 Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled Hongyi Zhao
                   ` (2 preceding siblings ...)
  2022-05-07 12:42 ` 황병희
@ 2022-05-07 23:35 ` Michael Heerdegen
  2022-05-08  0:10   ` Hongyi Zhao
  3 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-07 23:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> I try to use Emacs to open and check the file [1], which includes one
> extremely long line as follows:
>
>
> $ emacs -Q symbols.ts
>
> `M-x so-long-minor-mode RET`
>
> At this moment, Emacs still freezes. Any hints for tackling this
> problem?

M-x global-so-long-mode helps.  Emacs opens the file in fundamental
mode anyway, so maybe `so-long-mode' as major mode is acceptable.

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07 23:35 ` Michael Heerdegen
@ 2022-05-08  0:10   ` Hongyi Zhao
  2022-05-08  0:49     ` Michael Heerdegen
  2022-05-08  5:31     ` Eli Zaretskii
  0 siblings, 2 replies; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-08  0:10 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

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

On Sun, May 8, 2022 at 7:35 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > I try to use Emacs to open and check the file [1], which includes one
> > extremely long line as follows:
> >
> >
> > $ emacs -Q symbols.ts
> >
> > `M-x so-long-minor-mode RET`
> >
> > At this moment, Emacs still freezes. Any hints for tackling this
> > problem?
>
> M-x global-so-long-mode helps.  Emacs opens the file in fundamental
> mode anyway, so maybe `so-long-mode' as major mode is acceptable.

I've already enabled both modes, but the problem remains, as shown in
the attached file.

> Michael.

HZ

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 201506 bytes --]

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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  0:10   ` Hongyi Zhao
@ 2022-05-08  0:49     ` Michael Heerdegen
  2022-05-08  2:54       ` Hongyi Zhao
  2022-05-08  5:31     ` Eli Zaretskii
  1 sibling, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-08  0:49 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:


> I've already enabled both modes, but the problem remains, as shown in
> the attached file.

You mean that the major mode is `so-long-mode' (not visible in your
screenshot)?  With that, the behavior is acceptable in emacs -Q for me.
With the minor-mode, it's not.

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  0:49     ` Michael Heerdegen
@ 2022-05-08  2:54       ` Hongyi Zhao
  2022-05-08  3:31         ` Michael Heerdegen
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-08  2:54 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

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

On Sun, May 8, 2022 at 8:49 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
>
> > I've already enabled both modes, but the problem remains, as shown in
> > the attached file.
>
> You mean that the major mode is `so-long-mode' (not visible in your
> screenshot)?  With that, the behavior is acceptable in emacs -Q for me.
> With the minor-mode, it's not.

I mean, both of the following methods will freeze Emacs, as shown in
the attached files:

$ emacs -Q /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
`M-x global-so-long-mode RET`

$ emacs -Q /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
`M-x so-long-minor-mode RET`

> Michael.

HZ

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 214256 bytes --]

[-- Attachment #3: image.png --]
[-- Type: image/png, Size: 220921 bytes --]

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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  2:54       ` Hongyi Zhao
@ 2022-05-08  3:31         ` Michael Heerdegen
  2022-05-08  3:58           ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-08  3:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> I mean, both of the following methods will freeze Emacs, as shown in
> the attached files:

> $ emacs -Q
> /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
> `M-x global-so-long-mode RET`

This can't work, the file is already opened then.

> $ emacs -Q
> /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
> `M-x so-long-minor-mode RET`

The major mode works better for that file: M-x so-long-mode RET.

I can't say much about the background, I never checked the
implementation of those modes.

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-07 11:38             ` Leo Butler
  2022-05-07 12:15               ` Eli Zaretskii
@ 2022-05-08  3:42               ` Michael Heerdegen
  1 sibling, 0 replies; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-08  3:42 UTC (permalink / raw)
  To: help-gnu-emacs

Leo Butler <Leo.Butler@umanitoba.ca> writes:

> to confirm, I opened my .newsrc.eld file, generated by
> gnus. Incremental search caused emacs to crash.

Yeah, that freezing sucks.  Works ok with explicit M-x so-long-mode,
however.

I wonder why having global-so-long-mode enabled is not sufficient in
these cases.


Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  3:31         ` Michael Heerdegen
@ 2022-05-08  3:58           ` Hongyi Zhao
  2022-05-08  4:11             ` Michael Heerdegen
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-08  3:58 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

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

On Sun, May 8, 2022 at 11:32 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > I mean, both of the following methods will freeze Emacs, as shown in
> > the attached files:
>
> > $ emacs -Q
> > /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
> > `M-x global-so-long-mode RET`
>
> This can't work, the file is already opened then.

What do you mean by saying this?

> > $ emacs -Q
> > /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
> > `M-x so-long-minor-mode RET`
>
> The major mode works better for that file: M-x so-long-mode RET.

Still frozen. For details, see the attachment.

> I can't say much about the background, I never checked the
> implementation of those modes.
>
> Michael.
>
>

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 215592 bytes --]

[-- Attachment #3: image.png --]
[-- Type: image/png, Size: 150362 bytes --]

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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  3:58           ` Hongyi Zhao
@ 2022-05-08  4:11             ` Michael Heerdegen
  2022-05-08  4:18               ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-08  4:11 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> > > $ emacs -Q
> > > /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
> > > `M-x global-so-long-mode RET`
> >
> > This can't work, the file is already opened then.
>
> What do you mean by saying this?

global-so-long-mode has only an affect for files opened later, not files
that are already opened.

> > The major mode works better for that file: M-x so-long-mode RET.
>
> Still frozen. For details, see the attachment.

Hmm, strange.  I tested in Emacs 27.1 from Debian and recent built of
master, and with so-long-mode explicitly enabled performance is very far
from a freeze.

What's your Emacs version?

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  4:11             ` Michael Heerdegen
@ 2022-05-08  4:18               ` Hongyi Zhao
  2022-05-08  4:38                 ` Michael Heerdegen
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-08  4:18 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Sun, May 8, 2022 at 12:11 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > > > $ emacs -Q
> > > > /home/werner/Public/repo/github.com/feisele/vscode-gap-language-support.git/src/symbols.ts
> > > > `M-x global-so-long-mode RET`
> > >
> > > This can't work, the file is already opened then.
> >
> > What do you mean by saying this?
>
> global-so-long-mode has only an affect for files opened later, not files
> that are already opened.
>
> > > The major mode works better for that file: M-x so-long-mode RET.
> >
> > Still frozen. For details, see the attachment.
>
> Hmm, strange.  I tested in Emacs 27.1 from Debian and recent built of
> master, and with so-long-mode explicitly enabled performance is very far
> from a freeze.
>
> What's your Emacs version?

`M-x emacs-version RET`

GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
cairo version 1.16.0) of 2021-11-14

>
> Michael.

HZ



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  4:18               ` Hongyi Zhao
@ 2022-05-08  4:38                 ` Michael Heerdegen
  2022-05-08  4:56                   ` Michael Heerdegen
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-08  4:38 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> `M-x emacs-version RET`
>
> GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
> cairo version 1.16.0) of 2021-11-14

No idea.  Not much in so-long.el has changed since then.  Strange...

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  4:38                 ` Michael Heerdegen
@ 2022-05-08  4:56                   ` Michael Heerdegen
  2022-05-08  5:35                     ` Michael Heerdegen
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-08  4:56 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> No idea.  Not much in so-long.el has changed since then.  Strange...

But when I move to larger positions, Emacs also get more and more
sluggish for me, too.  Not usable near the end of the buffer.

I suggest to try M-: (require 'longlines) RET M-x longlines-mode RET.

longlines an obsolete package.  I wonder if that's good.  Seems superior
in this case.

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  0:10   ` Hongyi Zhao
  2022-05-08  0:49     ` Michael Heerdegen
@ 2022-05-08  5:31     ` Eli Zaretskii
  2022-05-08  5:38       ` Hongyi Zhao
  1 sibling, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2022-05-08  5:31 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Sun, 8 May 2022 08:10:25 +0800
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> > > `M-x so-long-minor-mode RET`
> > >
> > > At this moment, Emacs still freezes. Any hints for tackling this
> > > problem?
> >
> > M-x global-so-long-mode helps.  Emacs opens the file in fundamental
> > mode anyway, so maybe `so-long-mode' as major mode is acceptable.
> 
> I've already enabled both modes, but the problem remains, as shown in
> the attached file.

Did you try setting line-move-visual to nil, in addition to the other
measures?



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  4:56                   ` Michael Heerdegen
@ 2022-05-08  5:35                     ` Michael Heerdegen
  2022-05-08  5:47                       ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-08  5:35 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I suggest to try M-: (require 'longlines) RET M-x longlines-mode RET.

Please try with these settings:

  (setq-default so-long-target-modes t)
  (setq-default so-long-action 'longlines-mode)
  (setq-default longlines-show-hard-newlines t)
  (global-so-long-mode +1)

That should make opening and editing your file work ok out of the box.
All newlines not explicitly indicated (most of them) are "virtual" and
not included when saving.

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  5:31     ` Eli Zaretskii
@ 2022-05-08  5:38       ` Hongyi Zhao
  2022-05-08  5:53         ` Eli Zaretskii
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-08  5:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Sun, May 8, 2022 at 1:32 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Sun, 8 May 2022 08:10:25 +0800
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >
> > > > `M-x so-long-minor-mode RET`
> > > >
> > > > At this moment, Emacs still freezes. Any hints for tackling this
> > > > problem?
> > >
> > > M-x global-so-long-mode helps.  Emacs opens the file in fundamental
> > > mode anyway, so maybe `so-long-mode' as major mode is acceptable.
> >
> > I've already enabled both modes, but the problem remains, as shown in
> > the attached file.
>
> Did you try setting line-move-visual to nil, in addition to the other
> measures?
>

Tried the following, but doesn't work:

`M-: (setq line-move-visual nil) RET'
`M-x so-long-mode RET'



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  5:35                     ` Michael Heerdegen
@ 2022-05-08  5:47                       ` Hongyi Zhao
  2022-05-09  4:53                         ` Michael Heerdegen
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-08  5:47 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

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

On Sun, May 8, 2022 at 1:36 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
> > I suggest to try M-: (require 'longlines) RET M-x longlines-mode RET.
>
> Please try with these settings:
>
>   (setq-default so-long-target-modes t)
>   (setq-default so-long-action 'longlines-mode)
>   (setq-default longlines-show-hard-newlines t)
>   (global-so-long-mode +1)

Wonderful trick. This works smoothly. See the attached file for more details.

> That should make opening and editing your file work ok out of the box.
> All newlines not explicitly indicated (most of them) are "virtual" and
> not included when saving.

But I'm currently using the following configuration in my
`~/.emacs.d/init.el`, I wonder how to merge your above tricks into
them, as shown below:

```
(use-package so-long
  :config
  ;; https://elpa.gnu.org/packages/so-long.html
  ;; * Example configuration
  ;; -----------------------
  ;; If you prefer to configure in code rather than via the customize interface,
  ;; then you might use something along these lines:

  ;; Enable so-long library.
  (when (require 'so-long nil :noerror)
    (global-so-long-mode 1)
    ;; Basic settings.
    (setq so-long-action 'so-long-minor-mode)
    (setq so-long-threshold 1000)
    (setq so-long-max-lines 100)
    ;; Additional target major modes to trigger for.
    (mapc (apply-partially #'add-to-list 'so-long-target-modes)
          '(sgml-mode nxml-mode))
    ;; Additional buffer-local minor modes to disable.
    (mapc (apply-partially #'add-to-list 'so-long-minor-modes)
          '(diff-hl-mode diff-hl-amend-mode diff-hl-flydiff-mode))
    ;; Additional variables to override.
    (mapc (apply-partially #'add-to-list 'so-long-variable-overrides)
          '((show-trailing-whitespace . nil)
            (truncate-lines . nil))))
  )
```

> Michael.

Yours,
HZ

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 151229 bytes --]

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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  5:38       ` Hongyi Zhao
@ 2022-05-08  5:53         ` Eli Zaretskii
  2022-05-08  7:29           ` Hongyi Zhao
                             ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Eli Zaretskii @ 2022-05-08  5:53 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Sun, 8 May 2022 13:38:08 +0800
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> On Sun, May 8, 2022 at 1:32 PM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > Did you try setting line-move-visual to nil, in addition to the other
> > measures?
> >
> 
> Tried the following, but doesn't work:
> 
> `M-: (setq line-move-visual nil) RET'
> `M-x so-long-mode RET'

That's not what I suggested.  I suggested this:

  C-x C-f symbols.ts RET
  M-x so-long-minor-mode RET
  M-x toggle-truncate-lines RET
  M-x set-variable RET line-move-visual RET nil RET

And please provide more quantitative description of the effect of the
above settings on Emacs responsiveness.  "Doesn't work" has very low
informational value.  Do you see any effect on cursor motion? does it
get faster? a little bit faster? not faster at all? slower? something
else?

If the above settings don't help to make Emacs even a bit faster,
please describe what exactly are you doing to get Emacs to freeze: are
you moving in that file (and if so, with which commands or keys), are
you editing the file (and if so, with which commands), are you doing
something else?  Because I cannot understand how it is possible that
the above settings have no effect whatsoever on the Emacs
responsiveness, and your responses until now were not detailed enough
to figure that out.



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  5:53         ` Eli Zaretskii
@ 2022-05-08  7:29           ` Hongyi Zhao
  2022-05-09  4:54             ` Michael Heerdegen
  2022-05-09  9:48           ` Manuel Giraud
  2022-05-11  6:33           ` Michael Heerdegen
  2 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-08  7:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

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

On Sun, May 8, 2022 at 1:53 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Sun, 8 May 2022 13:38:08 +0800
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >
> > On Sun, May 8, 2022 at 1:32 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > >
> > > Did you try setting line-move-visual to nil, in addition to the other
> > > measures?
> > >
> >
> > Tried the following, but doesn't work:
> >
> > `M-: (setq line-move-visual nil) RET'
> > `M-x so-long-mode RET'
>
> That's not what I suggested.  I suggested this:
>
>   C-x C-f symbols.ts RET
>   M-x so-long-minor-mode RET
>   M-x toggle-truncate-lines RET
>   M-x set-variable RET line-move-visual RET nil RET

I tried the above commands one-by-one, and the Emacs responsiveness is
still sluggish when drag the scrollbar to browser the different part
of the buffer or the lower right corner of the window to zoom in/out,
as indicated in the attached file.

But as suggested by Michael Heerdegen <michael_heerdegen@web.de>, the
following code snippet will give me a very smooth experience, also as
shown in the attached file:

(setq-default so-long-target-modes t)
(setq-default so-long-action 'longlines-mode)
(setq-default longlines-show-hard-newlines t)
(global-so-long-mode +1)


> And please provide more quantitative description of the effect of the
> above settings on Emacs responsiveness.  "Doesn't work" has very low
> informational value.  Do you see any effect on cursor motion? does it
> get faster? a little bit faster? not faster at all? slower? something
> else?
>
> If the above settings don't help to make Emacs even a bit faster,
> please describe what exactly are you doing to get Emacs to freeze: are
> you moving in that file (and if so, with which commands or keys), are
> you editing the file (and if so, with which commands), are you doing
> something else?  Because I cannot understand how it is possible that
> the above settings have no effect whatsoever on the Emacs
> responsiveness, and your responses until now were not detailed enough
> to figure that out.

See the above description.

Regards,
HZ

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 245898 bytes --]

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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  5:47                       ` Hongyi Zhao
@ 2022-05-09  4:53                         ` Michael Heerdegen
  2022-05-09  6:48                           ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-09  4:53 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> But I'm currently using the following configuration in my
> `~/.emacs.d/init.el`, I wonder how to merge your above tricks into
> them, as shown below: [...]

I've only limited experience with this stuff.  What questions do you
have specifically?

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  7:29           ` Hongyi Zhao
@ 2022-05-09  4:54             ` Michael Heerdegen
  2022-05-09  6:41               ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-09  4:54 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> I tried the above commands one-by-one, and the Emacs responsiveness is
> still sluggish when drag the scrollbar to browser the different part
> of the buffer or the lower right corner of the window to zoom in/out,
> as indicated in the attached file.

But near the beginning of the buffer (and only there) it's ok?  That's
what I experience.

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-09  4:54             ` Michael Heerdegen
@ 2022-05-09  6:41               ` Hongyi Zhao
  2022-05-10  2:07                 ` Michael Heerdegen
  0 siblings, 1 reply; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-09  6:41 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 9, 2022 at 12:55 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > I tried the above commands one-by-one, and the Emacs responsiveness is
> > still sluggish when drag the scrollbar to browser the different part
> > of the buffer or the lower right corner of the window to zoom in/out,
> > as indicated in the attached file.
>
> But near the beginning of the buffer (and only there) it's ok?  That's
> what I experience.

Basically, as soon as I drag the scroll bar or zoom the window, the
problem occurs.

> Michael.

HZ



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-09  4:53                         ` Michael Heerdegen
@ 2022-05-09  6:48                           ` Hongyi Zhao
  0 siblings, 0 replies; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-09  6:48 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 9, 2022 at 12:53 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > But I'm currently using the following configuration in my
> > `~/.emacs.d/init.el`, I wonder how to merge your above tricks into
> > them, as shown below: [...]
>
> I've only limited experience with this stuff.

According to the suggestion given by the author of so-long package, I
changed to the following configuration now:

(use-package so-long
  :config
  (setq-default so-long-action 'longlines-mode)
  (setq-default longlines-show-hard-newlines t)
  (global-so-long-mode +1)
  )

See here [1] for the related discussion some time ago on the list.

> What questions do you have specifically?

Not at the moment.

[1] https://lists.gnu.org/archive/html/help-gnu-emacs/2022-03/msg00511.html

> Michael.

HZ



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  5:53         ` Eli Zaretskii
  2022-05-08  7:29           ` Hongyi Zhao
@ 2022-05-09  9:48           ` Manuel Giraud
  2022-05-11  6:33           ` Michael Heerdegen
  2 siblings, 0 replies; 41+ messages in thread
From: Manuel Giraud @ 2022-05-09  9:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Hi,

FWIW, for me™, it seems that it is the longlines-mode that does the
trick. It has an entry to be activated in the so-long menu. It seems to
be the way to go if you have to edit such a beast.
-- 
Manuel Giraud



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-09  6:41               ` Hongyi Zhao
@ 2022-05-10  2:07                 ` Michael Heerdegen
  2022-05-10  2:26                   ` Hongyi Zhao
  0 siblings, 1 reply; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-10  2:07 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Basically, as soon as I drag the scroll bar or zoom the window, the
> problem occurs.

What does "zoom the window" mean - window resizing?  Resizing the window
doesn't trigger sluggishness for me.

Michael.




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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-10  2:07                 ` Michael Heerdegen
@ 2022-05-10  2:26                   ` Hongyi Zhao
  0 siblings, 0 replies; 41+ messages in thread
From: Hongyi Zhao @ 2022-05-10  2:26 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Tue, May 10, 2022 at 10:07 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Basically, as soon as I drag the scroll bar or zoom the window, the
> > problem occurs.
>
> What does "zoom the window" mean - window resizing?

Yes, exactly.

>  Resizing the window doesn't trigger sluggishness for me.
>
> Michael.

HZ



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-08  5:53         ` Eli Zaretskii
  2022-05-08  7:29           ` Hongyi Zhao
  2022-05-09  9:48           ` Manuel Giraud
@ 2022-05-11  6:33           ` Michael Heerdegen
  2022-05-11  8:21             ` Manuel Giraud
  2022-05-11 11:27             ` Eli Zaretskii
  2 siblings, 2 replies; 41+ messages in thread
From: Michael Heerdegen @ 2022-05-11  6:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>   C-x C-f symbols.ts RET
>   M-x so-long-minor-mode RET
>   M-x toggle-truncate-lines RET <---
>   M-x set-variable RET line-move-visual RET nil RET

Is the "<--" marked step intended? - that makes Emacs show the huge file
in only one visual line?

I left it out for now and tested with the rest.  Moving around in the
buffer is not smooth but works more or less ok, isearch also.  But
moving the scroll-bar makes Emacs unresponsive for a very long time (I
waited for 20 seconds then tried to abort with C-g.  One very annoying
problem in these cases is that C-g doesn't help you.)

Unless we still didn't try correctly what you suggested, or we have
found a very untypical case, the second thing I want to say is that it
looks like it could have been a mistake to obsolete longlines.  Even if
Emacs can now better handle files with long lines, I have the impression
that we can still not offer the same user experience longlines offers.

Michael.



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-11  6:33           ` Michael Heerdegen
@ 2022-05-11  8:21             ` Manuel Giraud
  2022-05-11 11:27             ` Eli Zaretskii
  1 sibling, 0 replies; 41+ messages in thread
From: Manuel Giraud @ 2022-05-11  8:21 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Eli Zaretskii, help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

[...]

> Unless we still didn't try correctly what you suggested, or we have
> found a very untypical case, the second thing I want to say is that it
> looks like it could have been a mistake to obsolete longlines.  Even if
> Emacs can now better handle files with long lines, I have the impression
> that we can still not offer the same user experience longlines offers.

I'm not editing this kind of files myself but i agree that longlines
seems clever enough and, by splitting on `fill-column' and the SPACE
character, can even give a more pleasant experience then VS Code itself.
-- 
Manuel Giraud



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

* Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
  2022-05-11  6:33           ` Michael Heerdegen
  2022-05-11  8:21             ` Manuel Giraud
@ 2022-05-11 11:27             ` Eli Zaretskii
  1 sibling, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2022-05-11 11:27 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: help-gnu-emacs@gnu.org
> Date: Wed, 11 May 2022 08:33:59 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >   C-x C-f symbols.ts RET
> >   M-x so-long-minor-mode RET
> >   M-x toggle-truncate-lines RET <---
> >   M-x set-variable RET line-move-visual RET nil RET
> 
> Is the "<--" marked step intended? - that makes Emacs show the huge file
> in only one visual line?

Yes, it's intended: it makes Emacs more responsive here (for cursor
motion commands).  And of course, not every such file has just one
long line.

> moving the scroll-bar makes Emacs unresponsive for a very long time (I
> waited for 20 seconds then tried to abort with C-g.

I think I see why, and will try to look into that.

> Unless we still didn't try correctly what you suggested, or we have
> found a very untypical case, the second thing I want to say is that it
> looks like it could have been a mistake to obsolete longlines.  Even if
> Emacs can now better handle files with long lines, I have the impression
> that we can still not offer the same user experience longlines offers.

Feel free to suggest that, just not here.



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

end of thread, other threads:[~2022-05-11 11:27 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-06 23:45 Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled Hongyi Zhao
2022-05-07  2:45 ` Emanuel Berg
2022-05-07  7:05   ` Daniel Fleischer
2022-05-07 14:46     ` Emanuel Berg
2022-05-07  6:19 ` Eli Zaretskii
2022-05-07  6:23   ` Hongyi Zhao
2022-05-07  7:09     ` Eli Zaretskii
2022-05-07  7:33       ` Hongyi Zhao
2022-05-07  7:36         ` Hongyi Zhao
2022-05-07  7:43           ` Eli Zaretskii
2022-05-07  8:12             ` Hongyi Zhao
2022-05-07 11:38             ` Leo Butler
2022-05-07 12:15               ` Eli Zaretskii
2022-05-08  3:42               ` Michael Heerdegen
2022-05-07 12:42 ` 황병희
2022-05-07 23:35 ` Michael Heerdegen
2022-05-08  0:10   ` Hongyi Zhao
2022-05-08  0:49     ` Michael Heerdegen
2022-05-08  2:54       ` Hongyi Zhao
2022-05-08  3:31         ` Michael Heerdegen
2022-05-08  3:58           ` Hongyi Zhao
2022-05-08  4:11             ` Michael Heerdegen
2022-05-08  4:18               ` Hongyi Zhao
2022-05-08  4:38                 ` Michael Heerdegen
2022-05-08  4:56                   ` Michael Heerdegen
2022-05-08  5:35                     ` Michael Heerdegen
2022-05-08  5:47                       ` Hongyi Zhao
2022-05-09  4:53                         ` Michael Heerdegen
2022-05-09  6:48                           ` Hongyi Zhao
2022-05-08  5:31     ` Eli Zaretskii
2022-05-08  5:38       ` Hongyi Zhao
2022-05-08  5:53         ` Eli Zaretskii
2022-05-08  7:29           ` Hongyi Zhao
2022-05-09  4:54             ` Michael Heerdegen
2022-05-09  6:41               ` Hongyi Zhao
2022-05-10  2:07                 ` Michael Heerdegen
2022-05-10  2:26                   ` Hongyi Zhao
2022-05-09  9:48           ` Manuel Giraud
2022-05-11  6:33           ` Michael Heerdegen
2022-05-11  8:21             ` Manuel Giraud
2022-05-11 11:27             ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).