[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#4136: 23.1; delete-pair
From: |
Lars Ingebrigtsen |
Subject: |
bug#4136: 23.1; delete-pair |
Date: |
Fri, 18 Sep 2020 12:59:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Juri Linkov <juri@jurta.org> writes:
> I see that you reverted it now because it breaks on "foo" in text-mode.
> But the previous version is worse: it deletes wrong text on "foo"
> in text-mode.
Heh, I was misreading the tests -- I thought that the first one of these
was the one that failed, and not the second, kinda weird one:
(ert-deftest lisp-delete-pair-quotation-marks ()
"Test \\[delete-pair] with quotation marks."
(with-temp-buffer
(insert "\"foo\"")
(goto-char (point-min))
(delete-pair)
(should (string-equal "foo" (buffer-string)))))
(ert-deftest lisp-delete-pair-quotes-in-text-mode ()
"Test \\[delete-pair] against string in Text Mode for #15014."
(with-temp-buffer
(text-mode)
(insert "\"foo\"")
(goto-char (point-min))
(delete-pair)
(should (string-equal "fo\"" (buffer-string)))))
So in text mode, delete-pair just deletes two characters, and that
doesn't seem helpful. The patch I reverted made it bug out instead,
which seems better.
However, bug#15014 says:
> I'm not arguing here that we font lock double quoted strings (though
> I'm not convinced either). Without font locking, I can't think of a
> concrete case that yields the "pretty annoying behavior". What do you
> have in mind?
>
> I added
>
> (modify-syntax-entry ?\" "$")
>
> to my configuration and find that forward-sexp and delete-pair seem to
> work without confusion, even in the presence of odd double quotes. It
> seems forward-sexp just scans forward from point.
And the patch wouldn't allow this, either, so I'm not sure this
behavioural change would be welcome -- the user would have to alter
insert-pair-alist in text mode, too.
So...
I think the current thing delete-pair does in text-mode is bad, so I'm
inclined to re-apply the patch, and announce this as an incompatible
change in NEWS (and explain how to get the behaviour described above
back).
Any opinions?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#4136: 23.1; delete-pair, Lars Ingebrigtsen, 2020/09/14
- bug#4136: 23.1; delete-pair, Juri Linkov, 2020/09/14
- bug#4136: 23.1; delete-pair, Lars Ingebrigtsen, 2020/09/15
- bug#4136: 23.1; delete-pair, Juri Linkov, 2020/09/15
- bug#4136: 23.1; delete-pair, Lars Ingebrigtsen, 2020/09/17
- bug#4136: 23.1; delete-pair, Juri Linkov, 2020/09/18
- bug#4136: 23.1; delete-pair,
Lars Ingebrigtsen <=
- bug#4136: 23.1; delete-pair, Juri Linkov, 2020/09/21
- bug#4136: 23.1; delete-pair, Lars Ingebrigtsen, 2020/09/22
- bug#4136: 23.1; delete-pair, Juri Linkov, 2020/09/22
- bug#4136: 23.1; delete-pair, Lars Ingebrigtsen, 2020/09/23