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: Ispell: Skipping part of text in texinfo-mode Date: Thu, 29 Aug 2024 20:51:03 +0300 Message-ID: <8634mnfcag.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25358"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Arash Esbati Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 29 19:52:09 2024 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 1sjjJZ-0006QN-IK for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Aug 2024 19:52:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sjjIa-0001Ue-Tc; Thu, 29 Aug 2024 13:51:09 -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 1sjjIY-0001U8-Ri for emacs-devel@gnu.org; Thu, 29 Aug 2024 13:51:07 -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 1sjjIY-0007Dy-IM for emacs-devel@gnu.org; Thu, 29 Aug 2024 13:51:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=dpeyyyOW3/2i+ZbA8LetTXNGOZ20TlFwX/52DM+JrLs=; b=m4OTsTIbgod7 brvQwZxHjSrB3JwqiACRSXDje7HZc+NJsL0h0bgUmqjY5FvtGBErMjkbqZcGPQjKhx+eg34KeaDy4 qnVmdmGKuTWjXepi+b3VX0E26oqPHDPZGUz57B+KBwL7uQi4Y9HdaEII6VtoiNQ5+ck7T1AH3Y8dd UY6BtaC9+erngU7Uhju76eiKio7+TNofhso4gO50odZABXTaUOE0tBlczvhSjsLw2ODs8DF0z8zVg Wamiu/7C9JcLJgAygP5V8biFqZ6p3Rwd1s2NP1g/czGB5vNjH2lKiopzNT4+LG/Ji+9h7qBi8S6gx dF9oCvoDb+q/51Zdfe8Tfg==; In-Reply-To: (message from Arash Esbati on Thu, 29 Aug 2024 18:25:02 +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:323183 Archived-At: > From: Arash Esbati > Date: Thu, 29 Aug 2024 18:25:02 +0200 > > I wanted to spellcheck a .texi file with 'M-x ispell RET' (running > hunspell) and it occurred to me that skipping part of text like in .tex > files isn't available OOTB. In my experiment, ispell didn't ignore > anything and checked every Texinfo macro. > > Having no clue about ispell.el, I managed to ease the pain with this > change: Thanks. But there be dragons... > +;;;###autoload > +(defvar ispell-texinfo-skip-alists > + (let ((single-arg (regexp-opt '("acronym" "cite" "code" "command" "env" > + "file" "key" "option" "url" "var") There are many more, no? @samp, @sc, @item, @itemx, to mention just a few. > + (skip-line (regexp-opt '("deffn" "defun" "defopt" "defvar" > + "findex" "vindex" "kindex" "cindex" > + "end " Likewise here: @defmac, @defspec, and many others (see the Texinfo manual). > + ;; Special arrangement for things like @kbd{C-(} > + ("@\\(?:kbd\\|samp\\){" . "[^@]}") What about @kbd in general? and @key? > + ;; Envs to skip entirely > + ("^@\\(?:\\(?:small\\)?example\\|lisp\\|verbatim\\)" . > + "^@end \\(?:\\(?:small\\)?example\\|lisp\\|verbatim\\)") Why "entirely"? They frequently include comments, not just code. > I presume there are some .texi writers here and I'd like to know how > others handle this. Very simple: press 'a' once on each directive you never want to look at, and leave the rest for judgment calls. > Is the change above useful for ispell.el? To some degree, I guess. I think we should take only the bare minimum, the ones that we want _never_ to be marked as mis-spellings, and leave the rest to the users.