From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: jinx Date: Sat, 01 Apr 2023 14:54:25 +0300 Message-ID: <838rfbzuku.fsf@gnu.org> References: <87sfdnyuxc.fsf@posteo.de> <83sfdl2z26.fsf@gnu.org> <86tty0ydnl.fsf@gnu.org> <877cuwgg4m.fsf@gmail.com> <83cz4nzw3u.fsf@gnu.org> <87ilef3k77.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12293"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arash@gnu.org, rms@gnu.org, m.eliachevitch@posteo.de, emacs-devel@gnu.org To: Augusto Stoffel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 01 13:55:11 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 1piZp8-0002ww-Tm for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Apr 2023 13:55:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piZoJ-0000BF-EG; Sat, 01 Apr 2023 07:54:19 -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 1piZoH-0000Am-BN for emacs-devel@gnu.org; Sat, 01 Apr 2023 07:54:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piZoG-0000l9-9R; Sat, 01 Apr 2023 07:54:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=MkTc65h79c+60Vhb8F/OCOnypF7nzzp+dmDhYWKk+M4=; b=XzJ6hieTlEbvu0jPOk/x 3omMLAMMd2nvif1Sg3phHurejasUStMMPWBN35THOIedmlLH5cL4nRfm9ZD1XXrfYbITS7osWZ4GB qOwr+jwZFHA44BAhg5IjglQFJQ1yfihoB8X9WCO3LDh8/YEtrOqgeJC1qS4My7aFSHsV4/8IlLeAz syFde8zXtc3HHcQH3iic/Ev1nS6N66JWJ0K2jrxwAqTU/4FWTHYsi6bSySmOMOUwIA8q3QGZ3/t9E tFCCui0Hi47vzYWjwRN9sCSQuU7uwc0tcoCZzsK4DfbkGHHf32M+9V4wKbQhv8Ptjux41Z+oEhaMZ OypwFF9IWDQS0w==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piZoA-0003tN-3V; Sat, 01 Apr 2023 07:54:10 -0400 In-Reply-To: <87ilef3k77.fsf@gmail.com> (message from Augusto Stoffel on Sat, 01 Apr 2023 13:39:40 +0200) 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:304991 Archived-At: > From: Augusto Stoffel > Cc: arash@gnu.org, rms@gnu.org, m.eliachevitch@posteo.de, > emacs-devel@gnu.org > Date: Sat, 01 Apr 2023 13:39:40 +0200 > > On Sat, 1 Apr 2023 at 14:21, Eli Zaretskii wrote: > > > If we pass START and END, why does the region have to be a single > > "word"? > > This is a tricky point. The notion of "word", for spell checking > purposes, is outside of the major mode's control. For instance, some > languages include the apostrophe or hyphen as a word char, some don't. > > Passing START and END means that the major mode can use the information > of how the spell-checker did the tokenization. Typically, though, I > expect most function will look only at START or END. > > > why not let the caller specify a larger region to be skipped? > > Then the return value can't be a boolean; it has to be a list of > regions, which is too complicated. I'm afraid I don't quite follow. I actually don't understand why we need END here. Why not call the function with some buffer position, and let it return nil (meaning don't skip) or a buffer position, which means skip until that position? IOW, skipping text in at least some situation needs to skip multiple words, perhaps even multiple lines, and the skip function should be allowed to specify that in one go. Right? > >> (defun spelling-ignored-p (start end) > >> "Return non-nil if the word between START and END should not be spell checked. > >> See `spelling-ignore-functions' for information on how this is > >> determined." > >> (save-excursion > > > > Why do we need save-excursion? > > If we remove it here, then most spelling-ignore-functions will need to > call save excursion on their own, which would probably be fine as well. Yes, I don't think we should second-guess what those functions will do. > >> The above would go into a “neutral” place like simple.el. > > > > Why not ispell.el? All the spelling functions use ispell.el anyway. > > simple.el is preloaded, so having this there bloats every Emacs > > session for no good reason, IMO. > > jit-spell only uses ispell.el to start a process and jinx doesn't use it > at all. jinx is not in Emacs, so we don't have to solve its problems. And jit-spell uses ispell.el, so it will be able to use any function there. > To me it makes sense to untangle the spellchecking support API > for major modes from any particular implementation. But I guess this is > not a major issue. Not a major issue indeed, at least not yet. If and when needed, we could have a general spell.el file that would hold all the spell-checking stuff not related to particular implementations. Although in my mind ispell.el is such a "base-line" file already, as every spelling feature basically uses some of its infrastructure.