From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#22143: 24.5; Emacs blocked on long lines. Date: Fri, 21 Aug 2020 06:53:24 -0700 Message-ID: References: <87d1ud6kw8.fsf@gavenkoa.example.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36795"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 22143@debbugs.gnu.org To: Oleksandr Gavenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 21 15:54:10 2020 Return-path: Envelope-to: geb-bug-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 1k97Ug-0009Pq-My for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Aug 2020 15:54:10 +0200 Original-Received: from localhost ([::1]:46000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k97Uf-0008Iu-LW for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Aug 2020 09:54:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k97UY-0008H2-FF for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2020 09:54:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k97UY-0002Z2-4E for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2020 09:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k97UY-00023Y-27 for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2020 09:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Aug 2020 13:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22143 X-GNU-PR-Package: emacs Original-Received: via spool by 22143-submit@debbugs.gnu.org id=B22143.15980180137863 (code B ref 22143); Fri, 21 Aug 2020 13:54:02 +0000 Original-Received: (at 22143) by debbugs.gnu.org; 21 Aug 2020 13:53:33 +0000 Original-Received: from localhost ([127.0.0.1]:45456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k97U4-00022l-TW for submit@debbugs.gnu.org; Fri, 21 Aug 2020 09:53:33 -0400 Original-Received: from mail-yb1-f175.google.com ([209.85.219.175]:46735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k97U2-00022T-H6 for 22143@debbugs.gnu.org; Fri, 21 Aug 2020 09:53:31 -0400 Original-Received: by mail-yb1-f175.google.com with SMTP id x10so1060300ybj.13 for <22143@debbugs.gnu.org>; Fri, 21 Aug 2020 06:53:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=J2lAG1mTFfzNnXzC+hfGrg7TNZYcdDTqkyPpNugxnmc=; b=h/oNLTeGb7xc8XAOvUwL4qSCZErb6EFk84SENtMOrOCe1s3L2CkScrVgUsxWetFR+9 34P0Fu754dGYj9F7AOmccBJ7ugJC2Gkcxlo0mKU9I1SB3JxhR6UxNlXTjgNrZEJ+qCSZ CSqsZYUynkbq5ojhPdWVTL2V08ltmCXbrLYDdQJgnuTbCyqnqkzMHsbU1riqJJFH7cLE N3Fl5ezlvYYjb6LvOzli84DySdPJjU6tX8dPiaRI3lAPdrJBoac38G2mVvLODFc/TJq0 EO3cMbSfAKh+/Oj0SRJURYTtJ/ZMaJESZ66VR/i+gzVWRz6wWiXuf73Z15yqqWNcvThP ItwA== X-Gm-Message-State: AOAM530nAlnA+qQpsyEkhdEV0xWbhL9DvlxuEA+7eIi+CXdow+rcMyKS 8NLG9RrsDqBgkZy5YHnEukK0h6zX7/d5Ubjwhso= X-Google-Smtp-Source: ABdhPJyymWqKFMtrUGgUqqZwFj87H2jH2wtgkd1pwr0lMBbyvpJsx15T+I9IaML+/0LeGzaEhi2s7blit0xkks1za3s= X-Received: by 2002:a25:9843:: with SMTP id k3mr3895479ybo.466.1598018004919; Fri, 21 Aug 2020 06:53:24 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 21 Aug 2020 06:53:24 -0700 In-Reply-To: <87d1ud6kw8.fsf@gavenkoa.example.com> (Oleksandr Gavenko's message of "Fri, 11 Dec 2015 17:54:31 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185865 Archived-At: Oleksandr Gavenko writes: > It is usual for me to open files with large lines in Emacs. > > Some times this was log, or executable, or dump. > > But usually this was minified .js or .json file. > > And only thing I can do is to live with slowness or to kill Emacs and may be > clean corresponding desktop-mode entries for *bad* file. > > I contribute piece to: > > http://emacs.stackexchange.com/questions/598/how-do-i-handle-files-with-extremely-long-lines > > Here it is: > > (setq line-number-display-limit large-file-warning-threshold) > (setq line-number-display-limit-width 200) > > (defun my--is-file-large () > "If buffer too large and my cause performance issue." > (< large-file-warning-threshold (buffer-size))) > > (define-derived-mode my-large-file-mode fundamental-mode "LargeFile" > "Fixes performance issues in Emacs for large files." > ;; (setq buffer-read-only t) > (setq bidi-display-reordering nil) > (jit-lock-mode nil) > (buffer-disable-undo) > (set (make-variable-buffer-local 'global-hl-line-mode) nil) > (set (make-variable-buffer-local 'line-number-mode) nil) > (set (make-variable-buffer-local 'column-number-mode) nil) ) > > (add-to-list 'magic-mode-alist (cons #'my--is-file-large #'my-large-file-mode)) > > But it is for a large files (but help me in many case because files with long > lines usually also themselves big). I didn't investigate how to make test for long > lines jet. > > Even with those settings some files (usually minified .js libraries or .json > files) froze Emacs. I think due to js-mode, but... > > I would like to hear solution for long line issue or a way to detect long > lines and prevent file from opening (or decide to risk if lines is not toooo > long). > > My point instead of restarting Emacs daemon - safely warn about long lines so > I have a chance to preserve my Emacs session before Emacs die. Is this better with so-long.el? etc/PROBLEMS says: *** Editing files with very long lines is slow. For example, simply moving through a file that contains hundreds of thousands of characters per line is slow, and consumes a lot of CPU. This is a known limitation of Emacs with no solution at this time. Is there anything more we can/should do in this case short of rewriting the display engine? Does it make sense to track this limitation in a bug report? Best regards, Stefan Kangas