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:21:25 +0300 Message-ID: <83cz4nzw3u.fsf@gnu.org> References: <87sfdnyuxc.fsf@posteo.de> <83sfdl2z26.fsf@gnu.org> <86tty0ydnl.fsf@gnu.org> <877cuwgg4m.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="15477"; 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:21:59 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 1piZJ1-0003mX-1O for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Apr 2023 13:21:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piZIP-0006zz-Vp; Sat, 01 Apr 2023 07:21:22 -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 1piZIN-0006ye-Hc for emacs-devel@gnu.org; Sat, 01 Apr 2023 07:21:19 -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 1piZIL-0003qA-VT; Sat, 01 Apr 2023 07:21:18 -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=i+Ict3aiGedmcXrT8mdBcTAEfgqTzxmmwgM94RcCi8Y=; b=FHYFYF51UN9nVo3znPIq Dn4zzpVWG33VQFEKjR73sLfpePbHur9YQYnwWDiryXNyTvAgkKhNVIEy4JDG6gSfUlPe3reUV4R8W WEzjXqWoOB8BVtU9nChvKcaqtZxmvZrdqL9ahNn/lTiGpMoOBgllkPt8UBzoeRctBlgiUJawVRKy/ boGUOuYbelmZdGgbSBliwtt7Pu3xFwBsy7lDGl8J3jQLLprB57s5LwqEiWicIq+upKuu5PSUlCG9v fZ+c6Z+4etae7dqTmq0qvMt03AASB4Bm9neU/RRFGHdZqgE0P0SoIakNDF2tlxgT/XlN++/ed3g1/ tE8tjL7A04siOA==; 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 1piZIE-0002Jt-6k; Sat, 01 Apr 2023 07:21:10 -0400 In-Reply-To: <877cuwgg4m.fsf@gmail.com> (message from Augusto Stoffel on Sat, 01 Apr 2023 10:29:13 +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:304987 Archived-At: > From: Augusto Stoffel > Cc: Eli Zaretskii , rms@gnu.org, m.eliachevitch@posteo.de, > emacs-devel@gnu.org > Date: Sat, 01 Apr 2023 10:29:13 +0200 > > So I'd suggest a generic API on these lines: > > #+begin_src emacs-lisp > (defvar spelling-ignore-functions nil > "Hook used to determine if a word should be excluded from spell checking. > These functions are called with two arguments, the start and end > positions of a word, until a non-nil value is returned. Any > result other than nil or `never' indicates that the word should > be excluded from spell checking. If we pass START and END, why does the region have to be a single "word"? why not let the caller specify a larger region to be skipped? > Modes derived from `prog-mode' should leave it up to the spell > checker to decide whether or not to ignore comments, strings or > code regions. They may provide more specific rules, if desired, > but this typically not needed. Why? I thought the purpose of this is to override what the spell-checker knows, and that includes comments and strings, if needed. So I see no reason for such a recommendation. > (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? > 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.