From unknown Tue Jun 17 20:06:47 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#55823 <55823@debbugs.gnu.org> To: bug#55823 <55823@debbugs.gnu.org> Subject: Status: 28.1; electric-pair-open-newline-between-pairs does not work with c-context-line-break Reply-To: bug#55823 <55823@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:06:47 +0000 retitle 55823 28.1; electric-pair-open-newline-between-pairs does not work = with c-context-line-break reassign 55823 emacs submitter 55823 Sean Devlin severity 55823 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 06 18:17:05 2022 Received: (at submit) by debbugs.gnu.org; 6 Jun 2022 22:17:05 +0000 Received: from localhost ([127.0.0.1]:37049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyL21-0008Md-1r for submit@debbugs.gnu.org; Mon, 06 Jun 2022 18:17:05 -0400 Received: from lists.gnu.org ([209.51.188.17]:59586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyL1z-0008MW-L4 for submit@debbugs.gnu.org; Mon, 06 Jun 2022 18:17:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyL1z-0001dk-Gx for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2022 18:17:03 -0400 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:46663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyL1x-0004Nt-De for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2022 18:17:03 -0400 Received: by mail-qk1-x72b.google.com with SMTP id o68so11957729qkf.13 for ; Mon, 06 Jun 2022 15:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20210112.gappssmtp.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=qrEPjP7gg/aH9ZfX2Ecg0bUq86nn2Pon+FHfYd+ZypI=; b=29eyS8EA5f2VmelUeGfJqYqDDwEhByOtcvpj6mK4jTsCK0qainmQ0cuSQN+q+l/4Lh l0ZT5wve3m295PTPHTK8Oj80xRnzaQsktUHYWlGyEfydhIQwtdvOqSbdl3UrKjkfXxrL pko7WklLxhp5DZj2SK2W/bTAVX3WetxitBLcTc1b/vOaYByxiMyWkPSQr910iK+uozIp 0dhxidBM4wolABRxD2XVnM46GsHhHljhmFTmBHksAXndvDxa2N7+d24Ww0g6859uj9ao HeB7nvF+2PsyvU2daPB3c2sFuPFKlhA653Pt81eTSmtaOBMGqOXlgx5Ts9w1g4IdhqVE N7UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=qrEPjP7gg/aH9ZfX2Ecg0bUq86nn2Pon+FHfYd+ZypI=; b=E7M9KQVynZQSqKDPUbhrKvkr8dNO7qHujLy4775FoMob54vVHykjgk8njmPuaXHgyT 2kVRzXLKQO35txP+ooHlqp097tX9fZO3GWoLSXDjCnuYMEGl88OrnfADJmziwevB2K+7 uQec8sLq4JIThAAhHbs1SnaNUUYqf7i2qRfv3DMB5xQX0k+55ef2eqx4fsM2YmOHBY8G 1FxjE7rZZoD3UvqqAJ7YRRVhr59ksDUxoFsfiZq0X337LYcWFP47nSJs5zFaGCk1PLzz 8qt1Izj1aEM4PJ9arOskoueqcq8927i1OlecsvjFRt3Z9dUBbXLbyzmUUaSgcl+J/rhD V4rA== X-Gm-Message-State: AOAM532c5uNiC+wxNF+Ht5U5aPZVDAgqMlh1U26dW+WT1gy/T+UqsLaM OEnE02022A7TuzxkXN5EphyJ+UWD1NQXcg== X-Google-Smtp-Source: ABdhPJxESLWeFc169hRLgtbMRyRJ3vCfH7pQyytLY88Lg7fOvncfrhLy4Xn2+0qxAdZlgfKBPuISJA== X-Received: by 2002:a05:620a:1a0c:b0:6a6:d021:7be3 with SMTP id bk12-20020a05620a1a0c00b006a6d0217be3mr2548489qkb.667.1654553819589; Mon, 06 Jun 2022 15:16:59 -0700 (PDT) Received: from smtpclient.apple (pool-71-190-218-156.nycmny.fios.verizon.net. [71.190.218.156]) by smtp.gmail.com with ESMTPSA id t22-20020a05620a451600b006a6a7e70211sm2794796qkp.96.2022.06.06.15.16.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2022 15:16:59 -0700 (PDT) From: Sean Devlin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3720.101.4.1.62\)) Subject: 28.1; electric-pair-open-newline-between-pairs does not work with c-context-line-break Message-Id: <26EACFE4-D9A8-4A75-90BD-F93124A68A78@toadstyle.org> Date: Mon, 6 Jun 2022 18:16:47 -0400 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3720.101.4.1.62) Received-SPF: pass client-ip=2607:f8b0:4864:20::72b; envelope-from=spd@toadstyle.org; helo=mail-qk1-x72b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 (--) The command c-context-line-break in cc-cmds.el does not seem to respect the electric-pair-open-newline-between-pairs setting when electric-pair-mode is enabled. To reproduce: 1. Start Emacs with -Q 2. M-x erase-buffer, SPC to run the disabled command 3. M-x c-mode 4. M-x electric-pair-mode 5. Type an opening brace '{' and observe that a closing brace '}' is = entered automatically 6. RET to enter a newline and observe that a second newline is entered automatically per the electric-pair-open-newline-between-pairs setting 7. C-/ to undo 8. M-x c-context-line-break to enter a newline and observe that the second newline was not added I think the issue is that c-context-line-break calls newline without running the post-self-insert-hook, i.e. it calls (newline) rather than (newline 1 t). Since this command seems intended as a context-aware replacement for newline (the manual suggests binding it to RET), I believe that it should respect the electric-pair-open-newline-between-pairs setting. Thanks! In GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS = appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-05-11 built on armbob.lan Windowing system distributor 'Apple' System Description: macOS Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER THREADS TOOLKIT_SCROLL_BARS ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: C/*l Minor modes in effect: electric-pair-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra seq byte-opt gv bytecomp byte-compile cconv help-mode novice cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib cus-start cus-load elec-pair iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win 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 hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 81493 6707) (symbols 48 9331 1) (strings 32 26161 1367) (string-bytes 1 992832) (vectors 16 17076) (vector-slots 8 223432 9001) (floats 8 27 38) (intervals 56 241 0) (buffers 992 11))