From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Philippe Vaucher Newsgroups: gmane.emacs.devel Subject: Help understanding ruby.el percent literal syntax Date: Wed, 19 Jun 2019 11:33:49 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c35a5f058ba9eeb2" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="210262"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 19 11:45:11 2019 Return-path: Envelope-to: ged-emacs-devel@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 1hdX9R-000sX8-Dx for ged-emacs-devel@m.gmane.org; Wed, 19 Jun 2019 11:45:09 +0200 Original-Received: from localhost ([::1]:36274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdX9Q-0002Nx-7s for ged-emacs-devel@m.gmane.org; Wed, 19 Jun 2019 05:45:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38938) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdWyy-0008QC-2W for emacs-devel@gnu.org; Wed, 19 Jun 2019 05:34:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdWyw-00042y-9O for emacs-devel@gnu.org; Wed, 19 Jun 2019 05:34:19 -0400 Original-Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]:46429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdWyv-0003zm-UL for emacs-devel@gnu.org; Wed, 19 Jun 2019 05:34:18 -0400 Original-Received: by mail-lj1-x241.google.com with SMTP id v24so2511340ljg.13 for ; Wed, 19 Jun 2019 02:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=jjaqYOG6E4R39zq6iAlD/eKO/DTOBTjCvBz6TFRl+9w=; b=tBrtdL15jIwvBc5mwzNO8zYE7nt1boQJ2I4vPmOM5aAqE9fas4Hb69897x6C/CUiVu t06hleOiT7Oz3E/mCk/yAeGfIhEBs1RmndUiDxrGMfjm79kmafZ0/YK6UlxapGVEFx3F plH14VmxeRIT40P5HMgfEZj00eUu990m8yc6lupthFYE1tK5iouTqwaLhOG7enK4YLj4 vSJp2s2o2xMO1kv3Mcz16SXzS2KZJ/0Odf0oAu7Kr9f+ScE5xb+ev0q2AL8l87kFeJW0 iLMw1LTAxVeoXLLrursqiJBbFpsJZg7bcC0DAR0C3Dja+iZpKABa/5Hzz+l4/ELLYuoj AsVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jjaqYOG6E4R39zq6iAlD/eKO/DTOBTjCvBz6TFRl+9w=; b=l3QcnbANAZoephNebt5nb0YEJinKv6xiwc+NKqi7G2xqc7K7yQuj5mNC5ANRPvLAeC 6WJi7MZV0unQwSnjuGjwl1pc29JwkrCV9BQTp+HXYG19y/BCfecBHFIUVbxsiLV5QYeH 7UEA0N1uMoxCnLxKGz8wigbFHTbOCrd502eGWV3OeiGPmXhujfv8ak3CReB/kCqjsgO+ yNgCHM7f4KP539Z0GA/lgaNIk5UAvZNZQF48aUNrHja8FY9j1A7vJn9QPw2GYov2fhx3 XrJpyA9xhHZvcfAX1SCdwJf3T0akfaIyqeb/I3/Qs6WLTx0GTeH325c+7/E39fwuXyYf IBUA== X-Gm-Message-State: APjAAAUJXdVIprEPjFLOnMemHYDUHWIhNfcF1THLNzqjdHLxhePm1xVC CnFsk/5JqSCW/ZdNpH1ekp/x6RQq79WsJSAXzJilCKvXSaI= X-Google-Smtp-Source: APXvYqzmGcqxVXBJolyia9uw/CYyLD1pNG74nDAPlT1l+tQaEZw8ds7weJ6WDV7DdaQct4/Ljt1/D7gdGxDjX6m2MZ4= X-Received: by 2002:a2e:970d:: with SMTP id r13mr54880577lji.126.1560936855065; Wed, 19 Jun 2019 02:34:15 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237882 Archived-At: --000000000000c35a5f058ba9eeb2 Content-Type: text/plain; charset="UTF-8" Hello, We are trying to solve a bug in evil-surround at https://github.com/emacs-evil/evil-surround/issues/154. The bug is that percent literals refuse to be replaced when you try to replace a pair of "{}" with "()" using evil-surround, because ruby.el modifies the percent literal syntax table in a special way (when we use `fundamental-mode' then things works as expected). Thus we are trying to understand the purpose of `ruby-syntax-propertize-percent-literal' function ( https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/ruby-mode.el#L1971-L1999) which is called from `ruby-syntax-propertize' ( https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/ruby-mode.el#L1929 ). If I comment out the call to `ruby-syntax-propertize-percent-literal', then the bug in evil-surround is gone, and everything just looks the same visually (the percent literals are correctly highlighted). I don't understand what purpose this function has. Maybe some other parts of ruby.el rely on this syntax-table modification? If someone can point to other parts in ruby.el that require this function to be called, maybe we can then figure out what the "bug" is in that function, and possibly offer a patch. Kind regards, Philippe --000000000000c35a5f058ba9eeb2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

We are trying to solve a bug in = evil-surround at=C2=A0https://github.com/emacs-evil/evil-surround/issues/154. T= he bug is that percent literals refuse to be replaced when you try to repla= ce a pair of "{}" with "()" using evil-surround, becaus= e ruby.el modifies the percent literal syntax table in a special way (when = we use `fundamental-mode' then things works as expected).
Thus we are trying to understand the purpose of `ruby-syntax-pr= opertize-percent-literal' function (https://= github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/ruby-mode.el#L1971= -L1999) which is called from `ruby-syntax-propertize' (https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/r= uby-mode.el#L1929).

If I comment out the call = to `ruby-syntax-propertize-percent-literal', then the bug in evil-surro= und is gone, and everything just looks the same visually (the percent liter= als are correctly highlighted). I don't understand what purpose this fu= nction has. Maybe some other parts of ruby.el rely on this syntax-table mod= ification?

If someone can point to other parts in = ruby.el that require this function to be called, maybe we can then figure o= ut what the "bug" is in that function, and possibly offer a patch= .

Kind regards,
Philippe

<= /div>
--000000000000c35a5f058ba9eeb2--