[Top][All Lists]

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

bug#33487: [PATCH] bug of ruby-forward-sexp and ruby-backward-sexp

From: Dmitry Gutov
Subject: bug#33487: [PATCH] bug of ruby-forward-sexp and ruby-backward-sexp
Date: Tue, 11 Dec 2018 03:18:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Thunderbird/64.0

Version: 27.0

Hi Nobuyoshi,

On 24.11.2018 18:20, Nobuyoshi Nakada wrote:
With lisp/progmodes/ruby-mode.el in Emacs 26.1, `ruby-forward-sexp' and `ruby-backward-sexp' cannot work with block arguments which end without argument name.


     proc do |a,|



     proc do |a,*|


The reason is that `smie-default-forward-token' and `smie-default-backward-token' just scan punctuation and the closing bar together, and return ",|" or ",*|" in the above examples, then the "opening-|" cannot find "matching closing-|".

The following patch trims the token and adjust the cursor position in those cases.

Thank you for the patch. I've simplified it a little: regexps smaller, tests shorter, and removed a few of the latter (seemed redundant), and pushed.

Please let me know if there is anything amiss in the resulting patch: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3729a3f88fd7ce1d8a1a7f2ea61e8c4d05e954ab

reply via email to

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