From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jakanakaevangeli@chiru.no Newsgroups: gmane.emacs.devel Subject: master fb4f2aa038: * lisp/textmodes/paragraphs.el (repunctuate-sentences-filter): New function. Date: Tue, 04 Jan 2022 18:21:56 +0100 Message-ID: <87r19ns9fv.fsf@miha-pc> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37376"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: juri@jurta.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 04 18:20:01 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 1n4nTd-0009ci-GU for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jan 2022 18:20:01 +0100 Original-Received: from localhost ([::1]:42170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4nTc-0003y6-8b for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jan 2022 12:20:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4nPu-0005Qa-Nj for emacs-devel@gnu.org; Tue, 04 Jan 2022 12:16:10 -0500 Original-Received: from kamnitnik.top ([209.250.245.214]:40672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4nPt-0000cV-3I for emacs-devel@gnu.org; Tue, 04 Jan 2022 12:16:10 -0500 Original-Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by kamnitnik.top (Postfix) with ESMTPSA id 080B39CA87; Tue, 4 Jan 2022 17:16:03 +0000 (UTC) In-Reply-To: 20211229191029.48E49C002EE@vcs2.savannah.gnu.org Received-SPF: none client-ip=209.250.245.214; envelope-from=jakanakaevangeli@chiru.no; helo=kamnitnik.top X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) SPF_HELO_PASS=-0.001, SPF_NONE=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:284177 Archived-At: > +(defun repunctuate-sentences-filter (_start _end) > + "Search filter used by `repunctuate-sentences' to skip unneeded spaces. > +By default, it skips occurrences that already have two spaces. > +It is advised to put `advice-add' on this function to add more filters, > +for example, `(looking-back (rx (or \"e.g.\" \"i.e.\") \" \") 5)' > +with a set of predefined abbreviations to skip from adding two spaces." > + (not (length= (match-string 4) 2))) Similarly to filter-buffer-substring-function, I believe it would be better if this was a variable, on which 'add-function' could be used. This would make it easier to set buffer locally if needed.