From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Using syntax tables to parse buffer content Date: Wed, 26 May 2021 09:43:13 -0700 Message-ID: <87sg29mony.fsf@ericabrahamsen.net> References: <87o8czopcj.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34402"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 26 18:49:07 2021 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 1llwiP-0008fL-H4 for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 18:49:05 +0200 Original-Received: from localhost ([::1]:39326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llwiO-0003wK-FL for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 12:49:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llwdc-0001SF-Br for emacs-devel@gnu.org; Wed, 26 May 2021 12:44:08 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:40996 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llwdX-000392-NB for emacs-devel@gnu.org; Wed, 26 May 2021 12:44:08 -0400 Original-Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id CCC62FED20; Wed, 26 May 2021 16:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1622047396; bh=8J7zV2TrZgoiTAtWq6eQe1m3sFxxIjdm0bJYImeipYg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ILhJeVoH+LvskEaqUE9qTc+FF7rUv2M+CeDiUuyBS/ehCFDk54ZYmugTNPc8G7Wma 8rec2rmyotmgIed3UMMB8FLGjrKXZHCqi5JZwI9QJBE1Cbit+i1DwvDHoLuxjMhIUa VL4xE9otcUKCcG06xSJMtvFCRdWtIzrJgPO5s5ow= In-Reply-To: (Stefan Monnier's message of "Mon, 24 May 2021 17:07:04 -0400") Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:269919 Archived-At: Stefan Monnier writes: >> For example, in a text-mode test buffer, I add the "/" syntax class to >> ?*, then put that character before a space character, thinking it might >> negate the space's whitespace class. That doesn't happen, though, as >> (skip-syntax-forward "^ ") still stops at the space. > > skip-syntax-forward only looks at the actual syntax, so it doesn't pay > attention to anything before/after. Aha! Maybe I can suggest some documentation patches here. > The "/" class is effective when you consider operations like > `forward-sexp`, which might consider `foo\ bar` as a single "symbol" > rather than two. So would you suggest that I slightly abuse the concept of sexps here? Maybe start with a completely blank syntax table, and give "=:;," punctuation class, and then `forward-sexp' to eat up chunks of text...