bug#27692: 25.2; Indentation issue with strings in scheme mode

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#27692: 25.2; Indentation issue with strings in scheme mode

Arun Isaac

I have the following text in an otherwise empty scheme mode buffer.

===file-begins-here===
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
(eiusmod tempor) incididunt ut labore et dolore (magna aliqua. Ut enim
ad)"
===file-ends-here===

I apply indent-region on the three lines, and they become:

===file-begins-here===
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
(eiusmod tempor) incididunt ut labore et dolore (magna aliqua. Ut enim
                                                       ad)"
===file-ends-here===

The parentheses in the string are wrongly indented as S-expressions.

However, if I have the following text in an otherwise empty scheme mode
buffer, indentation works correctly.

===file-begins-here===
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
incididunt ut labore et dolore (magna aliqua. Ut enim
ad)"
===file-ends-here===

Note that the only difference between the two text samples is the parentheses
around "eiusmod tempor". Also note that the buffer text is intended to be a
scheme string. So, the double quotes are part of the buffer text.

In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.15)
 of 2017-06-23



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#27692: 25.2; Indentation issue with strings in scheme mode

Alex-2
Arun Isaac <[hidden email]> writes:

> I have the following text in an otherwise empty scheme mode buffer.
>
> ===file-begins-here===
> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
> (eiusmod tempor) incididunt ut labore et dolore (magna aliqua. Ut enim
> ad)"
> ===file-ends-here===
>
> I apply indent-region on the three lines, and they become:
>
> ===file-begins-here===
> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
> (eiusmod tempor) incididunt ut labore et dolore (magna aliqua. Ut enim
>       ad)"
> ===file-ends-here===
>
> The parentheses in the string are wrongly indented as S-expressions.
>
> However, if I have the following text in an otherwise empty scheme mode
> buffer, indentation works correctly.
>
> ===file-begins-here===
> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
> incididunt ut labore et dolore (magna aliqua. Ut enim
> ad)"
> ===file-ends-here===
>
> Note that the only difference between the two text samples is the parentheses
> around "eiusmod tempor". Also note that the buffer text is intended to be a
> scheme string. So, the double quotes are part of the buffer text.
>
> In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.15)
>  of 2017-06-23

I can also reproduce this with Emacs 25.2 in emacs-lisp-mode and
lisp-mode.

However, I can't reproduce this on an up-to-date master branch. Can you
confirm if it works correctly for you on the master branch?



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#27692: 25.2; Indentation issue with strings in scheme mode

Arun Isaac

> I can also reproduce this with Emacs 25.2 in emacs-lisp-mode and
> lisp-mode.
>
> However, I can't reproduce this on an up-to-date master branch. Can you
> confirm if it works correctly for you on the master branch?

Yes, indeed. It is working correctly on the master branch. Thanks! I am
closing this bug report.

Sorry for the somewhat late reply. I had to clone the emacs git repo,
and build it from source -- a process I have not done before.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#27692: 25.2; Indentation issue with strings in scheme mode

npostavs
On Mon, Jul 17, 2017 at 8:17 AM, Arun Isaac <[hidden email]> wrote:
>
> Yes, indeed. It is working correctly on the master branch. Thanks! I am
> closing this bug report.

By the way, the standard workaround for earlier Emacs versions is to
escape open parens in the first column, i.e.,

"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
\(eiusmod tempor) incididunt ut labore et dolore (magna aliqua. Ut enim
ad)"

Alternatively, you can try setting
open-paren-in-column-0-is-defun-start to nil, although it might cause
slower fontifying/indenting/movement in some cases.

> Sorry for the somewhat late reply. I had to clone the emacs git repo,
> and build it from source -- a process I have not done before.

3 days doesn't seem late to me, lot of bugs wait much longer (some for years!)



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#27692: 25.2; Indentation issue with strings in scheme mode

Arun Isaac

> By the way, the standard workaround for earlier Emacs versions is to
> escape open parens in the first column, i.e.,
>
> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
> \(eiusmod tempor) incididunt ut labore et dolore (magna aliqua. Ut enim
> ad)"
>
> Alternatively, you can try setting
> open-paren-in-column-0-is-defun-start to nil, although it might cause
> slower fontifying/indenting/movement in some cases.

I found this bug while working on the Guix project. And, the Guix
project has been working around this problem for a while.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27491

Finally, I reported the bug here to get a proper solution because people
at Guix felt "Emacs could do better here — especially since this is a
lisp mode!"

>> Sorry for the somewhat late reply. I had to clone the emacs git repo,
>> and build it from source -- a process I have not done before.
>
> 3 days doesn't seem late to me, lot of bugs wait much longer (some for years!)

:-)



Loading...