GNU bug report logs - #4136
23.1; delete-pair

Previous Next

Package: emacs;

Reported by: Eli Barzilay <eli <at> barzilay.org>

Date: Thu, 13 Aug 2009 06:30:04 UTC

Severity: normal

Tags: fixed, moreinfo

Fixed in version 28.1

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: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Barzilay <eli <at> barzilay.org>, 4136 <at> debbugs.gnu.org
Subject: bug#4136: 23.1; delete-pair
Date: Fri, 18 Sep 2020 12:59:09 +0200
Juri Linkov <juri <at> 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




This bug report was last modified 4 years and 181 days ago.

Previous Next


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