From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pierre Rouleau Newsgroups: gmane.emacs.help Subject: Re: How to make `forward-sexp` handle other balanced character-pairs such as < and > or << and >> in erlang-mode or others? Date: Mon, 27 Sep 2021 17:22:16 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27508"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: thibaut.verron@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 27 23:23:19 2021 Return-path: Envelope-to: geh-help-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 1mUy5n-0006xF-2T for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 23:23:19 +0200 Original-Received: from localhost ([::1]:44954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUy5l-00026C-5b for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 17:23:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUy50-00025k-MH for help-gnu-emacs@gnu.org; Mon, 27 Sep 2021 17:22:31 -0400 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:33421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUy4z-00021K-2o for help-gnu-emacs@gnu.org; Mon, 27 Sep 2021 17:22:30 -0400 Original-Received: by mail-ed1-x52b.google.com with SMTP id b26so26350364edt.0 for ; Mon, 27 Sep 2021 14:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QM1UF0q6Rry5PXimbrKHa3vV6HXpDtpmFaxPbDb+o7U=; b=AYNVhjNMUpu7maSGcLIPODfivcIPwnWsS8EVN4fLem0Rm6Jqs0z29vV448DR1wgPVI zHGgFQ4TF1N/Mx00DMKrSBb1BPcfn5G7nkSFU/qOCo1ZmoZwA2kCElG07CNKWzr8Mcn4 u1XI8Ti0fjNmAD7mb++fhkH5eaOLLwdMM2Jh5W22LqJr3IGuiMTufHZDYVzaJ6LhnhJa Up3olO1GQHYF4faWClFnPztlHKigpgDOwluonfDQAwpudrfbiSupqY2j2uVoUBD9Bpku UJuPaC0faXJ0x+VpMMwXt7cMbxxbVQcWcGGtoMhKIfmZlMcd0Eg6uKmnhAN1Uwn2+F4J NbpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QM1UF0q6Rry5PXimbrKHa3vV6HXpDtpmFaxPbDb+o7U=; b=jmaApijwcj2UzzHfmY8cg9YpbWIne7FSFWyrlT1SSW7FalP1vtwNPZBbekHjmP12og 7RxA3gczUzEAxZ9KtV7F7Z4aMohE0csFGkkJhFX86cY8ruamIyAFKbxB0ebd0B8FskXW 1QTDG7FmMp5JsLKH9x9HptRovhooBVOc88C9acf4hpX0rPfQq/JepqNbzYk31m5ogFsa o/YD8UhDASGc1a+mklOXo1sAnMq5ArpUJb1DQQLiOiK2aRLqK5YwuzSIVBvO+EdY367I J2/12lgoaW9me7iAH9VsJ4SwWe9T1bZsU6FFqksNDZOpTPMU8kKPLZZFdGLXXMqFbuxr IEkQ== X-Gm-Message-State: AOAM531fUx+Jbv/p1NEKcPxbF+/ohOTqwAtzVcp1F6N0rmyNM7PmvNKr qyja2xwR5v7R2LAHIzpyxw5Vt56N0eN1k8Rblf0= X-Google-Smtp-Source: ABdhPJwfE3Ei0Tf7LYi7RUeYVrQxP+ZTpAWjg/xr385GSTsJ6vdQAHUIums0cqLmahOMEBBSKl7Mu5vwU2Yj+sxBy28= X-Received: by 2002:a05:6402:34d2:: with SMTP id w18mr2944406edc.222.1632777747781; Mon, 27 Sep 2021 14:22:27 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=prouleau001@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133304 Archived-At: On Mon, Sep 27, 2021 at 5:14 PM Thibaut Verron wrote: > Hi, > > Adding the characters to the syntax table is the canonical answer. > Maybe erlang-mode sets forward-sexp-function? This is typically done > to enhance the sexp movement beyond simple parentheses, for instance > for modes using SMIE. > > If you (setq forward-sexp-function nil), does forward-sexp do what you > want? > > In erlang-mode forward-sexp-function is already nil and forward-sexp does not deal with ?< and ?> as a matching pair then. I tried to modify the syntax table but that did not work either. At the moment I'm trying to write a function that I will provide as the forward-sexp-function to do the job. Really I would think would have been to modify the syntax table to get scan-sexps to do the job. Perhaps something inside erlang.el /erlang-mode gets in the way, but I have not fully studied its code