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.devel Subject: Re: master a7c65fc666: Allow nil value for filter-buffer-substring-function Date: Mon, 19 Sep 2022 23:15:28 +0200 Message-ID: References: <166359943394.15847.12726646376922950024@vcs2.savannah.gnu.org> <20220919145714.5036DC00872@vcs2.savannah.gnu.org> 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="7252"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 19 23:17:16 2022 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 1oaO8h-0001XH-O4 for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Sep 2022 23:17:15 +0200 Original-Received: from localhost ([::1]:33320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaO8g-0002Me-4r for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Sep 2022 17:17:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaO7E-0001YW-Pt for emacs-devel@gnu.org; Mon, 19 Sep 2022 17:15:44 -0400 Original-Received: from mail-oa1-f48.google.com ([209.85.160.48]:43786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaO7B-0007tH-93 for emacs-devel@gnu.org; Mon, 19 Sep 2022 17:15:44 -0400 Original-Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-1279948d93dso1271299fac.10 for ; Mon, 19 Sep 2022 14:15:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=y0lddpXKDjRyzZXyB0cwR5vNcdudL39NW0H7cR08+J4=; b=F5QzSCQs6Jjbt3/YRonJPsuzIxWfnc1s1v0Nk5hKxcGy5VITkGo8JVHLmj7QkPEVeC GVH9lV0dAWYsMhj5S2tmkChEZ/MjDQSpgpoN11gGzSZttKs0nM9g769mDr0I5krvgOXb vWy8Fa3trlvP0cfWyj39ayKTz5lubyT8uTVsJCIIPuSEeFXIVe3YRyPFC8OPFGtURIFN FJMhmUo7J4TYQw7QCBWi4rH7k9UHsi9obGOzjomtKQ1YzLe60h8uGSQmM1QiAPmjwyZQ JIc2UgIO3D5OaJJtsqNADGwnPab9ur0kIg5xNUJMlo/cJNbnQrOwXRiI84Zd6Mw7z3Zz aZnQ== X-Gm-Message-State: ACrzQf2QCw6jOTprK1jkujSY3iuQEXUr4p/As5csosCr+QnHSTXjXo8l SRPIGHApUHFgD4bIZXrpJOGIoeSWuT5S/QbM2ro= X-Google-Smtp-Source: AMsMyM42HqzqfKDU35G4sxeV5mWW+ol7qjutPJ0Pl7Wr8SmnKIo4rhvGwUbjeK3jkC4imObHwijvPuXsLmOJns4ByzE= X-Received: by 2002:a05:6870:46a6:b0:12d:130c:2fd5 with SMTP id a38-20020a05687046a600b0012d130c2fd5mr94797oap.92.1663622140096; Mon, 19 Sep 2022 14:15:40 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=209.85.160.48; envelope-from=stefankangas@gmail.com; helo=mail-oa1-f48.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" Xref: news.gmane.io gmane.emacs.devel:295762 Archived-At: Stefan Monnier writes: > > * lisp/simple.el > > (filter-buffer-substring): Support a nil value to be more resilient. > > (filter-buffer-substring-function): Doc fix; improve and update for > > above change. > > Why? It's been that way "forever" already and new code should not put > a nil in there since it'll break uses of `add-function`. This came up because I set 'filter-buffer-substring-function' to something bad, and had a hard time figuring out what to set it back to. It would have helped if the default value was in the docstring, but allowing nil would also have been useful. So I did both those changes. Note that before this patch, you had to go to the variable's definition to find out how to set things back. But then, you just broke killing by being a bad so you have to type it in manually. nil is just handy to allow. (BTW, is it still true that some distributions don't even install the .el files by default?) I don't see a good reason not to accept nil, though we don't need to document it if we don't want to encourage its (ab)use.