From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help 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 Message-ID: <8335fm5ky0.fsf@gnu.org> References: <83o7ye96u7.fsf@gnu.org> <83mtdy8j3y.fsf@gnu.org> <83tu856ny2.fsf@gnu.org> <83leth6iga.fsf@gnu.org> <83k0907ty3.fsf@gnu.org> <83h7447pjc.fsf@gnu.org> <83a69w6vsd.fsf@gnu.org> <87y1xg6kas.fsf@elite.giraud> <874k028sgp.fsf@elite.giraud> <87h742741e.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5671"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 30 15:41:09 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6uPt-0001Hr-5o for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Jun 2022 15:41:09 +0200 Original-Received: from localhost ([::1]:43400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6uPr-00044X-9A for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Jun 2022 09:41:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6uOm-000429-Bd for help-gnu-emacs@gnu.org; Thu, 30 Jun 2022 09:40:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50076) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6uOm-0004Ag-31 for help-gnu-emacs@gnu.org; Thu, 30 Jun 2022 09:40:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Xrx7pWE3IvGmYTezCuCiUr2SJRKnWde+pR22bpOEwMg=; b=RW4JjF43fYzKnIYLRMlT pe5HF53/zEEurICASo9zz7fp6Dm0AL4C3DyqApjGOBVXIQK/Zr6ISw2FcH1kIrkMp33vOp1UCH0VA HnjcEp+vgvDicBpuTYNlS5W6xz+WmYnPFGvGUTDJ4/pK/XT2odJgsAfXN/3qN6i7bNPtM1yLGl82M euXI+cB+mUoj7vH3ixKuI0lJTdggq8Otdjf9umvWEPGWGvOa03tTnTnO9dKmQJt4WiNq/gblkS7WL MdDEV6QdGXbciIjC9iCezI2wooXXfK2oPVYDCrzzVPlNOxkB/dehe5tiH9zjzREoloPMgMSDjRm96 nUsHtslFvIv9ZQ==; Original-Received: from [87.69.77.57] (port=2926 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6uOl-0006yh-IS for help-gnu-emacs@gnu.org; Thu, 30 Jun 2022 09:39:59 -0400 In-Reply-To: <87h742741e.fsf@elite.giraud> (message from Manuel Giraud on Thu, 30 Jun 2022 14:02:21 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138227 Archived-At: > From: Manuel Giraud > 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.