From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#37452: 26.3; skip-syntax-forward doesn't work in python-mode Date: Wed, 18 Sep 2019 18:37:39 -0400 Message-ID: <877e659qoc.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="157897"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 37452@debbugs.gnu.org To: Amai Kinono Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 19 00:38:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iAiaQ-000exU-SW for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Sep 2019 00:38:11 +0200 Original-Received: from localhost ([::1]:35692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAiaP-00059I-Qn for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Sep 2019 18:38:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57353) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAiaJ-000593-FW for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 18:38:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAiaI-0008SZ-FB for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 18:38:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46125) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAiaI-0008SV-Bq for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 18:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iAiaI-0002JA-7h for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 18:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Sep 2019 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37452 X-GNU-PR-Package: emacs Original-Received: via spool by 37452-submit@debbugs.gnu.org id=B37452.15688462688843 (code B ref 37452); Wed, 18 Sep 2019 22:38:02 +0000 Original-Received: (at 37452) by debbugs.gnu.org; 18 Sep 2019 22:37:48 +0000 Original-Received: from localhost ([127.0.0.1]:54946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAia4-0002IY-K3 for submit@debbugs.gnu.org; Wed, 18 Sep 2019 18:37:48 -0400 Original-Received: from mail-io1-f53.google.com ([209.85.166.53]:37899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAia2-0002II-QQ for 37452@debbugs.gnu.org; Wed, 18 Sep 2019 18:37:47 -0400 Original-Received: by mail-io1-f53.google.com with SMTP id k5so3065918iol.5 for <37452@debbugs.gnu.org>; Wed, 18 Sep 2019 15:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=hdzlvbDO8xb0JBEBWf0NCNxMaVAjc0YX17nuN/pRbok=; b=XOv3bhMVe5ntsbHT5QLV09rzRINDvhVWNJZ7teeQS2W0RuXf1V5WBf3cXRbr9c1GG2 hfSVWVE8DyM4yQMm9rlw3qBxm1IcQFXS4chGrK/1tLv8D157HMeGzH5kfU4ywVq1FSsP 9m69j0D5aYjCjYps7Ver0z8lkKQwbiw+LRmQ/fmBvOGfPSu7cR1iMVvxXZPv0s/kySHV tIvSTDOUcqzdYR7PcVI80AhOhUluciLyZAOqHx+wZYgMtQLkS3OuhwnAZey3Q0RXeA2Z A5D1dD3+ErmmdSLnPgyeP4rdWkNmOBd/9g8/+a9RyTR46D4fcja5v5Fhc8CBSJmTPCKc 3icA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=hdzlvbDO8xb0JBEBWf0NCNxMaVAjc0YX17nuN/pRbok=; b=bBygRvq9Zb6q84Hkctvq356qqcANLD3dasUsMIlrkUIYXwl0gBJ7xc+gx4VYP9ZN9z cdGgQ8x9LiYvQ6H4sTn2nY4FU8lY2kuhKz3EcviZO9XPckvBcj21vvTGlTOekXp6uh0U WRc3m1rRtUYB36X9Ua3UikcApx8lHYssqxvB9NG3yl0hkpCbPQ/+TlXsUKZMEylZA/Ti YD2l2m1ukl6okGEL9oTplLisD+c6ss7GxWOBeMhSRCh1RuAFyVOqaAdQvCubF+YjlFzy f/0zQgs3uxRLwhePmXlWf+B2BzCYMRmzSSvMiN5pp8kguv4+ksPFU+1XBpuD61hZPJUO gfcg== X-Gm-Message-State: APjAAAXgqFBf6UxcOJ3C/SKRnz3hRCY3raGWKwuPHAsHjqM3VzZ8mDAS H4oBtj3dC0oO9jbBIpU6eHHGaqwB X-Google-Smtp-Source: APXvYqzD1gVbZ22AMjjE5Pu3PHzdySNmAxC5EaaVgt6S2SkqeygbCD90wO5UmV9oK2sqEDNQ5yMTrw== X-Received: by 2002:a6b:b243:: with SMTP id b64mr6424287iof.252.1568846261090; Wed, 18 Sep 2019 15:37:41 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id j11sm4349523ioa.55.2019.09.18.15.37.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Sep 2019 15:37:40 -0700 (PDT) In-Reply-To: (Amai Kinono's message of "Thu, 19 Sep 2019 03:07:48 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166692 Archived-At: Amai Kinono writes: > (defun skip-syntax () > (interactive) > (skip-syntax-forward (char-to-string (char-syntax (char-after))))) If you look at char-syntax's docstring, you should see If you=E2=80=99re trying to determine the syntax of characters in the b= uffer, this is probably the wrong function to use, because it can=E2=80=99t ta= ke =E2=80=98syntax-table=E2=80=99 text properties into account. Consider = using =E2=80=98syntax-after=E2=80=99 instead. Which is exactly the situation you've encountered here: python-mode sets the syntax of the quote to string fence ("|") using a text property. This version of skip-syntax should work: (defun syntax-class-to-char (syntax-class) (aref " .w_()'\"$\\/<>@!|" syntax-class)) (defun skip-syntax () (interactive) (skip-syntax-forward (char-to-string (syntax-class-to-char (syntax-class (syntax-after (point))))))) Although I'd say that the function syntax-class-to-char should be added to Emacs (in syntax.c, so that it can reuse syntax_code_spec).