help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Edit huge files in Emacs.


From: Hongyi Zhao
Subject: Re: Edit huge files in Emacs.
Date: Tue, 29 Mar 2022 17:01:21 +0800

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]