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:48:28 -0400 Message-ID: References: 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="31043"; 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:49:07 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 1mUyUk-0007to-D9 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 23:49:06 +0200 Original-Received: from localhost ([::1]:51846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUyUi-0000Bx-VA for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 17:49:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUyUM-0000Bp-4U for help-gnu-emacs@gnu.org; Mon, 27 Sep 2021 17:48:42 -0400 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:43633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUyUK-0006HQ-MY for help-gnu-emacs@gnu.org; Mon, 27 Sep 2021 17:48:41 -0400 Original-Received: by mail-ed1-x536.google.com with SMTP id v10so70503260edj.10 for ; Mon, 27 Sep 2021 14:48:40 -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=yJXaZDOy8fTiFDSH9qv/EvNtx/hq4rannOq6hLjyyWA=; b=ku3hdbpX0AspVXWca2/6b3uR1aZ2BSv3s+4SLNjq5JcdVaFRN81eyaqR8Zubvo4mP2 U+9cs3NQk6JmaN7UtYaZAV9r26AN6qs8w8wdniddEE/5++YNguovmwDEIP8TMI25P58B Bb84XQMd5oiwiBBsZf8MncVwSvJrio6Lw0B56uQ3vGwroPyeJ7E7+yAOydkUUm5O/ChZ ZMM2fLWetGYNmZKfel8SOpEOMMalvZdJSY5oeHInmDC7gICASkd+qjz9dn+ycOdcwiwB vHLH0B/XetBlkZ1c6+TZYXoHG9dD3BOaoeL9rYXDl3KN944T6xlwQIuHTvZqA0VEYBcu a/RA== 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=yJXaZDOy8fTiFDSH9qv/EvNtx/hq4rannOq6hLjyyWA=; b=lFNIk+RZxDotLWRW0toAG3pH6dBFuf5D1opFynv+Ng2BfH53GBIAilRa3FywcRlXJH qwAZozANjPkJ3AEq3c4VHlF2GFz5/Uro01wy8Yju9j9GDuQ/UkeF+waq06q1RGgv1sI4 a36VmnIysbdNoxNAJLNTngkS4vE5cgS2HqUgWmErSnSebmJWA82am2QG67oEwowWsoiW xsxV+s20IEX+31qoGDKg1dLTbk4oH79fn1+ekSTa1n6TsvQuY6xjyLfIgeLiYiuSNFHr +bJy0cthTaeflw0X9N36VGIROGKGsbeu86hsAf5Stwd418+cUchfAFIENn6dw+Fsh/Zx sTZg== X-Gm-Message-State: AOAM531EKXwhiE9F8z0BsCoXOOf3paiMh6xrHvqi50VY5xR8zHU1vV1U TQBwZZwv339AUtYnMBMo7l8Ybb7ZU9+sECt4g5A= X-Google-Smtp-Source: ABdhPJyX9b+zlJAbbCnzXwWyehK4oN3pHdrbAPPSJ4J5x8MFwQlmCDnVkFlxJe5GLTmZ9kq5Ar5TY6uTgqKoWT+o3Aw= X-Received: by 2002:a17:906:63ca:: with SMTP id u10mr2700019ejk.411.1632779319306; Mon, 27 Sep 2021 14:48:39 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=prouleau001@gmail.com; helo=mail-ed1-x536.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:133306 Archived-At: On Mon, Sep 27, 2021 at 5:34 PM Thibaut Verron wrote: > 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: > >> > > How are you modifying the syntax table? Directly in the source code of > the erlang mode, or in your user configuration? > > For investigation purpose I modified the erlang.el file directly and then byte compiled it, ensuring that my modifications are taken by adding a special variable I can check. I modified the code inside the function `erlang-ensure-syntax-table-is-initialized' which dynamically modifies the syntax table because the initial variable sets it to nil. I commented out the lines that identified ?< and ?> as "." and added after the following 2 lines: (modify-syntax-entry ?< "(>" table) (modify-syntax-entry ?> "(<" table) After byte-compiling I start a new Emacs instance and open a .erl file which uses the erlang-mode. Then I check if the syntax table is what I think it should be by executing describe-syntax. --=20 /Pierre