From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs freezes again when I try to open a file including only one very long line.
Date: Thu, 30 Jun 2022 16:40:07 +0300 [thread overview]
Message-ID: <8335fm5ky0.fsf@gnu.org> (raw)
In-Reply-To: <87h742741e.fsf@elite.giraud> (message from Manuel Giraud on Thu, 30 Jun 2022 14:02:21 +0200)
> From: Manuel Giraud <manuel@ledu-giraud.fr>
> Cc: help-gnu-emacs@gnu.org
> Date: Thu, 30 Jun 2022 14:02:21 +0200
>
> And that's it. It works on the "__tmp.symbols" file by modifying those
> two functions in "longlines.el" as follow (here I've just changed the
> string " " to "|"):
>
> --8<---------------cut here---------------start------------->8---
> (defun longlines-find-break-backward ()
> "Move point backward to the first available breakpoint and return t.
> If no breakpoint is found, return nil."
> (and (search-backward "|" (line-beginning-position) 1)
> (save-excursion
> (skip-chars-backward "|" (line-beginning-position))
> (null (bolp)))
> (progn (forward-char 1)
> (if (and fill-nobreak-predicate
> (run-hook-with-args-until-success
> 'fill-nobreak-predicate))
> (progn (skip-chars-backward "|" (line-beginning-position))
> (longlines-find-break-backward))
> t))))
>
> (defun longlines-find-break-forward ()
> "Move point forward to the first available breakpoint and return t.
> If no break point is found, return nil."
> (and (search-forward "|" (line-end-position) 1)
> (progn (skip-chars-forward " " (line-end-position))
> (null (eolp)))
> (if (and fill-nobreak-predicate
> (run-hook-with-args-until-success
> 'fill-nobreak-predicate))
> (longlines-find-break-forward)
> t)))
> --8<---------------cut here---------------end--------------->8---
>
> Maybe those searches should work against a bag of separators like
> space, semicolon, veritcal bar… but it is a case to un-obsolete
> longlines.el
Feel free to suggest an improvement, like a defcustom that allows to
control what character(s) are used to break long lines.
next prev parent reply other threads:[~2022-06-30 13:40 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 0:51 Emacs freezes again when I try to open a file including only one very long line Hongyi Zhao
2022-06-27 1:58 ` Emanuel Berg
2022-06-27 2:29 ` Eli Zaretskii
2022-06-27 2:36 ` Hongyi Zhao
2022-06-27 11:02 ` Eli Zaretskii
2022-06-27 11:22 ` Hongyi Zhao
[not found] ` <CAGP6POKVBGL+gKOLAcqPxgFKzAC9bObW-Hzz-pWCj6mpxtCnAg@mail.gmail.com>
[not found] ` <83tu856ny2.fsf@gnu.org>
2022-06-28 12:56 ` Hongyi Zhao
2022-06-28 13:11 ` Eli Zaretskii
2022-06-28 13:56 ` Hongyi Zhao
2022-06-28 14:18 ` Eli Zaretskii
2022-06-28 14:38 ` Hongyi Zhao
2022-06-28 15:53 ` Eli Zaretskii
2022-06-29 1:05 ` Hongyi Zhao
2022-06-29 1:35 ` Emanuel Berg
2022-06-29 2:36 ` Eli Zaretskii
2022-06-29 2:48 ` Hongyi Zhao
2022-06-29 11:16 ` Eli Zaretskii
2022-06-29 11:25 ` Hongyi Zhao
2022-06-29 11:37 ` Eli Zaretskii
2022-06-29 12:22 ` Hongyi Zhao
2022-06-29 14:11 ` Eli Zaretskii
2022-06-29 14:30 ` Hongyi Zhao
2022-06-29 16:03 ` Eli Zaretskii
2022-06-30 0:38 ` Hongyi Zhao
2022-06-30 5:41 ` Hongyi Zhao
2022-06-30 12:09 ` Michael Heerdegen
2022-06-30 12:52 ` Michael Heerdegen
2022-06-30 13:56 ` Eli Zaretskii
2022-06-30 14:16 ` Michael Heerdegen
2022-06-30 14:22 ` Eli Zaretskii
2022-06-30 14:32 ` Michael Heerdegen
2022-06-30 15:54 ` Eli Zaretskii
2022-06-30 14:36 ` Michael Heerdegen
2022-06-30 16:04 ` Eli Zaretskii
2022-07-01 11:17 ` Michael Heerdegen
2022-06-29 6:44 ` Manuel Giraud
2022-06-29 11:20 ` Eli Zaretskii
2022-06-30 8:29 ` Manuel Giraud
2022-06-30 12:02 ` Manuel Giraud
2022-06-30 12:43 ` Emanuel Berg
2022-06-30 12:53 ` Emanuel Berg
2022-06-30 13:35 ` Manuel Giraud
2022-06-30 13:36 ` Hongyi Zhao
2022-06-30 13:40 ` Eli Zaretskii [this message]
2022-06-28 15:06 ` Emanuel Berg
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8335fm5ky0.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.