GNU bug report logs -
#24181
25.1.50; ruby mode: wrong auto indent after "?" string literal
Previous Next
Reported by: Ryo Furue <ryofurue <at> gmail.com>
Date: Mon, 8 Aug 2016 03:52:02 UTC
Severity: normal
Tags: wontfix
Found in version 25.1.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi!
On 08/08/2016 06:50 AM, Ryo Furue wrote:
> 1. Open an empty Ruby source code, say "tmp.rb".
> 2. Type the following:
>
> #!/usr/bin/ruby
> base = ?a.ord - 1
>
> On hitting the return key at the end of the second line, the cursor
> moves below "a", not to the top of the third line. The indentation
> state seems to be confused. I did this test with "emacs -q" .
Thanks for the report. I'd like to fix it sometime, but it's not a big
priority, considering this syntax is usually discouraged:
https://github.com/bbatsov/ruby-style-guide#no-character-literals
> ?a is a valid Ruby syntax for string literal. After writing this, I learned
> that "a".ord is equivalent (I think)
Yes, in Ruby 1.9 and newer, it's a full equivalent.
This bug report was last modified 3 years and 280 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.