From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Devlin Newsgroups: gmane.emacs.bugs Subject: bug#59345: 28.2; peg.el: syntax-class PEX does not advance point Date: Thu, 17 Nov 2022 18:49:20 -0500 Message-ID: <16D8C25F-31A8-44D8-9DDC-3CFF149183C2@toadstyle.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.96\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5403"; mail-complaints-to="usenet@ciao.gmane.io" To: 59345@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 18 00:50:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ovoeH-0001C8-DF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Nov 2022 00:50:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovodx-0008J3-KR; Thu, 17 Nov 2022 18:50:05 -0500 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 1ovodv-0008Ir-M9 for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 18:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovodv-0003Hk-D2 for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 18:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovodu-0000Eu-6u for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 18:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Nov 2022 23:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59345 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1668728980885 (code B ref -1); Thu, 17 Nov 2022 23:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Nov 2022 23:49:40 +0000 Original-Received: from localhost ([127.0.0.1]:34633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovodY-0000EB-2y for submit@debbugs.gnu.org; Thu, 17 Nov 2022 18:49:40 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:54424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovodT-0000E0-VM for submit@debbugs.gnu.org; Thu, 17 Nov 2022 18:49:38 -0500 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 1ovodT-0008Hk-Jz for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 18:49:35 -0500 Original-Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovodR-00039q-JT for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 18:49:35 -0500 Original-Received: by mail-qt1-x831.google.com with SMTP id l15so2213258qtv.4 for ; Thu, 17 Nov 2022 15:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20210112.gappssmtp.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=+B6HQlD9n1+wg1dnGdA45hSeHj4ZbZlbqa2TxSvZ22Q=; b=r3iLn70SY29nsq8ceq0/ODvZT4rrEsV/FfBA0giWZmkgXIPO2w3cFd3V5aZsBPG0H7 XSCWpujFf1Vz/lUDcrYK9VMflvHwbU9GFfpMsg+gLNNh5ljcaAEQKVmO28z6RWEi08dm PuTOzNlkXHgfhWmmce9S/3eV0nAM0NNCBczWx0zyr3wLIBbmEcBMQerL65qi9SF4HkmG M0SQ40iaRGMqRU/vFi0C34jG6JMHG8gcfLd9tdf3dsVkSahBvEcJsMq8w2t/3h2BJacq PmbfPyw20OuFArc4aaITw74c2S4yrhWboO6mBg+vf61UhAyL5lgpkwhkWlQtZq/ekQvh GXVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+B6HQlD9n1+wg1dnGdA45hSeHj4ZbZlbqa2TxSvZ22Q=; b=3d62joZoOSbRP5eZOm5lkYFtcXrVDFr6GZmVBGrkInsliWi3sc6D8P5Wg4o6SdL0Q8 zq6KGhM6K6Qj13gBmtuAOmojCppk9Oqa5Ys3xulkMLLyYSuzlU3M5+ZYyDns+P7++7md v6gz5iKTL/acU3sXOcjniOkcfbuOyAsgQ5L3cgZmrXKpPWMtGlXTx0XjfWECwAdeMceL C/7Xq/Oe+Q+C5ne1+tshHGGSEtKOCSzWPyz5sNnbbmGjgp9dczdH/Dx2fJYBN3PsftcY DoDTIQjRLAMR3DKbxsLKjAO27vPpooFefsT69YC9zRg9euh/8VqUvS24TMpTV6/AxRf+ 08iw== X-Gm-Message-State: ANoB5pljyEPCSzZfprxcNyc8BbJGgiQ1yFbqyNapVbptYEkANkPTgUoh o39LMbFTASNS/lvm+ML3mDAzIAmSQ77mSTw5 X-Google-Smtp-Source: AA0mqf4n9wM9NxSytvt05K0KSBjJFeNcw1v/XvKKGi+R42Mbiq+ppNGupJ/rTMpbgAcZshCsFptJPQ== X-Received: by 2002:ac8:41c9:0:b0:3a5:f9eb:247 with SMTP id o9-20020ac841c9000000b003a5f9eb0247mr4574997qtm.186.1668728971756; Thu, 17 Nov 2022 15:49:31 -0800 (PST) Original-Received: from smtpclient.apple (pool-173-56-106-162.nycmny.ftas.verizon.net. [173.56.106.162]) by smtp.gmail.com with ESMTPSA id do52-20020a05620a2b3400b006fba0a389a4sm1375289qkb.88.2022.11.17.15.49.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Nov 2022 15:49:31 -0800 (PST) X-Mailer: Apple Mail (2.3731.300.96) Received-SPF: pass client-ip=2607:f8b0:4864:20::831; envelope-from=spd@toadstyle.org; helo=mail-qt1-x831.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248150 Archived-At: Hi folks, In version 1.0 of peg.el, there is a PEX to match the syntax class of the character at point. I expected it to advance the point after recognizing the correct class, but it seems that it does not. I expected its behavior to be similar to character classes, sets and ranges, and all of these seem to advance the point. Instead, it seems it is more like a guard expression. To demonstrate this, you can evaluate the following forms: (require 'peg) (with-temp-buffer (save-excursion (insert " ")) (list (save-excursion (cons (peg-run (peg (syntax-class whitespace))) (point))) (save-excursion (cons (peg-run (peg " ")) (point))))) While both PEGs match the character at point, only the latter advances the point. This might just be a matter of documenting the behavior of the syntax-class PEX, but I think it would make more sense if it behaved like character classes, sets, ranges and literals. Thanks! In GNU Emacs 28.2 System Description: macOS Configured using: 'configure --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs/28.2/share/info/emacs --prefix=/opt/homebrew/Cellar/emacs/28.2 --with-gnutls --without-x --with-xml2 --without-dbus --with-modules --without-ns --without-imagemagick --without-selinux' Configured features: ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE PDUMPER THREADS ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow regexp-opt sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail tool-bar rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils term/xterm xterm byte-opt gv bytecomp byte-compile cconv iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue multi-tty make-network-process emacs) Memory information: ((conses 16 53226 5880) (symbols 48 6605 1) (strings 32 18480 957) (string-bytes 1 607151) (vectors 16 10649) (vector-slots 8 126128 10593) (floats 8 24 302) (intervals 56 220 0) (buffers 992 11))