From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master fb4f2aa038: * lisp/textmodes/paragraphs.el (repunctuate-sentences-filter): New function. Date: Tue, 04 Jan 2022 15:44:23 -0500 Message-ID: References: <87r19ns9fv.fsf@miha-pc> <86y23vml8n.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="32280"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: jakanakaevangeli@chiru.no, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 04 21:46:24 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 1n4qhK-00085B-UL for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jan 2022 21:46:23 +0100 Original-Received: from localhost ([::1]:50612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4qhJ-0007ni-JJ for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jan 2022 15:46:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4qfX-0006eU-HT for emacs-devel@gnu.org; Tue, 04 Jan 2022 15:44:31 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4qfU-0005C5-Pb for emacs-devel@gnu.org; Tue, 04 Jan 2022 15:44:30 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 66D54441778; Tue, 4 Jan 2022 15:44:26 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 18BD244052D; Tue, 4 Jan 2022 15:44:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1641329065; bh=mPTxa96IZGldv7TCUECoZXu3q/Tji3aE3TKHAvGvWAM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=laRJfApWUkpAxNXRNSD+TE/DQcDRIKb2qxAK/8OKXtCRxOxnzDsJPiU986PzCU9Bz 6n6GJKd+tr3YSoCCUl0FjBSMueQSowzIdHlxBXLGumsJ3YIf5SP7vSQIftIhmMfrqq O/3doAnD7z1+jx855qXj43U3lDBNJvC6PPCmK6cOjSwzVK86homsVgHo7wTKRxZlVD msOnk+Edj6rPAq9k8LLgHtIm0MbaONTb3Abo5noQvqRsoig1DdEMfn0/fG9u8NAt3S 0em8DbC5vvhz27wfhzz6Hux7jVSoaKRJfsDtiosLW2mn0ZEu6g3q5P+3flAXZK+RaO PCILaersMGFvQ== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0FF7D12024A; Tue, 4 Jan 2022 15:44:25 -0500 (EST) In-Reply-To: <86y23vml8n.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 04 Jan 2022 20:03:36 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:284198 Archived-At: > diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el > index fc10a0dd1b..e3b5ecbcca 100644 > --- a/lisp/textmodes/paragraphs.el > +++ b/lisp/textmodes/paragraphs.el > @@ -487,6 +487,8 @@ repunctuate-sentences-filter > with a set of predefined abbreviations to skip from adding two spaces." > (not (length= (match-string 4) 2))) > > +(defvar repunctuate-sentences-filter #'repunctuate-sentences-filter) Note that the default function (whose body is visible above) depends on the match data set by the caller, so `add-function` risks messing it up if it clobbers the match data with code that runs before this default. At the very least, we need a docstring that makes it very clear what match-data is expected to be set when the function is called and that explains how/when it should be preserved. Tho maybe a better approach is to change the calling convention so we don't need to depend this way on the match data set by the caller. Stefan