From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: master 2ef6f943abd: Add option to control default outlining in 'C-h b' Date: Tue, 25 Apr 2023 12:11:57 +0200 Message-ID: <87fs8o9spe.fsf@gmail.com> References: <168233653969.13461.3810563138120581789@vcs2.savannah.gnu.org> <20230424114219.F2AEAC0004A@vcs2.savannah.gnu.org> <877cu1bf6q.fsf@gmail.com> <834jp5xn7v.fsf@gnu.org> <87a5ywn4qj.fsf@web.de> <83r0s8wjcf.fsf@gnu.org> <87leig9xm8.fsf@gmail.com> <838regwcnt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11220"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael_heerdegen@web.de, emacs-devel@gnu.org, orontee@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 25 12:12:40 2023 Return-path: Envelope-to: ged-emacs-devel@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 1prFf6-0002oc-AK for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Apr 2023 12:12:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prFeW-0005IK-Ux; Tue, 25 Apr 2023 06:12:05 -0400 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 1prFeU-0005He-SI for emacs-devel@gnu.org; Tue, 25 Apr 2023 06:12:02 -0400 Original-Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prFeT-000608-3r; Tue, 25 Apr 2023 06:12:02 -0400 Original-Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f19a80a330so20506775e9.2; Tue, 25 Apr 2023 03:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682417519; x=1685009519; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=M7y/gCVzyW6onPLJym9f1loqzqeM/gBkyRismaSm8mk=; b=DejmXnwNbGBaeyLTCTnwuB53TOAeAmqAYibcvJtkqvncyb1A3mQgoRw8zbvIbkL5yp pq33QYbGHKHzDFWJ0WTkPxdYpGeNyc6ZizkOWhE9cshbk3oIhl7/cCC2OPJUZceozAlR 5y/EGoNe7zRx1TbQoIw0j9XtGf4UP0O4X6MeDMti4v/wKuntuzx3Djl2abq2NUe0xOph GqibaNoSbYRpYdbWZFI8FqwphUSadAosa1VRNvDqgJUfS+XFJCR5xr0S5o5zzwue/OgE se9DUjdTONoWrRxdIYPDf0TwVROfRK/sU9MOKiB8KeCvZrHjekrMwUMO2RZI53yfxS9V BaKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682417519; x=1685009519; h=mime-version: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=M7y/gCVzyW6onPLJym9f1loqzqeM/gBkyRismaSm8mk=; b=Y2u7c3QSh+ZBKk7RwxKpBaLMF8LdMp/2eQD5aYq+tZXKEgM3heO3gnjJa0wyIMTn5t L+33FJdjYEvTRItajqQAgWAaKmIMonnA1wGKfrwh8IabylO3AF7KIKVXGkGnfxOF4nsm pPLYR9cC3KlLeh6Qk85w1l1Opgl8ceaEoXpiva39gTZkUAQP1o0sIMZJOxjCgeiacwpK 3u6C3JEliPiZAVH9PQWGc8BRChH0GDZl62OAPlZuGLGW61qAORyAP1ejC9tWofkvP2kS 52tIJ0uGmW51dgvKXMJCnwKAU+viv04As0zpIEx7oVcvJvBLvyGsZX82sIVl4VyW0sUI c5FQ== X-Gm-Message-State: AAQBX9cJjEKB8h8z7s/vHLJp0jNJRctt6wLvbRIjKOzlRqOhJyV6aBzr eH6ihrGxMIbUHIsjXqMo1+KmsXgDbQQ= X-Google-Smtp-Source: AKy350YLQP8xRChtda6Mua05g0K3jqncT3Gw3L6xs9JC7DeCPEtkGFRDPPJ1X5VZtIif1l/L4reTGw== X-Received: by 2002:a05:600c:3657:b0:3f1:72ec:400d with SMTP id y23-20020a05600c365700b003f172ec400dmr9481406wmq.33.1682417519065; Tue, 25 Apr 2023 03:11:59 -0700 (PDT) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id t10-20020a05600c198a00b003f16932fe7dsm18086258wmq.38.2023.04.25.03.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 03:11:58 -0700 (PDT) In-Reply-To: <838regwcnt.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 25 Apr 2023 12:09:58 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=rpluim@gmail.com; helo=mail-wm1-x32f.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305646 Archived-At: >>>>> On Tue, 25 Apr 2023 12:09:58 +0300, Eli Zaretskii said: >> This code and the defcustom is new in emacs-29, so we can still change >> it to be a predicate instead. At least we should document is better Eli> Agreed. Patches welcome. I assumed you were agreeing to the code change, which looks like this: diff --git a/lisp/outline.el b/lisp/outline.el index 0e90c59c285..266b3a168f6 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1517,10 +1517,11 @@ outline-default-rules When nil, the subtree is hidden unconditionally. -When equal to a list, each element should be one of the following: +When equal to a list, each element should be one of the +following, which are checked in order: - A cons cell with CAR `match-regexp' and CDR a regexp, the - subtree will be hidden when the outline heading match the + subtree will be hidden when the outline heading matches the regexp. - `subtree-has-long-lines' to only show the heading branches when @@ -1532,9 +1533,9 @@ outline-default-rules - A cons cell of the form (custom-function . FUNCTION) where FUNCTION is a lambda function or function name which will be - called without arguments with point at the beginning of the - heading and the match data set appropriately, the function - being expected to toggle the heading visibility." + called without arguments, with point at the beginning of the + heading, and the match data set appropriately. If the function + returns nil the subtree will be shown, otherwise it is hidden." :version "29.1" :type '(choice (const :tag "Hide subtree" nil) (set :tag "Show subtree unless" @@ -1649,9 +1650,10 @@ outline--show-headings-up-to-level ;; show only branches when long lines are detected ;; in subtree (outline-show-branches)) - (custom-function - ;; call custom function if defined - (funcall custom-function)) + ;; call custom function if defined + ((and custom-function + (funcall custom-function)) + (outline-hide-entry)) (t ;; if no previous clause succeeds, show subtree (outline-show-subtree)))))) Robert --