From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#33840: electric-pair-mode breaks self-insert-command Date: Wed, 10 Jul 2019 13:08:24 -0400 Message-ID: <85sgrdddh3.fsf@gmail.com> References: <20181223023841.GA4289@ACM> <87r26yq1dn.fsf@mouse.gnus.org> <20190710093956.GA4109@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="147296"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: Alan Mackenzie , 33840@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 10 19:09:42 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlG69-000cDK-CR for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jul 2019 19:09:41 +0200 Original-Received: from localhost ([::1]:35516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlG67-0006Jl-RU for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jul 2019 13:09:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43988) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlG5Z-0006IJ-1p for bug-gnu-emacs@gnu.org; Wed, 10 Jul 2019 13:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlG5X-0006Fv-NR for bug-gnu-emacs@gnu.org; Wed, 10 Jul 2019 13:09:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55922) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlG5X-0006Dt-3j for bug-gnu-emacs@gnu.org; Wed, 10 Jul 2019 13:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hlG5V-00015I-Rz for bug-gnu-emacs@gnu.org; Wed, 10 Jul 2019 13:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jul 2019 17:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33840 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 33840-submit@debbugs.gnu.org id=B33840.15627785134132 (code B ref 33840); Wed, 10 Jul 2019 17:09:01 +0000 Original-Received: (at 33840) by debbugs.gnu.org; 10 Jul 2019 17:08:33 +0000 Original-Received: from localhost ([127.0.0.1]:36510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG53-00014Z-JK for submit@debbugs.gnu.org; Wed, 10 Jul 2019 13:08:33 -0400 Original-Received: from mail-io1-f52.google.com ([209.85.166.52]:39688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG50-00014I-Go for 33840@debbugs.gnu.org; Wed, 10 Jul 2019 13:08:32 -0400 Original-Received: by mail-io1-f52.google.com with SMTP id f4so6331843ioh.6 for <33840@debbugs.gnu.org>; Wed, 10 Jul 2019 10:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=lxAvTSp1lbPg3MHcvQfmpMKYPxs20s64RQYzJ/pbVoA=; b=KFU2uwuUsCwJIpM7xKDScwl1XJhLy9Vm5PcY/VISAXewOOR+Iu5txrOtMBDH3BTTp3 Qyj5geTLJfbKVfQEq2hPFTfOSO94E+70YXqk4HLyEI5qhlb1VVtlshgc/vWOj/FPEhgQ SIk2Hfre9GIzGAZpk+tvXanrSXHQw97FM+sF4CT89O5JzLD2gisDmYERDcX9nqT49Lsa i4oRPbQxO1s1OAL2XUi9nNoPbiF6/TEiHwmlYiov+cp6zZzKeYDpOjOoL7f4wItGs8cG iqPA8KSuQJdNzkGqKIOFUcRJujDCwHErIl63QLb8JOufoHszEpQaaSzxTAUe4oMJqGnL D6vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=lxAvTSp1lbPg3MHcvQfmpMKYPxs20s64RQYzJ/pbVoA=; b=WChd9v1CnscD3ZO+Z7cgrV6c+uNwAn6BnO0wIuliTFWDiRvoOaIpkU4qWo7tbysc5t vfcta2COqYhMinbe8/t2Zkl44y3LZKSh0v2BN+cs1KAPg8ATvZjPgfFga7QEBoNduyOj sXkYgIa6wxObmnl7u3LwW1Wq7CYoTocS/KCFAKg1lw1bgZ4UThzuRVOmkPwLtnID6aRa DV27pcKU7elJruuWqB4K2+ZE5zurZu3nlVuyY4zL4X2BLFU1p0VJn+cLeW8FLS9PmFXZ gC889mfnD6F4Z0A6IO+VmD9Elz+G5aIyfMtdmPeFbqYUbU57UKlLsIhjB11t6zuWrw48 nB/A== X-Gm-Message-State: APjAAAVr9yTID6aO3/7Y/PJuQhKhWeTgWflh5I1dWCubNwjCDFq9QAUF Irhn8aZroj4v78wzUHJ+eNw4Dg5Q X-Google-Smtp-Source: APXvYqw1QC5Mi5ycWVbsIdpUfBxiP7coly5hORkjpyYYzxZg5jBLc8IXXFJoPYJHgCu/20lhRh38yg== X-Received: by 2002:a5d:9d42:: with SMTP id k2mr14363632iok.45.1562778504699; Wed, 10 Jul 2019 10:08:24 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id l2sm1891836ioh.20.2019.07.10.10.08.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2019 10:08:24 -0700 (PDT) In-Reply-To: (Lars Ingebrigtsen's message of "Wed, 10 Jul 2019 13:34:26 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162652 Archived-At: Lars Ingebrigtsen writes: > Alan Mackenzie writes: > >> self-insert-command is a primitive, and it shouldn't be modified to do >> other things. Instead these other things should be done alongside the >> primitive, or after it. >> >> Similarly, you would not modify + such that (+ 2 3) => 6, even if you had >> a use case where you wanted this strange arithmetic. > > I agree that modifying primitives is really confusing and should be > avoided, but I don't think self-insert-command is ... very primitive. > :-) I mean, look at the doc string: [...] > There's a lot of stuff going on there! It sounds more like a "don't use > this function from code unless you want unpredictable things to happen" > thing to me... > >> Being realistic, I now don't really expect this bug to be fixed. It >> would cost too much. FWIW, I don't think using a documented hook should be considered "modifying" the primitive which calls it (unlike say, using advice). But electric-pair-mode's current implementation seems to involve a complicated dance of inserting and deleting and inserting characters again, so I think there is some room for improvement. Perhaps by using something other than post-self-insert-hook.