* Edit huge files in Emacs.
@ 2022-03-26 14:19 Hongyi Zhao
2022-03-26 14:44 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2022-03-26 14:19 UTC (permalink / raw)
To: help-gnu-emacs
I downloaded the file DASGMachineReadable.txt [1] from its official
website [2-3].
This file is very large, as shown below:
$ du -h DASGMachineReadable.txt
28M DASGMachineReadable.txt
$ wc DASGMachineReadable.txt
306319 12775096 28535028 DASGMachineReadable.txt
When I try to open and edit the file using Emacs, Emacs gets stuck and
basically doesn't work. Any suggestions for solving this problem?
[1] https://github.com/hongyi-zhao/temp/blob/master/emacs/DASGMachineReadable.txt
[2] https://sites.psu.edu/gopalan/resources/
[3] https://sites.psu.edu/gopalan/wp-content/uploads/sites/2996/2013/02/DASG-Machine-Readable.zip
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] 7+ messages in thread
* Re: Edit huge files in Emacs.
2022-03-26 14:19 Edit huge files in Emacs Hongyi Zhao
@ 2022-03-26 14:44 ` Eli Zaretskii
2022-03-26 14:56 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-03-26 14:44 UTC (permalink / raw)
To: help-gnu-emacs
> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Sat, 26 Mar 2022 22:19:16 +0800
>
> I downloaded the file DASGMachineReadable.txt [1] from its official
> website [2-3].
> This file is very large, as shown below:
>
> $ du -h DASGMachineReadable.txt
> 28M DASGMachineReadable.txt
>
> $ wc DASGMachineReadable.txt
> 306319 12775096 28535028 DASGMachineReadable.txt
28MB is a far cry from "very large".
> When I try to open and edit the file using Emacs, Emacs gets stuck and
> basically doesn't work.
I cannot reproduce this. I see no problem whatsoever with this file,
using Emacs 28. It seems to be an HTML file, but I don't see any
problems even if I turn on html-mode.
> Any suggestions for solving this problem?
Try visiting it in "emacs -Q". If the problem disappears, look for
some customization(s) of your that make visiting this file so painful.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Edit huge files in Emacs.
2022-03-26 14:44 ` Eli Zaretskii
@ 2022-03-26 14:56 ` Hongyi Zhao
2022-03-26 15:20 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2022-03-26 14:56 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
On Sat, Mar 26, 2022 at 10:44 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Sat, 26 Mar 2022 22:19:16 +0800
> >
> > I downloaded the file DASGMachineReadable.txt [1] from its official
> > website [2-3].
> > This file is very large, as shown below:
> >
> > $ du -h DASGMachineReadable.txt
> > 28M DASGMachineReadable.txt
> >
> > $ wc DASGMachineReadable.txt
> > 306319 12775096 28535028 DASGMachineReadable.txt
>
> 28MB is a far cry from "very large".
>
> > When I try to open and edit the file using Emacs, Emacs gets stuck and
> > basically doesn't work.
>
> I cannot reproduce this. I see no problem whatsoever with this file,
> using Emacs 28. It seems to be an HTML file, but I don't see any
> problems even if I turn on html-mode.
>
> > Any suggestions for solving this problem?
>
> Try visiting it in "emacs -Q". If the problem disappears, look for
> some customization(s) of your that make visiting this file so painful.
I tried to visit it in "emacs -Q". When I drag the scroll bar, Emacs
stops responding. As shown in the attachment.
[-- Attachment #2: Selection_050.png --]
[-- Type: image/png, Size: 81502 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Edit huge files in Emacs.
2022-03-26 14:56 ` Hongyi Zhao
@ 2022-03-26 15:20 ` Eli Zaretskii
2022-03-27 1:51 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-03-26 15:20 UTC (permalink / raw)
To: help-gnu-emacs
> From: Hongyi Zhao <hongyi.zhao@gmail.com>
> Date: Sat, 26 Mar 2022 22:56:31 +0800
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>
> I tried to visit it in "emacs -Q". When I drag the scroll bar, Emacs
> stops responding. As shown in the attachment.
That's a different file, not the one you originally pointed to.
This one has some very long lines, which is known to slow down
redisplay in Emacs so my advice is to enable the so-long-minor-mode
after visiting it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Edit huge files in Emacs.
2022-03-26 15:20 ` Eli Zaretskii
@ 2022-03-27 1:51 ` Hongyi Zhao
2022-03-29 8:48 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2022-03-27 1:51 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On Sat, Mar 26, 2022 at 11:21 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > Date: Sat, 26 Mar 2022 22:56:31 +0800
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >
> > I tried to visit it in "emacs -Q". When I drag the scroll bar, Emacs
> > stops responding. As shown in the attachment.
>
> That's a different file, not the one you originally pointed to.
Strange, in this discussion, I always point to the same file [1] which
is extracted from DASG-Machine-Readable.zip [2].
> This one has some very long lines, which is known to slow down
> redisplay in Emacs so my advice is to enable the so-long-minor-mode
> after visiting it.
Good. That solves the problem.
[1] https://github.com/hongyi-zhao/temp/blob/master/emacs/DASGMachineReadable.txt
[2] https://sites.psu.edu/gopalan/wp-content/uploads/sites/2996/2013/02/DASG-Machine-Readable.zip
Regards,
HZ
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Edit huge files in Emacs.
2022-03-27 1:51 ` Hongyi Zhao
@ 2022-03-29 8:48 ` Hongyi Zhao
2022-03-29 9:01 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2022-03-29 8:48 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On Sun, Mar 27, 2022 at 9:51 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Sat, Mar 26, 2022 at 11:21 PM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > Date: Sat, 26 Mar 2022 22:56:31 +0800
> > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> > >
> > > I tried to visit it in "emacs -Q". When I drag the scroll bar, Emacs
> > > stops responding. As shown in the attachment.
> >
> > That's a different file, not the one you originally pointed to.
>
> Strange, in this discussion, I always point to the same file [1] which
> is extracted from DASG-Machine-Readable.zip [2].
>
> > This one has some very long lines, which is known to slow down
> > redisplay in Emacs so my advice is to enable the so-long-minor-mode
> > after visiting it.
>
> Good. That solves the problem.
BTW, according to the guidance here [1], I also tried with the
following configuration in my `~/.emacs.d/init.el`, but it can't solve
the problem discussed here:
(global-so-long-mode 1)
I am very confused about the difference between the
`so-long-minor-mode` and the `global-so-long-mode`.
[1] https://www.emacswiki.org/emacs/SoLong#h5o-6
Regards,
HZ
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Edit huge files in Emacs.
2022-03-29 8:48 ` Hongyi Zhao
@ 2022-03-29 9:01 ` Hongyi Zhao
0 siblings, 0 replies; 7+ messages in thread
From: Hongyi Zhao @ 2022-03-29 9:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On Tue, Mar 29, 2022 at 4:48 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Sun, Mar 27, 2022 at 9:51 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
> >
> > On Sat, Mar 26, 2022 at 11:21 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > >
> > > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > > Date: Sat, 26 Mar 2022 22:56:31 +0800
> > > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> > > >
> > > > I tried to visit it in "emacs -Q". When I drag the scroll bar, Emacs
> > > > stops responding. As shown in the attachment.
> > >
> > > That's a different file, not the one you originally pointed to.
> >
> > Strange, in this discussion, I always point to the same file [1] which
> > is extracted from DASG-Machine-Readable.zip [2].
> >
> > > This one has some very long lines, which is known to slow down
> > > redisplay in Emacs so my advice is to enable the so-long-minor-mode
> > > after visiting it.
> >
> > Good. That solves the problem.
>
> BTW, according to the guidance here [1], I also tried with the
> following configuration in my `~/.emacs.d/init.el`, but it can't solve
> the problem discussed here:
>
> (global-so-long-mode 1)
I also tried the following configuration excerpted from the so-long
package's official website [1], but still failed to let Emacs do the
trick automatically:
```
(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))))
)
```
[1] https://elpa.gnu.org/packages/so-long.html
> I am very confused about the difference between the
> `so-long-minor-mode` and the `global-so-long-mode`.
>
> [1] https://www.emacswiki.org/emacs/SoLong#h5o-6
>
> Regards,
> HZ
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-03-29 9:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-26 14:19 Edit huge files in Emacs Hongyi Zhao
2022-03-26 14:44 ` Eli Zaretskii
2022-03-26 14:56 ` Hongyi Zhao
2022-03-26 15:20 ` Eli Zaretskii
2022-03-27 1:51 ` Hongyi Zhao
2022-03-29 8:48 ` Hongyi Zhao
2022-03-29 9:01 ` Hongyi Zhao
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).