GNU bug report logs - #19946
js-mode indentation with mixed Unix/DOS line endings

Previous Next

Package: emacs;

Reported by: jostein <at> kjonigsen.net

Date: Wed, 25 Feb 2015 16:45:03 UTC

Severity: minor

Tags: wontfix

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Colascione <dancol <at> dancol.org>
To: jostein <at> kjonigsen.net, Dmitry Gutov <dgutov <at> yandex.ru>, Simen Heggestøyl <simenheg <at> gmail.com>
Cc: 19946 <at> debbugs.gnu.org, dan.colascione <at> gmail.com
Subject: bug#19946: 24.4; js-mode, indentation
Date: Sun, 20 Mar 2016 12:02:48 -0700
[Message part 1 (text/plain, inline)]
On 03/20/2016 12:01 PM, Jostein Kjønigsen wrote:
> On Sun, Mar 20, 2016, at 02:27 AM, Dmitry Gutov wrote:
>> On 03/20/2016 12:13 AM, Simen Heggestøyl wrote:
>> I do not mind, but I'm not sure if we actually want to support this 
>> usage. There are a lot regexps in lisp/progmodes that use $. There are 
>> several in js-mode, aside from this one.
>>
>> Some modes try to match [\r\n] (like CC Mode), but in general they seem 
>> to be a minority, and even CC Mode doesn't do that consistently.
> 
> I really don't see how that argument makes sense.
> 
> By following the cardinal rule of good software, that is produce the
> least amont of astonishment, cc-mode does what's right: it produces the
> expected outcome, no matter what kind of file it's working with.
> 
> The result: A happy user.
> 
> In my point of view, this should be the aim for all *-modes found in
> Emacs, no matter what its current state of affair or conventions is.
> 
> The solution to this is either a bunch of hacky patches replacing $ with
> \r\n (as above) or actually addressing what's probably the root cause
> (as observed by Andreas)
> 
>> I wonder why ?\r doesn't have whitespace syntax in the first place.
> 
> Make ?\r be interpreted as white-space, because once you put Emacs
> outside a GNU/Linux system honestly nothing else makes sense. Is there
> any specific reason for its current behaviour?
> 
> Or put the other way: Are there known pieces of code which depends on \r
> semantically not being white-space to function correctly?
> 
> As someone authoring two major modes, every time $ does not work as
> expected and I need to write hacks, it breaks my heart. As of now, I
> can't really use $ if I want my modes to work and that's just silly (but
> at least now I know why).

Line ending divergence is best addressed at the file encoding level, not
the individual mode level. I don't think it's worth while replacing uses
of $ with \r?\n just to address cases in which line ending translation
is broken.


[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 5 years ago.

Previous Next


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