From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#59888: [PATCH] Add 'grep-heading-mode' Date: Fri, 09 Dec 2022 12:58:06 +0100 Message-ID: <87359oeqlt.fsf@gmail.com> References: <87v8mndrla.fsf@gmail.com> <87ilime025.fsf@gmail.com> <86359pm55x.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4430"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Kangas , 59888@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 12:59:12 2022 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 1p3c24-00010Q-FX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 12:59:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3c20-0006gB-1I; Fri, 09 Dec 2022 06:59:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3c1u-0006cl-Dy for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 06:59:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3c1t-0002G2-Rh for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 06:59:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3c1t-0006rv-NM for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 06:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 11:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59888 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59888-submit@debbugs.gnu.org id=B59888.167058709626378 (code B ref 59888); Fri, 09 Dec 2022 11:59:01 +0000 Original-Received: (at 59888) by debbugs.gnu.org; 9 Dec 2022 11:58:16 +0000 Original-Received: from localhost ([127.0.0.1]:35594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3c19-0006rO-P7 for submit@debbugs.gnu.org; Fri, 09 Dec 2022 06:58:15 -0500 Original-Received: from mail-ed1-f54.google.com ([209.85.208.54]:34749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3c18-0006rI-B6 for 59888@debbugs.gnu.org; Fri, 09 Dec 2022 06:58:14 -0500 Original-Received: by mail-ed1-f54.google.com with SMTP id z92so2805242ede.1 for <59888@debbugs.gnu.org>; Fri, 09 Dec 2022 03:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=mlplh21vavVE56soxpFyNMY6+IbXh3aKNJy77LXOhi0=; b=Awe32FzA4CcW1lOvxk7defWNCsvUf1EBArLCXfyOZ/+LB7GoDB3Rc0Wdzd+bIvOJHe lfAh4Vz0IakWieEazVV1mPRsHHWVCDrY3uW2DbJKHRN+EOfukaFcTG6eAFedu6EzSMKk Y9llCs2d89Yverg3wg2mNWvo0sHP69OzMDaED+WkaXN3+JhEkfNbWXx9WVTaEe5dyCCO uFrbbxmJP1XdpWyTVEr5KzUTDXiJkG2a0OPLES3bruYCo7Y6MgCcC37OvvXmo+hJ4shn LNNzVCBjPFfGTvl7xj60WggYjM9Rv1iXF56JEbw1rlOtJ/+r5XrMSFGec+sEnHarCWm0 6Pvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mlplh21vavVE56soxpFyNMY6+IbXh3aKNJy77LXOhi0=; b=gMODjRYp0qzRLEO6+hVf+r/HxmXd+ex5C0o6hr5WtFIptD9YCZ57WycJwN8DyiPO7V soqq/HQ4qXJ2pS5wSQpE2k1nD5c+CadHQncay7kO083SbyiJeKnVxjuJGuoOFhoMSgfr QJ+AbUe6tunjqfeX/2EQluhGhJ9fVWd3TPHwHZzbkqeQcnS+0dCbMzVYLFo8HgEwMOQI aLWErU/UTTDIO6o1hnnEkLP/0VnRnUdT/kWPwZgIdMIsE17zYophckteNvOBKTd/LWe1 UuOzwX6yAJzy/EnGNFFI1S3uxtqIiCHozeplMLaA0FKz2kCT0luNFTSOXhOusvzJKhvn i1VA== X-Gm-Message-State: ANoB5pmqnIe1EQjSEJYy/Rg5CWzMyZK64AepdKT1dwdNaIuXa3etAS6e SJICn/JVqzjtn+UXSQZkkpNrIKQaiv767w== X-Google-Smtp-Source: AA0mqf7giFZXj5mPGuzq+SyA5Ymai1b/HnmrM7mU+73XzS94GIR8zSHmY5hdjaaI0uG9rRSCexqBZQ== X-Received: by 2002:a50:fb0a:0:b0:46a:878c:3325 with SMTP id d10-20020a50fb0a000000b0046a878c3325mr4824151edq.36.1670587088075; Fri, 09 Dec 2022 03:58:08 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::a4bf]) by smtp.gmail.com with ESMTPSA id z4-20020aa7c644000000b0046b471596e6sm542227edr.57.2022.12.09.03.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 03:58:07 -0800 (PST) In-Reply-To: <86359pm55x.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 09 Dec 2022 09:23:46 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250382 Archived-At: On Fri, 9 Dec 2022 at 09:23, Juri Linkov wrote: >>> How about making this into a defcustom instead of a minor mode? >>> >>> I'm thinking that something like >>> >>> (setopt grep-use-headings t) >>> >>> is a slightly simpler interface to use than >>> >>> (add-hook 'grep-mode-hook 'grep-heading-mode) >>> >>> I also think the former plays a bit better with customize. >> >> This is at the same time less customizable in the sense that something >> like >> >> (add-hook 'grep-mode-hook >> (lambda () (when condition) (setq grep-use-headings t))) >> >> will not work (I think), while conditionally activating a minor mode >> certainly works. But I'm open to both approaches. > > Why not? (setq-local grep-use-headings t) definitely should do > the right thing. The variable has to be set at the moment `grep-mode' runs, while a minor mode could be set at a later point. But I agree a variable is sufficient here, so I will make this change.