unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
@ 2015-08-05  8:29 Dima Kogan
  2015-08-05  9:40 ` Artur Malabarba
  0 siblings, 1 reply; 8+ messages in thread
From: Dima Kogan @ 2015-08-05  8:29 UTC (permalink / raw)
  To: 21192

Hi. The following is an erroneous behavior in a new build of emacs
(built from https://github.com/emacs-mirror/emacs/commit/bd3b426).

1. emacs -Q

2. Enter the following so the buffer looks like
--------------------
123
  abc
--------------------

3. M-%, ' ' -> '' (i.e. delete all spaces)

4. What should happen is that the ' ' before 'abc' should be removed.
Instead, the newline is removed also, so that I get a single line
'123abc'





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

* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
  2015-08-05  8:29 bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines Dima Kogan
@ 2015-08-05  9:40 ` Artur Malabarba
  2015-08-05 10:10   ` Dima Kogan
  0 siblings, 1 reply; 8+ messages in thread
From: Artur Malabarba @ 2015-08-05  9:40 UTC (permalink / raw)
  To: Dima Kogan; +Cc: 21192

Is your replace-regexp-lax-whitespace variable non-nil, by any chance?

2015-08-05 9:29 GMT+01:00 Dima Kogan <dima@secretsauce.net>:
> Hi. The following is an erroneous behavior in a new build of emacs
> (built from https://github.com/emacs-mirror/emacs/commit/bd3b426).
>
> 1. emacs -Q
>
> 2. Enter the following so the buffer looks like
> --------------------
> 123
>   abc
> --------------------
>
> 3. M-%, ' ' -> '' (i.e. delete all spaces)
>
> 4. What should happen is that the ' ' before 'abc' should be removed.
> Instead, the newline is removed also, so that I get a single line
> '123abc'
>
>
>





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

* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
  2015-08-05  9:40 ` Artur Malabarba
@ 2015-08-05 10:10   ` Dima Kogan
  2015-08-05 15:15     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Dima Kogan @ 2015-08-05 10:10 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21192

Artur Malabarba <bruce.connor.am@gmail.com> writes:

> Is your replace-regexp-lax-whitespace variable non-nil, by any chance?

It is nil. This issue is reproducible from 'emacs -Q'





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

* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
  2015-08-05 10:10   ` Dima Kogan
@ 2015-08-05 15:15     ` Eli Zaretskii
  2015-08-05 17:49       ` Artur Malabarba
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-08-05 15:15 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21192, Dima Kogan

> From: Dima Kogan <dima@secretsauce.net>
> Date: Wed, 05 Aug 2015 03:10:27 -0700
> Cc: 21192@debbugs.gnu.org
> 
> Artur Malabarba <bruce.connor.am@gmail.com> writes:
> 
> > Is your replace-regexp-lax-whitespace variable non-nil, by any chance?
> 
> It is nil. This issue is reproducible from 'emacs -Q'

Artur, this happens because we are "folding" newline with whitespace:

      ;; Add some manual entries.
      (dolist (it '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»")
                    (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "󠀢" "❮" "❯" "‹" "›")
                    (?` "❛" "‘" "‛" "󠀢" "❮" "‹")
                    (?\s "\t" "\r" "\n")))  <<<<<<<<<<<<<<<<<<<<<<<<<

I think we should remove this, since replace-regexp-lax-whitespace
already provides the same feature, and it's confusing to have that
variable set to nil and still see such "lax" matches.

Regardless, I think replace commands should start with character
folding off, as I don't think most users will want that by default,
especially since we don't perform the reverse transformation when
replacing, and so, say, ² is replaced with 3, not with ³.





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

* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
  2015-08-05 15:15     ` Eli Zaretskii
@ 2015-08-05 17:49       ` Artur Malabarba
  2015-08-05 18:17         ` Artur Malabarba
  0 siblings, 1 reply; 8+ messages in thread
From: Artur Malabarba @ 2015-08-05 17:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21192, Dima Kogan

2015-08-05 16:15 GMT+01:00 Eli Zaretskii <eliz@gnu.org>:
>> From: Dima Kogan <dima@secretsauce.net>
>> Date: Wed, 05 Aug 2015 03:10:27 -0700
>> Cc: 21192@debbugs.gnu.org
>>
>> Artur Malabarba <bruce.connor.am@gmail.com> writes:
>>
>> > Is your replace-regexp-lax-whitespace variable non-nil, by any chance?
>>
>> It is nil. This issue is from 'emacs -Q'

Yes, of course, you said that. :-) Sorry

>                     (?\s "\t" "\r" "\n")))  <<<<<<<<<<<<<<<<<<<<<<<<<
>
> I think we should remove this, since replace-regexp-lax-whitespace
> already provides the same feature, and it's confusing to have that
> variable set to nil and still see such "lax" matches.

Yes. That line is from when `character-fold-to-regexp' didn't do lax
matching. Now it's definitely unnecessary.

> Regardless, I think replace commands should start with character
> folding off, as I don't think most users will want that by default,
> especially since we don't perform the reverse transformation when
> replacing, and so, say, ² is replaced with 3, not with ³.

Sure, I can move it to a variable.





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

* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
  2015-08-05 17:49       ` Artur Malabarba
@ 2015-08-05 18:17         ` Artur Malabarba
  2015-08-05 20:46           ` Dima Kogan
  0 siblings, 1 reply; 8+ messages in thread
From: Artur Malabarba @ 2015-08-05 18:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21192, Dima Kogan

>> Regardless, I think replace commands should start with character
>> folding off, as I don't think most users will want that by default,
>> especially since we don't perform the reverse transformation when
>> replacing, and so, say, ² is replaced with 3, not with ³.
>
> Sure, I can move it to a variable.

It was already a variable, so I've defaulted it to nil now.

Dima, could you check if this solves your problem?





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

* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
  2015-08-05 18:17         ` Artur Malabarba
@ 2015-08-05 20:46           ` Dima Kogan
  2015-08-06  9:15             ` Artur Malabarba
  0 siblings, 1 reply; 8+ messages in thread
From: Dima Kogan @ 2015-08-05 20:46 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: 21192

Artur Malabarba <bruce.connor.am@gmail.com> writes:

> Dima, could you check if this solves your problem?

Hi. Yes. Setting replace-character-fold to nil makes this bug go away.
Thanks.





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

* bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines
  2015-08-05 20:46           ` Dima Kogan
@ 2015-08-06  9:15             ` Artur Malabarba
  0 siblings, 0 replies; 8+ messages in thread
From: Artur Malabarba @ 2015-08-06  9:15 UTC (permalink / raw)
  Cc: 21192-done

[-- Attachment #1: Type: text/plain, Size: 21 bytes --]

Great, closing then.

[-- Attachment #2: Type: text/html, Size: 39 bytes --]

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

end of thread, other threads:[~2015-08-06  9:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-05  8:29 bug#21192: 25.0.50; search-replace of spaces erroneously touches newlines Dima Kogan
2015-08-05  9:40 ` Artur Malabarba
2015-08-05 10:10   ` Dima Kogan
2015-08-05 15:15     ` Eli Zaretskii
2015-08-05 17:49       ` Artur Malabarba
2015-08-05 18:17         ` Artur Malabarba
2015-08-05 20:46           ` Dima Kogan
2015-08-06  9:15             ` Artur Malabarba

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).