From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.bugs Subject: bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers Date: Sat, 13 Nov 2021 19:08:04 +0100 Message-ID: <87ee7kvshn.fsf@gmail.com> References: <87lf1sw6ji.fsf@gmail.com> <86h7cgdk4v.fsf@mail.linkov.net> 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="24054"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51809@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 13 19:09:36 2021 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 1mlxT6-000603-Eg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Nov 2021 19:09:36 +0100 Original-Received: from localhost ([::1]:40170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlxT4-0004gv-Q5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Nov 2021 13:09:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlxSY-0004gn-Dw for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2021 13:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36485) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlxSY-000388-4x for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2021 13:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlxSX-0004U3-W6 for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2021 13:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matthias Meulien Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Nov 2021 18:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51809 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51809-submit@debbugs.gnu.org id=B51809.163682689617171 (code B ref 51809); Sat, 13 Nov 2021 18:09:01 +0000 Original-Received: (at 51809) by debbugs.gnu.org; 13 Nov 2021 18:08:16 +0000 Original-Received: from localhost ([127.0.0.1]:48031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlxRo-0004St-6Q for submit@debbugs.gnu.org; Sat, 13 Nov 2021 13:08:16 -0500 Original-Received: from mail-wr1-f44.google.com ([209.85.221.44]:38522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlxRj-0004Sc-LD for 51809@debbugs.gnu.org; Sat, 13 Nov 2021 13:08:15 -0500 Original-Received: by mail-wr1-f44.google.com with SMTP id u18so21607384wrg.5 for <51809@debbugs.gnu.org>; Sat, 13 Nov 2021 10:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=u4BRVqzXq8dffPEEKuf5Q2EU7Q8lqJqql0UIoXVAxNQ=; b=que00FrfKsg0eaYVjliDcZbQ9dbS7iqt/nx1JDUuv6Uj7mLImV/jCkHsdb/YYY2uVs hj+ifG+iZ2iWEY5UTWpduBXoGKQbA/7ej0C3gk8+QornvR/TGcmOKiH3fhyH9AU+tuiD dq6mGIEb5r9bt29RmNKRF+8qrs0GQ1IxzW7cX1mXWHHMxHeV1EWM5HF9Gs87DSfVXWXB QegBcuMLDYDw6cTT/7v2hhh0vxTzATapMMdFXb0I2cO5WIqY1WMBI6RFHFR+a1ap+NV0 YN6QwQVtXsFAM4XVUSIqqHkFuPOs0f4ytvHWmh9WYqZjEm4MyNhXGuvb7pyfveD6vfIS PVug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=u4BRVqzXq8dffPEEKuf5Q2EU7Q8lqJqql0UIoXVAxNQ=; b=m2/NlxjCZG0iT9FWKXoQVJM3tCUSWUqgns7EfrQiLbeTuyp/ub8yxoanDIiZV2hqJX 4hGfB+T7yjRoAlqhZ4/M19rdoiBX50fI2A0MqvSehwjv9r/1NRmc1tgNMbeBPBdQia6m JkbekOi/fa7dFRx8Z+R0Ny9j+i/r/epidTU4RSR7lGulcP3ZUmCuR0IrdlY+Mr49nvVL gT8cZDaLKbje4lBlhc/d9KbwMqmcZ8XF8fbk83vD1gF/ToRgBwGblnTP5qHBN+Evdic4 Kb3bBKAqwUbUl050nhgwutJYYEPUs91xb4L2c2wOQB27Wj/pK4UKa8wEpDKBWfdNyuF0 hIcg== X-Gm-Message-State: AOAM531/+Osngne1YqOHFS+8uIsRb8KNC+EzVQmLMp7tgAsPGrILdGAA SbtxmEvlQJQxgT6TAEFAR2Ps3KxfZLI= X-Google-Smtp-Source: ABdhPJzeT5Rcdm6ZlTOpEbp1ny2kE2ZELxl3XQKFVGHJlbWxdR8rus0Gk3qPLHQMEh7NQOe7NTDdIg== X-Received: by 2002:adf:f08d:: with SMTP id n13mr31170041wro.395.1636826885822; Sat, 13 Nov 2021 10:08:05 -0800 (PST) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id f7sm16795386wmg.6.2021.11.13.10.08.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Nov 2021 10:08:05 -0800 (PST) In-Reply-To: <86h7cgdk4v.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 13 Nov 2021 19:45:52 +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:219827 Archived-At: Juri Linkov writes: > (...) I'm using outline-minor-mode in diff buffers all the time with > (add-hook 'diff-mode-hook 'outline-minor-mode) and would like to > understand how your patch improves this. > > Could the above hook be replaced with customization of > diff-outline-default-state? It was supposed to. But I am also using outline-minor-mode in diff buffers all the time with the same hook as you, and I must confess I've not tested until you asked: `diff-outline-apply-default-state' is supposed to automatically turn on `outline-minor-mode' but I forgot to autoload the later resulting in "Symbol=E2=80=99s value as variable is void: outline-minor-mode". I'll fix this. > >> +;; - Support outlining files by name (eg to skip automatically >> +;; generated files like package-lock.json in Javascript projects). >>=E2=80=A6 >> +(defcustom diff-file-outline-threshold 50 >> + "Number of lines of hunks for a file to be outlined. > > Often the files that need to be hidden contain just one very long line > without newlines such as in compiled assets, etc. and eventually make > Emacs unresponsive. This is a big problem. Would it be possible > in your patch to check the size of the hunk counting characters > instead of lines? Good point. I guess counting characters can be achieved by: (- (overlay-end overlay) (overlay-start overlay)) thus it looks feasible. Wouldn't it better to add a new choice "Outline hunks with long lines" and allow multiple choices in `diff-outline-default-state' customization? It would allow to implement one more usefull choice (from my pov), "Outline files by name" to hide automatically generated files (like package-lock.json in Javascript projects using NPM)... Does it looks reasonnable to you? --=20 Matthias