emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help understanding ruby.el percent literal syntax


From: Philippe Vaucher
Subject: Help understanding ruby.el percent literal syntax
Date: Wed, 19 Jun 2019 11:33:49 +0200

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]