From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao 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 21:36:45 +0800 Message-ID: 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: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29706"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , help-gnu-emacs To: Manuel Giraud Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 30 15:37:35 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 1o6uMR-0007Wk-0f for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Jun 2022 15:37:35 +0200 Original-Received: from localhost ([::1]:37024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6uMP-0007WC-Sp for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Jun 2022 09:37:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6uLs-0007Ut-GX for help-gnu-emacs@gnu.org; Thu, 30 Jun 2022 09:37:00 -0400 Original-Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]:47089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6uLq-0002Pn-Nw; Thu, 30 Jun 2022 09:37:00 -0400 Original-Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1013ecaf7e0so25758830fac.13; Thu, 30 Jun 2022 06:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FYs8/Ifeu2oxHSHCuEG1r3jPy7y+A0CUBfc1iYxpX4A=; b=gM0rKyn2Yn7GeLrH34vZ3mPgzYAquHpTrfMeoLmvlGBR/5j1icdqQjtyPo6JSGJUWR NuCh81jRaPT+ffuQH4PIP/DSiFpYdm0mTgbZ6UF3WtnSCaHSNuw07Z9ZejjXvtaAYcNF iTaJr40Eg/eHSGoj6k9Oca4SVn31H5TfwomSu8L7fCdskMm8DlnhRF1KVryJlP1KEIHW dswqI1gm0YhazqOye0SHTriSQNpheSmg8zaa3Z6c7rOltb1y5qFcB3KzPbZs8s5EU6T0 EO6J5Q7/EeImhyb+iGS19jahh+Zrm5pyHWTO+Vt3g3WJaLw2RuYrmosMx0Siiyh4yo8+ 6/Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FYs8/Ifeu2oxHSHCuEG1r3jPy7y+A0CUBfc1iYxpX4A=; b=A3rafZiCwWt9rc4UVqX2v2T340W2MGOR+5vQg6uMW/0xzgZO2J88nDzNYwjpIzIBW5 KvPOWMGAN9tsGc5kgk2QCcN0a6S847Ua/9d4PkQlJ9zla6spocFib53AFArH3odNGltn O+TFf4zcSv5asvIshAzpFy3JhGmD4CazvaxDClPb1nlFBBqDEDBdrClMQohwAXi4oCl0 GywSGdpeqxWfpBOhRvk0Yysj+E2VnGbjhh7D+yrYG42odqGUcjGQyIqGSty0Id9SmOzV Ak/OGl0xuvXajrEvwHirCX3JQT/lH/Q7octrFVKeWm3BvczL29dOvmvqZ9R6v2DOuuYg 4EnQ== X-Gm-Message-State: AJIora+pKvBjtUPCp4Mz7BAwSzXHzNcECa/icORmY+onzDmnE3x95n8b Tq+HHKSkeXc1yp5ptv+iaD+w6K7WXsog54Zz2JUebYrCBeY9yw== X-Google-Smtp-Source: AGRyM1t2K7Wh2cAq6XRIFxvnmyeokbaacsBCJ0sseZaN9lDUJ2RK0/aPCVeBMdeqK+a8aPs9ABYe9sJpX0OG/PXmD3o= X-Received: by 2002:a05:6870:c351:b0:101:dcb9:4514 with SMTP id e17-20020a056870c35100b00101dcb94514mr5242048oak.140.1656596216948; Thu, 30 Jun 2022 06:36:56 -0700 (PDT) In-Reply-To: <87h742741e.fsf@elite.giraud> Received-SPF: pass client-ip=2001:4860:4864:20::29; envelope-from=hongyi.zhao@gmail.com; helo=mail-oa1-x29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:138226 Archived-At: On Thu, Jun 30, 2022 at 8:02 PM Manuel Giraud wrote= : > > Manuel Giraud writes: > > [...] > > > My bad: I hadn't tested with this new file and here longlines-mode does > > not help that much (Emacs is still responsive for me though). It might > > be that longlines-mode is searching for space and there is none in this > > file. > > 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-positio= n)) > (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=E2=80=A6 but it is a case to un-obsolete > longlines.el I think things/features like this should be added/extended into longlines.el for flexibility in handling more scenarios. > -- > Manuel Giraud Best, Hongsheng