From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron 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 23:34:34 +0200 Message-ID: References: Reply-To: thibaut.verron@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5177"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Pierre Rouleau Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 27 23:35:26 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 1mUyHW-0001BD-ND for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 23:35:26 +0200 Original-Received: from localhost ([::1]:46732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUyHU-0003zd-GI for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 17:35:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUyGu-0003zE-US for help-gnu-emacs@gnu.org; Mon, 27 Sep 2021 17:34:48 -0400 Original-Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]:46857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUyGt-00046R-Fu for help-gnu-emacs@gnu.org; Mon, 27 Sep 2021 17:34:48 -0400 Original-Received: by mail-yb1-xb33.google.com with SMTP id h2so27177284ybi.13 for ; Mon, 27 Sep 2021 14:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=7M9MvdpSAaYiqNZwkkAyHlSpGjBGvuX+lP3ixdJz4fg=; b=S1Twqb9vLVXPIyeKzzLMjQW2Cz/AUOfFTp4v584aW2gpanf7BJtquX+TZF9GAWKkW/ ElZAD5+xb/2Ae1nXvbCWlV4nVBSdgMX97xp9+5OPaodSbsqzsgGiywKHvvklZ4O0FCH5 OLs+s9m3vwqZOBjMBEdH+ODeDs254cnVsigs68V6AC8eEyMtKwUbVuXUBGCQSMQLdwCU YDUv7aHgH/T43JXSI+9hxj9z7DeMTQIlUe309VJ0qe3LsS8njm6Cy8uGUBwf+SoDoTti Oui26uM+lF+gKooty0wzLFPavMcHpgIzbvJsyXSo3TweHIg8jUALUbIFUbo/wN+BGdkn gGzw== 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:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=7M9MvdpSAaYiqNZwkkAyHlSpGjBGvuX+lP3ixdJz4fg=; b=HbXXZ56fDgzkEKGi72SkdlCwXPbIGTOhYXBjUwNgQj+zrLyBnrK+n02gid8puOFHfd ix6mEXKw6Is8kH199SmgI6fV1Q8OIFIO6zLHgLwbPH/+GR/YQWoAiXe9Z2tlumd+cwNm oPCbWvByvZ6HktNJX+Z4nejYqhlULF2xO9UcSRaSuUiFzcXFVDc1/ZZyJXvInTq16ZSJ L97MTWsMfUUy8HTGoCoDEkaX9+2E81gCYwXoeN4E8mwLLZeoICpcaIhc96zBVFQwvXrL ahXKme8Apw58WzJvlPbxkX62hze9ESin05J77Yiti1omCyZVGxVrGB3aTGkYD/SdYph1 nPQA== X-Gm-Message-State: AOAM530K3tLWLRyk9fyYYwRyvRATEV3X5j1zBithrsKS+QsRU6FYr063 f7B0lnNv2GJqOp2T/HbINx3gi3mFCLqZEUWK6f21gveMOhTLUdcM X-Google-Smtp-Source: ABdhPJwCCiuQZ51D2jgt/t1AFfDFYFHjJ9/ZkOU6gumZbEgwubt+Ylb6opb41tHbkLeMtpV9RFyKiQmXPdzloHjP5Js= X-Received: by 2002:a25:1b08:: with SMTP id b8mr2605908ybb.284.1632778486119; Mon, 27 Sep 2021 14:34:46 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::b33; envelope-from=thibaut.verron@gmail.com; helo=mail-yb1-xb33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=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-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:133305 Archived-At: Le lun. 27 sept. 2021 =C3=A0 23:22, Pierre Rouleau = a =C3=A9crit : > > > > 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 w= ant? >> > > 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. How are you modifying the syntax table? Directly in the source code of the erlang mode, or in your user configuration? If it's in the source code, maybe there is a compiled .elc file which shadows your modifications? If it's in your user configuration, you have to make sure that you define the new syntax table before loading the major-mode. If erlang.el defines the syntax table with a defvar, it won't change the variable if already set. But it's important that the define-derived-mode form gets evaluated with the new syntax table. > Really I would think would have been to modify the syntax table to get sc= an-sexps to > do the job. Yes that should be the case. Best wishes, Thibaut