From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: master 223e7b8: Make CC Mode and electric-pair-mode work together. This fixes bug #33794 Date: Thu, 17 Jan 2019 15:47:34 +0000 Message-ID: References: <20190115160812.12319.90321@vcs0.savannah.gnu.org> <20190115160813.EFFD4209E3@vcs0.savannah.gnu.org> <87ef9dijn1.fsf@gmx.de> <20190116180506.GA2988@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1547740065 24844 195.159.176.226 (17 Jan 2019 15:47:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2019 15:47:45 +0000 (UTC) Cc: Michael Albinus , emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 17 16:47:41 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gk9tN-0006Ld-9J for ged-emacs-devel@m.gmane.org; Thu, 17 Jan 2019 16:47:41 +0100 Original-Received: from localhost ([127.0.0.1]:46911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk9vU-0005BC-A8 for ged-emacs-devel@m.gmane.org; Thu, 17 Jan 2019 10:49:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk9tU-0004i5-6Z for emacs-devel@gnu.org; Thu, 17 Jan 2019 10:47:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gk9tT-0000ky-1L for emacs-devel@gnu.org; Thu, 17 Jan 2019 10:47:48 -0500 Original-Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:38551) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gk9tS-0000jf-RE for emacs-devel@gnu.org; Thu, 17 Jan 2019 10:47:46 -0500 Original-Received: by mail-qt1-x82e.google.com with SMTP id p17so11793892qtl.5 for ; Thu, 17 Jan 2019 07:47:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=W9OWti69Cb5mRF1CLJKMllxcvRf7pU05jMTXgUQLM90=; b=IbweZ7PoWMWYFW66R3yjZ2kehcg9PuJc15mgv8vdyCZlv5edgjPAHXk5gsdapLDVf9 rWK+k4ZyHQ+OJVSoM4PjsIH2C2O/byxTzQKSB0cPNUeP1w8mEJR3JM8x5iGGgfn2iOd2 v2c53otcmgmu70/v5UvaiAiBIFlUoppOil16wVr37BK32MNTvd3RAB3DLakhDVPismib qJJ93QSFvsq02b8L9QwM5D1TYJFIjHSBJRX3aJhmYcY7OVJnmCHgX4mljB+7WHcYHiMW AGZc/rJpkHQUfH/xCepcKaC92FOzkRVJZUEIHqScHB6/RDzVG2LPyiRmXd9sUsmS/xC9 utug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=W9OWti69Cb5mRF1CLJKMllxcvRf7pU05jMTXgUQLM90=; b=b5yWM8wrS0xZc5CQNC3oCf3RVfTVX/ovk0/lwHcdYOr8oyqu7sWiHi2hk4jK/2Ut9T Py5KogK4+K21Z8v7f6YEgoTt1va4QFK0uwmGG7AESgpRFal7uMqqtQbvoYg5aTlWqCkn jPb25zRhpO2L30AJX3KeU4EO1TMj++2U9lXHuJpgiNoIwOR4vLgo7luOu40pMuBzBxkp 5mZJWDoGgUDVU0pExSaMlAvBavFn2+aigcc1IwUp40vkIET59ZOpc5Gt4WpYhYQ87Gjc HId8Z4gFVliZNW28JFb+x5XN0X4u9rM+O3KWf8qWdFXKBbDzqtslyirXSX9uop+T8DBa KTaA== X-Gm-Message-State: AJcUukffNK3EZWqeOWf39Y0ESZ4+Chsa8Ou5u9jrRoLrVhii0uubgrFC UgZ8upCS/bRm7ID4U6ernxlv/0Q106NIEcF5bgMmSrMKNoc= X-Google-Smtp-Source: ALg8bN7YLp1eLEKNZv+swunBMbUGtCTVFY9ufqb9HvucjFbleayuL5mnAMfxpfxzNdRWUZ0Gi+DPc6uPYazhhVfsfOo= X-Received: by 2002:a0c:9deb:: with SMTP id p43mr11856403qvf.107.1547740065994; Thu, 17 Jan 2019 07:47:45 -0800 (PST) In-Reply-To: <20190116180506.GA2988@ACM> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232427 Archived-At: Hi Alan, On Wed, Jan 16, 2019 at 6:18 PM Alan Mackenzie wrote: > Thanks! Part of the problem is in CC Mode, still. Another part of the > problem is electric-tests.el making assumptions about CC Mode's > implementation (which has recently changed). Can you be specific as to what "assumptions about CC Mode's implementation" it is making? As I read it, the assumptions are this: - Create a buffer, assumes the buffer is created - Enable a specific major mode, assumes major mode is enabled. (does not M-x c++-mode RET enable c++-mode?) - Insert as string, assumes the string is inserted - Enable electric-pair-mode, assumes it succeeds - Simulate typing a key such as {, or ', or } This is done by by (call-interactively (key-binding `[,last-command-event])) Tests then verify if electric-pair-mode did what it was supposed to do. This is not an assumption, it is a verification. "what is was supposed to do" is given by M-x ert-describe-test, which basiclly restates the above assumptions in a more readable format. > Incidentally, there's a test engine in electric-tests.el which is 100% > undocumented (no doc string, no comments in functions like > electric-pair-test-for and electric-pair-define-test-form). It would be > appreciated if anybody reading this who understands any of these > functions could add doc strings to them. We've already been through this 6+ months ago. At the time I told you about M-x ert-describe-test and I even improved it at your request! M-x ert-describe-test RET RET Here's an example: electric-pair-js-mode-braces-at-point-1-in-js-mode is a test defined in `electric-tests.elc'. Electricity test in a `js-mode' buffer. Start with point at 1 in a 0-char-long buffer like this one: || (buffer start and end are denoted by `|') Now call this: #'(lambda nil (electric-pair-mode 1)) Now press the key for: { The buffer's contents should become: |{}| , and point should be at 2. Jo=C3=A3o