From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 16 10:00:45 2021 Received: (at submit) by debbugs.gnu.org; 16 Jun 2021 14:00:45 +0000 Received: from localhost ([127.0.0.1]:53116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltW61-0004OF-9S for submit@debbugs.gnu.org; Wed, 16 Jun 2021 10:00:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:53388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltW5y-0004O7-Vd for submit@debbugs.gnu.org; Wed, 16 Jun 2021 10:00:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltW5y-0000DA-Le for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 10:00:42 -0400 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:42654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltW5w-0004b0-OP for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 10:00:42 -0400 Received: by mail-qk1-x72c.google.com with SMTP id q16so2633225qkm.9 for ; Wed, 16 Jun 2021 07:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:user-agent:from:to:subject:message-id:date:mime-version; bh=ajttnwmkKP1I/vd/08oWGS3SAdYKBeXCgAf4wA9Wm0M=; b=KzWwJFwt7MY5rNsmE0Noz+B916LCbsDyTosyTTPFK4/ner5NOE00AgNywf8GkmyeL0 z5Pcxqn5nuan0zTkIvD/PAsGw3QGvC07AnGp5RnyjnjnPfbA7n7nhWqCRi7zAK4V20c7 rDq0lJhYuG3T/1haB9NLZK5SeLtILQfRkMpt4Xw93Ok2cI+buNLSEhPFILxjSyzI0Q/1 KtmU1dMgsTPac++qFgRXNmTBrSkiaWzTSlFweRA673tNAgVkJpu/US9WPGn1Mv0IJlq8 8GtDZcWhQ+JSNSod33SsM7Diyx4aq8z5ASNVSHeuG54XDXuM3wY4seksJNiTEzrdseqK Gl/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:user-agent:from:to:subject:message-id :date:mime-version; bh=ajttnwmkKP1I/vd/08oWGS3SAdYKBeXCgAf4wA9Wm0M=; b=gmkyQowdvY1q5vw2XGwNgYEavp72wSY/tXctLT4StK7pP/M1bffOaK7bCZxikHGX4B 0AGcgti9c072HAR3PXsW87weGGDTbAT3xPHWjTDWyCTBaHC5bd2ABKJ9uF3sswNODLOD uInTLBS20P/GwbZtSpQrWPtnc4ZoTla3mDDS5zMkXpqENA1v6nGriW4/Mb+Ou1csPUam Opt7SHfpPtq6K8AqUr+WcupBKM2SZ9LMJarCjOhzOxTPNU0b/PJCQ5BUYyxz0ihFwUmb aWOxSfinGV+XJfiKy1/3xjUIRbkCI7APhbJJ5qoQas7IkxgXzQl5FDfTbO3vsP8GuVxx UaUg== X-Gm-Message-State: AOAM532qvZqUC3al/JyYpuUEH3Y2ncu9Op0FLqLRnszcZlgyezPzdYrl /6HbL5HtYDTfHhxyJG2YQvhiTb+P7+A= X-Google-Smtp-Source: ABdhPJyN3UsoAYEi7XkYwRVcZ+cGVWuXi/ETgEJICnwIDJ7Q+Eh1/+DpEIzShKeRwTjV4Q2C+8ipLA== X-Received: by 2002:a05:620a:4151:: with SMTP id k17mr199133qko.30.1623852037274; Wed, 16 Jun 2021 07:00:37 -0700 (PDT) Received: from gusbrs-laptop ([102.129.152.65]) by smtp.gmail.com with ESMTPSA id 144sm1570268qkk.103.2021.06.16.07.00.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 07:00:36 -0700 (PDT) User-agent: mu4e 1.4.15; emacs 27.2 From: Gustavo Barros To: bug-gnu-emacs@gnu.org Subject: electric-quote-mode in bibtex-mode Message-ID: <87mtrprjsw.fsf@gmail.com> Date: Wed, 16 Jun 2021 11:00:32 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=gusbrs.2016@gmail.com; helo=mail-qk1-x72c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi All, I'm trying to get `electric-quote-mode' to work in `bibtex-mode', but I'm having some trouble with it. The problem stems from the fact that `electric-quote-mode' makes a basic distinction between `text-mode' and "all other modes" (it seems implicitly to address `prog-mode' in this case). However, `bibtex-mode' does not set a "parent mode" when it is defined. So, `electric-quote-mode' will provide functionality similar to that of `prog-mode' for `bibtex-mode'. In doing so it checks for comments or strings with `(nth 8 (syntax-ppss))' (this is done in `electric-quote-post-self-insert-function'), however a regular bibtex field will (or may) fail to have either comment or string syntax. It actually depends on `bibtex-field-delimiters', if it is `double-quotes' a field will be within string syntax, but the normal case, and the default one is `braces', in which case the string syntax check fails. It does work for comments, of course, but not for a regular field though. In practical terms, the effect of this is that we don't get curved quotes in a regular bibtex field if it is enclosed by braces, which is where we might need those quotes in this case. I'm not sure what the best solution to this would be. Changing the syntax of `{}' in `bibtex-mode' does not seem like a good idea. However, just assuming `bibtex-mode' should work "as `text-mode'" from `electric-quote-mode's side may also be problematic (assume, for example, that a user sets `bibtex-field-delimiters' to `double-quotes'). Still, this is something that is not working particularly well, and I thought it worth reporting. Best regards, Gustavo. PS: The state of things this report refers to is that of "GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2021-03-25".