From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Emacs freezes when editing a file with one extremely long line even with so-long-minor-mode enabled.
Date: Sun, 8 May 2022 13:47:33 +0800 [thread overview]
Message-ID: <CAGP6POKe1gMbKmvJepX5jOKuDnFxhF6SW6wE-1GCuEBiWQp15g@mail.gmail.com> (raw)
In-Reply-To: <87o808oac7.fsf@web.de>
[-- 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 --]
next prev parent reply other threads:[~2022-05-08 5:47 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGP6POKe1gMbKmvJepX5jOKuDnFxhF6SW6wE-1GCuEBiWQp15g@mail.gmail.com \
--to=hongyi.zhao@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/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.
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).