ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:96742] [Ruby master Bug#16495] Inconsistant Quotes in Error Messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
@ 2020-01-09 21:54 ` kolano
  2020-01-09 22:58   ` [ruby-core:96743] " Austin Ziegler
  2020-01-10  0:36 ` [ruby-core:96745] [Ruby master Feature#16495] " shevegen
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 10+ messages in thread
From: kolano @ 2020-01-09 21:54 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been reported by Kolano (Kenneth Kolano).

----------------------------------------
Bug #16495: Inconsistant Quotes in Error Messages
https://bugs.ruby-lang.org/issues/16495

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.5.3
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance...

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```
...where a "fancy" quote is used on the left-hand side, and a standard single quote is used on the right.

The same quotes should be used on either side of elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96743] Re: [Ruby master Bug#16495] Inconsistant Quotes in Error Messages
  2020-01-09 21:54 ` [ruby-core:96742] [Ruby master Bug#16495] Inconsistant Quotes in Error Messages kolano
@ 2020-01-09 22:58   ` Austin Ziegler
  0 siblings, 0 replies; 10+ messages in thread
From: Austin Ziegler @ 2020-01-09 22:58 UTC (permalink / raw)
  To: Ruby developers


[-- Attachment #1.1: Type: text/plain, Size: 1500 bytes --]

This is an old-school Unix terminal way of mimicking the use of ‘fancy
quoting’ by using the backtick (`) and single quote (') because on
*some* terminals
they were shaped the same as ‘ and ’. Changing this would break many error
parsers that are used to Ruby doing it this way.

-a

On Thu, Jan 9, 2020 at 4:54 PM <kolano@gmail.com> wrote:

> Issue #16495 has been reported by Kolano (Kenneth Kolano).
>
> ----------------------------------------
> Bug #16495: Inconsistant Quotes in Error Messages
> https://bugs.ruby-lang.org/issues/16495
>
> * Author: Kolano (Kenneth Kolano)
> * Status: Open
> * Priority: Normal
> * Assignee:
> * Target version:
> * ruby -v: 2.5.3
> * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
> ----------------------------------------
> Error messages use inconsistent pairs of quotes, for instance...
>
> ```
> -e:1:in `<main>': undefined local variable or method `foo' for main:Object
> (NameError)
> ```
> ...where a "fancy" quote is used on the left-hand side, and a standard
> single quote is used on the right.
>
> The same quotes should be used on either side of elements being quoted.
>
>
>
> --
> https://bugs.ruby-lang.org/
>
> Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
>


-- 
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

[-- Attachment #1.2: Type: text/html, Size: 2586 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96745] [Ruby master Feature#16495] Inconsistant Quotes in Error Messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
  2020-01-09 21:54 ` [ruby-core:96742] [Ruby master Bug#16495] Inconsistant Quotes in Error Messages kolano
@ 2020-01-10  0:36 ` shevegen
  2020-01-10  1:05 ` [ruby-core:96746] " nobu
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: shevegen @ 2020-01-10  0:36 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by shevegen (Robert A. Heiler).


Hmm. Is this encoding-related perhaps? I remember having had that when I used ISO (ISO-8859-1 specifically, and
a non-utf locale too). Nowadays, with Unicode, I don't seem to have this inconsistent quote - but I understand
what you refer to. I used to think that it was used to denote the start, and end part of the content. :P
(They are not the same characters in general right? Otherwise they would appear the same. I always thought it
may be some standard, perhaps to make parsing easier or something.)

Never bothered me that much to really investigate, though.

----------------------------------------
Feature #16495: Inconsistant Quotes in Error Messages
https://bugs.ruby-lang.org/issues/16495#change-83732

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance...

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```
...where a "fancy" quote is used on the left-hand side, and a standard single quote is used on the right.

The same quotes should be used on either side of elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96746] [Ruby master Feature#16495] Inconsistant Quotes in Error Messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
  2020-01-09 21:54 ` [ruby-core:96742] [Ruby master Bug#16495] Inconsistant Quotes in Error Messages kolano
  2020-01-10  0:36 ` [ruby-core:96745] [Ruby master Feature#16495] " shevegen
@ 2020-01-10  1:05 ` nobu
  2020-01-16  8:30 ` [ruby-core:96902] [Ruby master Feature#16495] Inconsistent quotes in error messages matz
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: nobu @ 2020-01-10  1:05 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by nobu (Nobuyoshi Nakada).


This combination is very common, e.g., Emacs, TeX, etc.

----------------------------------------
Feature #16495: Inconsistant Quotes in Error Messages
https://bugs.ruby-lang.org/issues/16495#change-83733

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance...

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```
...where a "fancy" quote is used on the left-hand side, and a standard single quote is used on the right.

The same quotes should be used on either side of elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96902] [Ruby master Feature#16495] Inconsistent quotes in error messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2020-01-10  1:05 ` [ruby-core:96746] " nobu
@ 2020-01-16  8:30 ` matz
  2020-01-17 15:06 ` [ruby-core:96928] " daniel
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: matz @ 2020-01-16  8:30 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by matz (Yukihiro Matsumoto).


It was something cultural. I admit nowadays very few people use backquote as a left-hand quote, but it used to be. I also admit consistent quotes are easier for our eyes when using recent major fonts. But changing those quotes may affect existing log parsers. We have to estimate how big is the influence of the changes.

Matz.


----------------------------------------
Feature #16495: Inconsistent quotes in error messages
https://bugs.ruby-lang.org/issues/16495#change-83919

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance:

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```

where a back tick is used on the left-hand side, and a single quote is used on the right.

The same quotes should be used on either side of the elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96928] [Ruby master Feature#16495] Inconsistent quotes in error messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2020-01-16  8:30 ` [ruby-core:96902] [Ruby master Feature#16495] Inconsistent quotes in error messages matz
@ 2020-01-17 15:06 ` daniel
  2020-01-18 17:14 ` [ruby-core:96935] " ruby-core
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: daniel @ 2020-01-17 15:06 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by Dan0042 (Daniel DeLorme).


Maybe a fix could involve customization of which quotes to display via an ENV var or something?
Instead of changing the code all over the place you'd just be changing e.g. `rb_sprintf` to replace matching sets of ` and ' to use the custom quotes.
So it would be possible to dynamically set the quotes to ' and ' (or even unicode ‘ and ’) if you don't use log parsers that rely on the regular behavior.
Log parsers could eventually use these custom quotes for their parsing.
It would be possible for individuals to gradually experiment and report bugs where custom quote are causing trouble.
Just an idea...

----------------------------------------
Feature #16495: Inconsistent quotes in error messages
https://bugs.ruby-lang.org/issues/16495#change-83951

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance:

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```

where a back tick is used on the left-hand side, and a single quote is used on the right.

The same quotes should be used on either side of the elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96935] [Ruby master Feature#16495] Inconsistent quotes in error messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2020-01-17 15:06 ` [ruby-core:96928] " daniel
@ 2020-01-18 17:14 ` ruby-core
  2020-01-18 17:23 ` [ruby-core:96936] " zverok.offline
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ruby-core @ 2020-01-18 17:14 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by marcandre (Marc-Andre Lafortune).

Assignee set to matz (Yukihiro Matsumoto)

I fail to see the actual gain.

This would introducing potential incompatibilities. For example, I remember [parsing using these quotes myself](https://github.com/marcandre/backports/blob/master/lib/backports/1.8.7/kernel/__method__.rb#L4) (this code isn't used for recent rubies so  doing the change wouldn't actually affect it).

Please reject this.

----------------------------------------
Feature #16495: Inconsistent quotes in error messages
https://bugs.ruby-lang.org/issues/16495#change-83963

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance:

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```

where a back tick is used on the left-hand side, and a single quote is used on the right.

The same quotes should be used on either side of the elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96936] [Ruby master Feature#16495] Inconsistent quotes in error messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2020-01-18 17:14 ` [ruby-core:96935] " ruby-core
@ 2020-01-18 17:23 ` zverok.offline
  2020-01-19  2:22 ` [ruby-core:96939] " nobu
  2020-01-19 12:13 ` [ruby-core:96944] " zverok.offline
  8 siblings, 0 replies; 10+ messages in thread
From: zverok.offline @ 2020-01-18 17:23 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by zverok (Victor Shepelev).


> I fail to see the actual gain.


As it was already pointed in related tickets, the gain (or rather the problem solved) comes when the error message is copy-pasted into any input field supporting Markdown or Markdown-alike syntax. This includes this very tracker; and GitHub/GitLab comments/PRs; and Slack and any of its open- or closed-source modern alternatives, like Gitter or Mattermost; and almost any other of developer-friendly software that emerged in the last 10 years or so. I believe it is relatively small, but constantly annoying problem.

----------------------------------------
Feature #16495: Inconsistent quotes in error messages
https://bugs.ruby-lang.org/issues/16495#change-83964

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance:

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```

where a back tick is used on the left-hand side, and a single quote is used on the right.

The same quotes should be used on either side of the elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96939] [Ruby master Feature#16495] Inconsistent quotes in error messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
                   ` (6 preceding siblings ...)
  2020-01-18 17:23 ` [ruby-core:96936] " zverok.offline
@ 2020-01-19  2:22 ` nobu
  2020-01-19 12:13 ` [ruby-core:96944] " zverok.offline
  8 siblings, 0 replies; 10+ messages in thread
From: nobu @ 2020-01-19  2:22 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by nobu (Nobuyoshi Nakada).


zverok (Victor Shepelev) wrote:
> > I fail to see the actual gain.
> 
> 
> As it was already pointed in related tickets, the gain (or rather the problem solved) comes when the error message is copy-pasted into any input field supporting Markdown or Markdown-alike syntax. This includes this very tracker; and GitHub/GitLab comments/PRs; and Slack and any of its open- or closed-source modern alternatives, like Gitter or Mattermost; and almost any other of developer-friendly software that emerged in the last 10 years or so. I believe it is relatively small, but constantly annoying problem.

Why don't you use block quoting?

----------------------------------------
Feature #16495: Inconsistent quotes in error messages
https://bugs.ruby-lang.org/issues/16495#change-83966

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance:

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```

where a back tick is used on the left-hand side, and a single quote is used on the right.

The same quotes should be used on either side of the elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:96944] [Ruby master Feature#16495] Inconsistent quotes in error messages
       [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
                   ` (7 preceding siblings ...)
  2020-01-19  2:22 ` [ruby-core:96939] " nobu
@ 2020-01-19 12:13 ` zverok.offline
  8 siblings, 0 replies; 10+ messages in thread
From: zverok.offline @ 2020-01-19 12:13 UTC (permalink / raw)
  To: ruby-core

Issue #16495 has been updated by zverok (Victor Shepelev).


@nobu

> Why don't you use block quoting?

Because error messages are by their nature something you frequently want to communicate quickly and inline? 
Here are some examples of backtick breaking communication: https://gist.github.com/zverok/a4fcacab3dc06d9d7585c82cad8a8dc6

----------------------------------------
Feature #16495: Inconsistent quotes in error messages
https://bugs.ruby-lang.org/issues/16495#change-83971

* Author: Kolano (Kenneth Kolano)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
Error messages use inconsistent pairs of quotes, for instance:

```
-e:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)
```

where a back tick is used on the left-hand side, and a single quote is used on the right.

The same quotes should be used on either side of the elements being quoted.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-19 12:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-16495.20200109215418@ruby-lang.org>
2020-01-09 21:54 ` [ruby-core:96742] [Ruby master Bug#16495] Inconsistant Quotes in Error Messages kolano
2020-01-09 22:58   ` [ruby-core:96743] " Austin Ziegler
2020-01-10  0:36 ` [ruby-core:96745] [Ruby master Feature#16495] " shevegen
2020-01-10  1:05 ` [ruby-core:96746] " nobu
2020-01-16  8:30 ` [ruby-core:96902] [Ruby master Feature#16495] Inconsistent quotes in error messages matz
2020-01-17 15:06 ` [ruby-core:96928] " daniel
2020-01-18 17:14 ` [ruby-core:96935] " ruby-core
2020-01-18 17:23 ` [ruby-core:96936] " zverok.offline
2020-01-19  2:22 ` [ruby-core:96939] " nobu
2020-01-19 12:13 ` [ruby-core:96944] " zverok.offline

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).