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: Fri, 30 Aug 2024 13:46:16 +0300 Message-ID: <86o75ae1af.fsf@gnu.org> References: <8634mnfcag.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15851"; 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 Fri Aug 30 12:47:36 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 1sjzAF-0003yt-FO for ged-emacs-devel@m.gmane-mx.org; Fri, 30 Aug 2024 12:47:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sjz9D-0004Z5-RK; Fri, 30 Aug 2024 06:46:31 -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 1sjz94-0004WQ-I9 for emacs-devel@gnu.org; Fri, 30 Aug 2024 06:46:27 -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 1sjz94-0003BF-9Q for emacs-devel@gnu.org; Fri, 30 Aug 2024 06:46:22 -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=pWo+zul9FRybmqD2LWJ1gCQt7+NQ+XX3FZdPRvUu0Ls=; b=JaXCkq6mJ/Qd UQpFMerw+6bb3nyYaCRbaxpbmXW/5n50yQ3FL51EF0YrS8rn2gQqAIbZlnqSHZBKzsyV195WDHS8R q2t5BO4TQIQqE5v+IzgXCEDW9pZQ2OpeX6A4y5T9/zcsP2Im7FQJaYvkztiUf4PhHB5gLGAN9ivpv jAKPfUGb7o3OyFf0VIt5mPHLJPDw0JU+j6nCTK4SzsiwdxQVs3UGbQXqXBVP8RS7ea5CS+91mxKWb ofxjgA/B6IpDnD61NJfIurzGcxG9j0+qBSiVswd42vEsDCPwMSaE5SGlwjPreDNhjf4CfQCB3Vh5z hMwG5oKp+I18QthVV+i1ZA==; In-Reply-To: (message from Arash Esbati on Fri, 30 Aug 2024 10:13:59 +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:323197 Archived-At: > From: Arash Esbati > Cc: emacs-devel@gnu.org > Date: Fri, 30 Aug 2024 10:13:59 +0200 > > Yes, at some point, I have to go through the @-Command List section in > the Texinfo manual. Then let's discuss them one by one, based on the Texinfo manual (which documents much more than you can find in our manuals). Some commands need to ignore their arguments, some don't. For example, @var's argument is more often than not be a real word or a phrase made out of words, like @var{next-file}. > > Very simple: press 'a' once on each directive you never want to look > > at, and leave the rest for judgment calls. > > Thanks, this was also my approach until now, but I didn't find it > satisfactory. It's definitely a possibility, I think, so we IMO should support it, at least as an option. > We can discuss which macros to include and which to drop once the code > is working. I'm currently facing the issue that when I open a .texi > file, eval (setq ispell-parser 'texinfo) and do M-x ispell RET, also > comments in the file are checked, the value of `ispell-check-comments' > is nil, though. Do you have an idea what's going wrong? I don't get > this in a .tex buffer. Doesn't ispell-check-comments only relevant to ispell-comments-and-strings? > +(defvar ispell--texinfo-arg-end-syntax-table > + (let ((table (make-syntax-table)) > + (chars '((?\f . ">") (?\n . ">") > + (?\" . " ") (?\@ . "/") > + (?\( . " ") (?\) . " ") > + (?\[ . " ") (?\] . " ") > + (?\< . " ") (?\> . " ") > + (?\\ . " ") > + (?\{ . "(}") (?\} . "){")))) > + (dolist (elt chars) > + (modify-syntax-entry (car elt) (cdr elt) table)) > + table)) > + > +(defun ispell-texinfo-arg-end (&optional arg) > + "Skip across ARG number of braces." > + (condition-case nil > + (with-syntax-table ispell--texinfo-arg-end-syntax-table > + (unless (= (following-char) ?\{) > + (skip-chars-forward "^{")) > + (forward-sexp (or arg 1))) > + (error > + (message "Error skipping s-expressions at point %d." (point)) > + (beep) > + (sit-for 2)))) Does this support nested markup, as in @w{@code{(@var{file} . @var{buffer})}} in a way that will allow to spell-check "file" and "buffer"? I'm not sure syntax-table feature supports nesting.