GNU bug report logs - #48043
UTF-8 magic comment is unwelcome with recent Ruby versions

Previous Next

Package: emacs;

Reported by: Peter Oliver <p.d.oliver <at> mavit.org.uk>

Date: Mon, 26 Apr 2021 18:29:01 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 48043 <at> debbugs.gnu.org (full text, mbox):

From: Peter Oliver <p.d.oliver <at> mavit.org.uk>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 48043 <at> debbugs.gnu.org
Subject: Re: bug#48043: UTF-8 magic comment is unwelcome with recent Ruby
 versions
Date: Tue, 27 Apr 2021 16:29:17 +0100 (BST)
[Message part 1 (text/plain, inline)]
On Tue, 27 Apr 2021, Dmitry Gutov wrote:

> On 26.04.2021 21:28, Peter Oliver wrote:
>
>>  Two patches are attached to address this:
>>
>>  - The first patch adds a new choice to ruby-insert-encoding-magic-comment,
>>  unless-utf8, which causes the magic comment not to be inserted if the
>>  encoding is UTF-8.
>>
>>  - The second patch, perhaps more controversially, makes this the default.
>
> Both changes make sense to me.
>
> However, I've looked at the existing code and found a prior change which 
> intended for this to be more customizable already, yet had a minor bug.
>
> Please try out the following patch:

That works for me, and I think is more straightforward than my approach.  Thanks.

Attached is an additional patch which adapts the tests added in my patch for your patch.

-- 
Peter Oliver
[0001-Test-ruby-mode-set-encoding-with-a-few-different-enc.patch (text/plain, attachment)]

This bug report was last modified 4 years and 23 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.