From unknown Mon Jun 16 23:54:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#53446 <53446@debbugs.gnu.org> To: bug#53446 <53446@debbugs.gnu.org> Subject: Status: 29.0.50; Issues with awk-mode and electric-pair-mode Reply-To: bug#53446 <53446@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:54:22 +0000 retitle 53446 29.0.50; Issues with awk-mode and electric-pair-mode reassign 53446 emacs submitter 53446 Philip Kaludercic severity 53446 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 22 08:23:16 2022 Received: (at submit) by debbugs.gnu.org; 22 Jan 2022 13:23:16 +0000 Received: from localhost ([127.0.0.1]:36018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBGMN-00026y-UA for submit@debbugs.gnu.org; Sat, 22 Jan 2022 08:23:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:51162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBGMM-00026r-Jz for submit@debbugs.gnu.org; Sat, 22 Jan 2022 08:23:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBGMM-0001yM-6Y for bug-gnu-emacs@gnu.org; Sat, 22 Jan 2022 08:23:14 -0500 Received: from mout01.posteo.de ([185.67.36.65]:51715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBGMD-0006Ex-8D for bug-gnu-emacs@gnu.org; Sat, 22 Jan 2022 08:23:08 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id DE861240026 for ; Sat, 22 Jan 2022 14:23:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1642857781; bh=fadv8KUS9OLYcKLFUgTwjfQq/W69bnAJJHRsllthlzA=; h=From:To:Subject:Autocrypt:Date:From; b=VQ0Ee1Mb4ZuOr2TXEUjAWGIy4+mj4d2A2WpkdLmkMnXKozXO4USTj3RZjg7uqxG8H W/Z2KBImILJwZ0m44p9HKP8SvYkwPJ2ZfuBjCmdULcOVI1lE5dfaiCAIKMqQGM964P pk7S9VlxG5hoEsZW6WGUm1h4BfOKHWxloAic5IzdcAr3s8E+v4NVm1PrLwZmD0gVzl Rvc6coxeoLTeZxhG8NZk0eFqOOuiyhizQKLraRG+RdyJ4sGdLMIhTqCcPJPkx8R+SL DA44UXHP+G3twOY++KAmeOnJuPL+w/nnEmFLLVRCKYtktJ8eHc8Cfwa8rOgecEaHB3 0IbskZYcvxY/A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Jgxks22Bkz6tmj for ; Sat, 22 Jan 2022 14:23:01 +0100 (CET) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Issues with awk-mode and electric-pair-mode Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sat, 22 Jan 2022 13:22:57 +0000 Message-ID: <875yqbdhvy.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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.3 (--) Open an AWK file, and ensure that electric-pair-mode is enabled. It seems that some character pairs like braces or parentheses are automatically paired, while others like apostrophes or double quotes are not. In GNU Emacs 29.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2022-01-21 built on viero Repository revision: adf00298b60e87f76c64b1ba68c0424df55982e1 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 Configured using: 'configure CC=gcc PKG_CONFIG_PATH=/home/philip/.guix-profile/lib/pkgconfig:/home/philip/.guix-profile/share/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: TeX-PDF-mode: t global-git-commit-mode: t magit-auto-revert-mode: t auto-revert-mode: t shell-dirtrack-mode: t bug-reference-prog-mode: t outline-minor-mode: t flymake-mode: t flyspell-mode: t recentf-mode: t repeat-mode: t display-battery-mode: t display-time-mode: t diff-hl-flydiff-mode: t diff-hl-mode: t winner-mode: t windmove-mode: t corfu-global-mode: t corfu-mode: t vertico-mouse-mode: t vertico-multiform-mode: t vertico-mode: t electric-pair-mode: t save-place-mode: t savehist-mode: t xterm-mouse-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-save-visited-mode: t Load-path shadows: /home/philip/Source/sp-tutor/sp-tutor hides /home/philip/.config/emacs/site-lisp/sp-tutor/sp-tutor /home/philip/Source/sp-tutor/waffel hides /home/philip/.config/emacs/site-lisp/sp-tutor/waffel /home/philip/.config/emacs/elpa/transient-0.3.7/transient hides /home/philip/Source/emacs/lisp/transient ~/.config/emacs/site-lisp/autoload hides /home/philip/Source/emacs/lisp/emacs-lisp/autoload Features: (shadow autocrypt-message emacsbug cc-awk preview tex-buf tex-fold reftex-dcr reftex-auc reftex reftex-loaddefs reftex-vars font-latex latex latex-flymake tex-ispell tex-style tex texmathp tex-mode latexenc doc-view image-mode exif reveal qp gnus-draft nndraft nnmh utf-7 nnfolder epa-file macrostep cl avy orderless tar-mode arc-mode archive-mode markdown-mode eglot array jsonrpc ert debug make-mode descr-text cl-print edebug backtrace jka-compr info-look sort smiley gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg debbugs-gnu debbugs soap-client rng-xsd rng-dt rng-util xsd-regexp gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-ml gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig autocrypt-gnus autocrypt nndoc gnus-cache gnus-sum shr pixel-fill kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win vc-annotate shortdoc python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat parse-time iso8601 ls-lisp whitespace conf-mode reposition char-fold misearch multi-isearch tabify man magit-extras magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode git-commit log-edit add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor server magit-mode transient edmacro magit-git magit-section benchmark magit-utils dash flymake-cc yasnippet-snippets yasnippet cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align shell pcomplete shell-command+ cc-engine cc-vars cc-defs dired-aux gnus-dired vc-mtn vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs mm-archive message yank-media rfc822 mml mml-sec epa mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mule-util gnutls network-stream url-http url-gw nsm rmc puny url-cache url-auth epg rfc6068 epg-config finder-inf vertico-buffer consult-vertico consult kmacro bookmark display-fill-column-indicator pulse color bug-reference help-fns find-func xref copyright time-stamp vc-backup derived log-view pcvs-util crm cus-edit pp cus-start vertico-directory vertico-flat modus-vivendi-theme cl-extra noutline outline checkdoc help-mode flymake-proc flymake project warnings thingatpt flyspell ispell auth-source-pass recentf tree-widget repeat pcase format-spec battery dbus xml dired-x dired dired-loaddefs time sendmail gnus nnheader gnus-util time-date mail-utils range wid-edit help-at-pt diff-hl-flydiff diff diff-hl face-remap vc-hg vc-git vc-dir ewoc vc vc-dispatcher diff-mode easy-mmode hippie-exp winner windmove rx corfu vertico-mouse vertico-multiform vertico elec-pair saveplace savehist xt-mouse modus-operandi-theme modus-themes rot13 disp-table cus-load setup compile text-property-search comint ansi-color ring autoload radix-tree lisp-mnt mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr tex-site slime-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1215107 222846) (symbols 48 60655 247) (strings 32 256698 21930) (string-bytes 1 7066956) (vectors 16 111765) (vector-slots 8 2719715 156221) (floats 8 760 822) (intervals 56 57632 13530) (buffers 992 49)) -- Philip Kaludercic From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 23 03:24:54 2022 Received: (at 53446) by debbugs.gnu.org; 23 Sep 2022 07:24:54 +0000 Received: from localhost ([127.0.0.1]:39255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obd3O-0002f1-Hr for submit@debbugs.gnu.org; Fri, 23 Sep 2022 03:24:54 -0400 Received: from mout02.posteo.de ([185.67.36.66]:47997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obd3J-0002ek-2B for 53446@debbugs.gnu.org; Fri, 23 Sep 2022 03:24:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 494AC240101 for <53446@debbugs.gnu.org>; Fri, 23 Sep 2022 09:24:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663917883; bh=VeWXEmO4TK4swLXiNKjaIuPG3tNmKxd3YX7wWZiKcBI=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=aDA8jz41a8wIOGKZr4+YEGlsrWNJyZNNU8oLNcE7UyVySJJbULoFrVj+wxPE7/j7r VTyof+dwpl5La5ZMdC3HlxfJlPUTthSjHpiMcfaX0FSh1vQZpcVzT6s1G4eG9EZSJF 2YwvJ1jpbYQH/fMUZH0rKUDBp34dIoSFNYtoiIXuCQar/UCcHjW27g/fBEyqn2Umap 1Bm6WOJZ33X+8JccQOnFV0xUI+7/LvQ9bzZFiEpuM9bHyzoyyosWSOF/5uKl6hsFON 51ni/R6B9wG4lw6Vmg+ylyimY964/QyIpYeX5tvLWRfIzn+d0BjGabywL/lQv0m9n5 +ckAZ308XLvyQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MYkDl4mp1z9rxM; Fri, 23 Sep 2022 09:24:39 +0200 (CEST) From: Philip Kaludercic To: 53446@debbugs.gnu.org Subject: Re: bug#53446: 29.0.50; Issues with awk-mode and electric-pair-mode In-Reply-To: <875yqbdhvy.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 22 Jan 2022 13:22:57 +0000") References: <875yqbdhvy.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Fri, 23 Sep 2022 07:24:34 +0000 Message-ID: <87czbmv9hp.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53446 Cc: Alan Mackenzie 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: -3.3 (---) Philip Kaludercic writes: > Open an AWK file, and ensure that electric-pair-mode is enabled. It > seems that some character pairs like braces or parentheses are > automatically paired, while others like apostrophes or double quotes are > not. I have managed to narrow this bug to the function `c-electric-pair-inhibit-predicate' that is used as `electric-pair-inhibit-predicate' by cc-mode. Specifically this check (not (equal (c-get-char-property last-quote 'c-fl-syn-tab) '(15))) fails, because the macro (c-get-char-property last-quote 'c-fl-syn-tab) that expands to (get-text-property last-quote 'c-fl-syn-tab) where `last-quote' is the position of the last quotation mark in a "logical line", evaluates to nil, not (15). I do not understand why this happens, or what the text property `c-fl-syn-tab' is supposed to indicate. I have CC'ed Alan to see if he can help. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 23 14:38:08 2022 Received: (at 53446) by debbugs.gnu.org; 23 Sep 2022 18:38:08 +0000 Received: from localhost ([127.0.0.1]:41769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obnYt-00028c-Uv for submit@debbugs.gnu.org; Fri, 23 Sep 2022 14:38:08 -0400 Received: from mx3.muc.de ([193.149.48.5]:58029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obnYr-000286-1c for 53446@debbugs.gnu.org; Fri, 23 Sep 2022 14:38:06 -0400 Received: (qmail 44748 invoked by uid 3782); 23 Sep 2022 20:37:58 +0200 Received: from acm.muc.de (p4fe15e96.dip0.t-ipconnect.de [79.225.94.150]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 23 Sep 2022 20:37:58 +0200 Received: (qmail 20966 invoked by uid 1000); 23 Sep 2022 18:37:57 -0000 Date: Fri, 23 Sep 2022 18:37:57 +0000 To: Philip Kaludercic Subject: Re: bug#53446: 29.0.50; Issues with awk-mode and electric-pair-mode Message-ID: References: <875yqbdhvy.fsf@posteo.net> <87czbmv9hp.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87czbmv9hp.fsf@posteo.net> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53446 Cc: 53446@debbugs.gnu.org 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: -1.0 (-) Hello, Philip. Sorry I missed this bug in January. On Fri, Sep 23, 2022 at 07:24:34 +0000, Philip Kaludercic wrote: > Philip Kaludercic writes: > > Open an AWK file, and ensure that electric-pair-mode is enabled. It > > seems that some character pairs like braces or parentheses are > > automatically paired, while others like apostrophes or double quotes are > > not. The reason apostrophes don't work with electric-pair-mode is that they are not quote characters in AWK. :-) > I have managed to narrow this bug to the function > `c-electric-pair-inhibit-predicate' that is used as > `electric-pair-inhibit-predicate' by cc-mode. Specifically this check > (not (equal (c-get-char-property last-quote 'c-fl-syn-tab) '(15))) > fails, because the macro > (c-get-char-property last-quote 'c-fl-syn-tab) > that expands to > (get-text-property last-quote 'c-fl-syn-tab) > where `last-quote' is the position of the last quotation mark in a > "logical line", evaluates to nil, not (15). I do not understand why > this happens, or what the text property `c-fl-syn-tab' is supposed to > indicate. It happens because AWK Mode doesn't use the unterminated string detection code the other CC Mode modes use. (It doesn't need to, being simpler.) So, rather than temporarily storing its "working" syntax-table text properties, AWK just lets them be. So, we can just test the syntax-table text property for being '(15) (string fence) in AWK Mode. > I have CC'ed Alan to see if he can help. Would you please try out the following patch, and let me know how it goes. Thanks! diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 9309a546db..679690b33c 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -2714,7 +2714,10 @@ c-electric-pair-inhibit-predicate (save-excursion (goto-char (c-point 'eoll)) (search-backward "\""))))) - (not (equal (c-get-char-property last-quote 'c-fl-syn-tab) '(15)))) + (not (equal + (or (c-get-char-property last-quote 'c-fl-syn-tab) + (c-get-char-property last-quote 'syntax-table)) ; for AWK + '(15)))) (funcall (default-value 'electric-pair-inhibit-predicate) char))) -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 23 14:57:46 2022 Received: (at 53446) by debbugs.gnu.org; 23 Sep 2022 18:57:46 +0000 Received: from localhost ([127.0.0.1]:41782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obnrt-0002cd-Pu for submit@debbugs.gnu.org; Fri, 23 Sep 2022 14:57:46 -0400 Received: from mout02.posteo.de ([185.67.36.66]:33631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obnrr-0002cN-9p for 53446@debbugs.gnu.org; Fri, 23 Sep 2022 14:57:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 27692240103 for <53446@debbugs.gnu.org>; Fri, 23 Sep 2022 20:57:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663959457; bh=Loxecf0TDZUGmsVc8j5qGkbdAK4YioIie9h5jfaE+X0=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=g5AnVcmuZ3DeV5wv3+Zh6q5rJNkt7Y0kt1LtJijGoVvhNWzkfvMlmVp2fSlzC2h8J pkpCWOrTlBFfUfTk1I8IPcFN5XRRCdZ1G/hbPq85JVn6YD4WLE1SDyGwnG3c/1963G +G/ZCCAroqmT8fK2zIQRK30+riqQBDplyOuVKzsnntzIZhvsdDJvQ/JsBvptmgI2Op Yg7w5ozCUjfEctUdRzXLjKsAtV2wmEs3TuYQitSaZu4AKwkyM/w/qy3t+UblsaK9e6 Rh7RyPF2Ke3klzBzLY6bMWTlb4Cp2dNkBzEqUWNrVAo3PDySZLLzP6JLZ1ISc1imVx 4+I4xW8b9R3kA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MZ1cF4q16z9rxD; Fri, 23 Sep 2022 20:57:32 +0200 (CEST) From: Philip Kaludercic To: Alan Mackenzie Subject: Re: bug#53446: 29.0.50; Issues with awk-mode and electric-pair-mode In-Reply-To: (Alan Mackenzie's message of "Fri, 23 Sep 2022 18:37:57 +0000") References: <875yqbdhvy.fsf@posteo.net> <87czbmv9hp.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Fri, 23 Sep 2022 18:57:31 +0000 Message-ID: <87edw1or50.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53446 Cc: 53446@debbugs.gnu.org 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: -3.3 (---) Alan Mackenzie writes: > Hello, Philip. > > Sorry I missed this bug in January. No problem. > On Fri, Sep 23, 2022 at 07:24:34 +0000, Philip Kaludercic wrote: >> Philip Kaludercic writes: > >> > Open an AWK file, and ensure that electric-pair-mode is enabled. It >> > seems that some character pairs like braces or parentheses are >> > automatically paired, while others like apostrophes or double quotes are >> > not. > > The reason apostrophes don't work with electric-pair-mode is that they > are not quote characters in AWK. :-) > >> I have managed to narrow this bug to the function >> `c-electric-pair-inhibit-predicate' that is used as >> `electric-pair-inhibit-predicate' by cc-mode. Specifically this check > >> (not (equal (c-get-char-property last-quote 'c-fl-syn-tab) '(15))) > >> fails, because the macro > >> (c-get-char-property last-quote 'c-fl-syn-tab) > >> that expands to > >> (get-text-property last-quote 'c-fl-syn-tab) > >> where `last-quote' is the position of the last quotation mark in a >> "logical line", evaluates to nil, not (15). I do not understand why >> this happens, or what the text property `c-fl-syn-tab' is supposed to >> indicate. > > It happens because AWK Mode doesn't use the unterminated string > detection code the other CC Mode modes use. (It doesn't need to, being > simpler.) So, rather than temporarily storing its "working" > syntax-table text properties, AWK just lets them be. So, we can just > test the syntax-table text property for being '(15) (string fence) in > AWK Mode. > >> I have CC'ed Alan to see if he can help. > > Would you please try out the following patch, and let me know how it > goes. Thanks! Yes, this does the job. > > diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el > index 9309a546db..679690b33c 100644 > --- a/lisp/progmodes/cc-mode.el > +++ b/lisp/progmodes/cc-mode.el > @@ -2714,7 +2714,10 @@ c-electric-pair-inhibit-predicate > (save-excursion > (goto-char (c-point 'eoll)) > (search-backward "\""))))) > - (not (equal (c-get-char-property last-quote 'c-fl-syn-tab) '(15)))) > + (not (equal > + (or (c-get-char-property last-quote 'c-fl-syn-tab) > + (c-get-char-property last-quote 'syntax-table)) ; for AWK > + '(15)))) > (funcall (default-value 'electric-pair-inhibit-predicate) char))) > > From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 24 08:37:39 2022 Received: (at 53446-done) by debbugs.gnu.org; 24 Sep 2022 12:37:39 +0000 Received: from localhost ([127.0.0.1]:42615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc4Pb-0000f3-At for submit@debbugs.gnu.org; Sat, 24 Sep 2022 08:37:39 -0400 Received: from mx3.muc.de ([193.149.48.5]:30594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc4PY-0000eo-W1 for 53446-done@debbugs.gnu.org; Sat, 24 Sep 2022 08:37:37 -0400 Received: (qmail 23227 invoked by uid 3782); 24 Sep 2022 14:37:29 +0200 Received: from acm.muc.de (p4fe150de.dip0.t-ipconnect.de [79.225.80.222]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 24 Sep 2022 14:37:29 +0200 Received: (qmail 7009 invoked by uid 1000); 24 Sep 2022 12:37:28 -0000 Date: Sat, 24 Sep 2022 12:37:28 +0000 To: Philip Kaludercic Subject: Re: bug#53446: 29.0.50; Issues with awk-mode and electric-pair-mode Message-ID: References: <875yqbdhvy.fsf@posteo.net> <87czbmv9hp.fsf@posteo.net> <87edw1or50.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87edw1or50.fsf@posteo.net> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53446-done Cc: acm@muc.de, 53446-done@debbugs.gnu.org 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: -1.0 (-) Hello, Philip. On Fri, Sep 23, 2022 at 18:57:31 +0000, Philip Kaludercic wrote: > Alan Mackenzie writes: > > On Fri, Sep 23, 2022 at 07:24:34 +0000, Philip Kaludercic wrote: > >> Philip Kaludercic writes: > >> I have CC'ed Alan to see if he can help. [ .... ] > > Would you please try out the following patch, and let me know how it > > goes. Thanks! > Yes, this does the job. Thanks for the testing! I've actually committed a somewhat different patch to savannah master, which also fixes one or two other minor things in the area. I'm also closing the bug with this post. [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 16 23:54:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 23 Oct 2022 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator