From unknown Fri Sep 05 21:09:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#29710: Emacs becomes unresponsive when typing brackets (haskell-mode) Resent-From: Hariharan Rangasamy Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2017 17:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 29710@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.151327115810320 (code B ref -1); Thu, 14 Dec 2017 17:06:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2017 17:05:58 +0000 Received: from localhost ([127.0.0.1]:33974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePWxI-0002gL-EY for submit@debbugs.gnu.org; Thu, 14 Dec 2017 12:05:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePWxG-0002g9-6N for submit@debbugs.gnu.org; Thu, 14 Dec 2017 12:05:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePWx9-0002qQ-GN for submit@debbugs.gnu.org; Thu, 14 Dec 2017 12:05:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePWx9-0002q9-Ck for submit@debbugs.gnu.org; Thu, 14 Dec 2017 12:05:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePWx7-0006So-Is for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2017 12:05:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePWx3-0002fz-3C for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2017 12:05:45 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:40168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePWx2-0002ek-SA for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2017 12:05:41 -0500 Received: by mail-qt0-x242.google.com with SMTP id u42so8784489qte.7 for ; Thu, 14 Dec 2017 09:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=aDnY9+jfphKj/cAcH2eOEMhaPLmBHN6Hdg9nKSt5yTg=; b=PgJGVwGUbl3x+UBwEe3guUVUdA35h+iArRnON3Rm/7R6Jo0iTwMRZSwlF5af+wrC99 Tme8s7NTibDXsJ03ZLUJpMuhbpOB1v4TjIwmYPx5ksC6WzkPbWCmt8xoV7l5QN7f9LI1 95o1IQGhw7PhBLcvEgrei9aqJRUSafetsZa9jXjqbRfeGPMZ2GGvxzOSWrzcMlurzHFY PoWYVGuUrB+5n3zrC30O1lzm/e9zuSFUw0SFf15Olrssb3/3Ctti2M/Gc6WxYyxLknbq Ydw0a2ZsmAHTAZB424yQnK9a4D0kb5eBOxC+sQ02ciN43Bu9deFbNFuWYG2tdlqs7Duf BWiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=aDnY9+jfphKj/cAcH2eOEMhaPLmBHN6Hdg9nKSt5yTg=; b=KoFF7mDgwHbDFj+mxCkYev8eaxgl3zeC0EC7Nm3ODmuwxkwWV/XSWpGvVFTW3218YX /4GFyDckBn4smkpKjBq+w7Wh++U5sLwbMs48WIBt1LDDb6CYse1R8pJE7XQGp0Z6qPCU bsp4TzDxDxd/y+NzgvpJhE5avz8IIdL1CEMDYVZXZiFK81UeNwY/fVhz76rnSS4lAM5s bG7nXCSDNVzON++wKghgGtWFTXy+FtGGw27dJam97ao9NQfWTiNN1cPGOUXVcO2mOGtj odZ+rtdCjhGbboISfVI5W0hBzqlSp9Kob2Vi7ZrWFtHVMJNQ3Rb0KQm7fBWgdOOUM6A9 Z04Q== X-Gm-Message-State: AKGB3mI/MHeGI0xh9oYHwBBlYaoPvERRNeZ1/cYvLwBEuFvmaW9FoRrv sPBltpIRAMifk/0UqtrSQrVWLKyCnIqKpWnA/lhzuX6vvWg= X-Google-Smtp-Source: ACJfBoslWp0PgofB+Ghcn9XuLStfBRrHJaEhULfhHIS/EkrCoHXr90spVSyLvFXv/bI0S3JkL80lIv3a3GEd3DLgThg= X-Received: by 10.237.62.240 with SMTP id o45mr17236440qtf.141.1513271139786; Thu, 14 Dec 2017 09:05:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.82.9 with HTTP; Thu, 14 Dec 2017 09:05:39 -0800 (PST) From: Hariharan Rangasamy Date: Thu, 14 Dec 2017 22:35:39 +0530 Message-ID: Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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: -4.0 (----) Emacs becomes unresponsive when typing {-[]-} when both haskell mode and electric pair mode are enabled. Install haskell mode from https://github.com/haskell/haskell-mode * emacs -Q * enable electric-pair-mode * enable haskell mode in scratch buffer * type {--} * try to input brackets {-[]-} On pressing [ emacs becomes unresponsive, the mouse pointer rotates continuously. On giving C-g repeatedly, the brackets are inserted and emacs becomes responsive again. Also when i send SIGUSR2 signal emacs becomes responsive. The bug was posted in https://www.reddit.com/r/emacs/comments/7jb4qu/bug_with_haskellmode_and_electricpairmode_doesnt/ In the original post the user mentioned emacs was crashing but i was able to reproduce the emacs hang only. I was able to reproduce this issue easily on two different systems. Let me know if you are unable to reproduce the issue or if you need more info. In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 2.24.30) of 2017-12-10 built on hari-VirtualBox Repository revision: 94179453039a23b7f2aefa990e317f72a3df03d5 Windowing system distributor 'The X.Org Foundation', version 11.0.11903000 System Description: Ubuntu 16.04.3 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Error during redisplay: (internal--syntax-propertize 148) signaled (quit) [2 times] Quit Configured using: 'configure --enable-checking=yes,glyphs --enable-check-lisp-object-type --prefix=/home/hari/.install --without-pop 'CFLAGS=-O0 -g3'' Configured features: XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 Important settings: value of $LANG: en_IN value of $XMODIFIERS: @im=ibus locale-coding-system: iso-latin-1-unix Major mode: Haskell Minor modes in effect: shell-dirtrack-mode: t haskell-indentation-mode: t ivy-mode: t electric-pair-mode: t global-company-mode: t company-mode: t show-paren-mode: t override-global-mode: t global-auto-revert-mode: t auto-compile-on-load-mode: t auto-compile-on-save-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-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 transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils haskell-doc inf-haskell haskell-decl-scan imenu shell pcomplete haskell haskell-load haskell-commands highlight-uses-mode haskell-modules haskell-sandbox haskell-navigate-imports haskell-repl haskell-collapse hideshow haskell-debug haskell-hoogle haskell-completions haskell-interactive-mode haskell-presentation-mode haskell-compile haskell-process haskell-session url-util json map haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-compat haskell-complete-module haskell-ghc-support noutline outline flymake-proc flymake warnings dabbrev haskell-customize colir color counsel dired dired-loaddefs compile comint ansi-color esh-util swiper ivy delsel ivy-overlay ffap company-oddmuse company-keywords company-etags etags xref project ring company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb elec-pair company-c-headers rx company pcase highlight-symbol thingatpt paren smex ido two-column edmacro kmacro diminish cl-extra help-mode use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core autorevert filenotify jka-compr auto-compile advice packed finder-inf info package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 256157 11502) (symbols 48 32465 1) (miscs 40 56 142) (strings 32 81273 4132) (string-bytes 1 2196417) (vectors 16 31144) (vector-slots 8 748034 12446) (floats 8 246 393) (intervals 56 389 11) (buffers 992 11) (heap 1024 36431 1849)) From unknown Fri Sep 05 21:09:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#29710: Emacs becomes unresponsive when typing brackets (haskell-mode) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2017 19:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Hariharan Rangasamy Cc: 29710@debbugs.gnu.org Received: via spool by 29710-submit@debbugs.gnu.org id=B29710.151327945822617 (code B ref 29710); Thu, 14 Dec 2017 19:25:01 +0000 Received: (at 29710) by debbugs.gnu.org; 14 Dec 2017 19:24:18 +0000 Received: from localhost ([127.0.0.1]:34072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePZ7B-0005si-N7 for submit@debbugs.gnu.org; Thu, 14 Dec 2017 14:24:17 -0500 Received: from mail-wr0-f174.google.com ([209.85.128.174]:37522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePZ79-0005sW-Lz for 29710@debbugs.gnu.org; Thu, 14 Dec 2017 14:24:16 -0500 Received: by mail-wr0-f174.google.com with SMTP id k61so6075186wrc.4 for <29710@debbugs.gnu.org>; Thu, 14 Dec 2017 11:24:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=++HQ0sAwi9LKcm1i1SCBLC6xIUFcYNSudIIszteQdBU=; b=UJhrcfUpjWEDjFtpCV+j2T3JFd28/Jzu3Sds/EQxwuGeotrKrIWg37JJmRi++whtAA +yXaiTvFlVfwBaIv5S/x7KX/BKAiLk3uE8gP3ZO+2HLFJu/BCFHgO+hx+4OpDpA4nfYQ RC/BuAvqhMwzLKFwCMHLKl+cqQwKl8gYTojByiBIAjMhv9ECZ7YKY2sWVJ0qNe2FAEj0 lBlcTbxRgvPWjXBOi02fxAPjEr8pPoBwqy/QT7MFkCtNU8oAx+XzjSTkDwaNrE7HcSjf iCEg1n3PVGoJx/Sg2k+yhZihYFQmmBVdWhtPi2EynSLKNlLGEHuyQZee0tEL8qSPuB6S anwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=++HQ0sAwi9LKcm1i1SCBLC6xIUFcYNSudIIszteQdBU=; b=mXjmAkP41Y1XAGTLKVddBoljjWX5/3ZF4wSA4O3aqkugHPZmaIdFNMqZAoxKcTK5yp yR9DbX9ZWir9Uw2/DPwOcESi5JQIjriOONloGcPNiej/Qpm6yCP8+LgWQzbzD9AYMUIX g53aY/8mVxO8OpMaGJJPEPD3tobL7F8FiEPV4jPQ3OlrRtu9KKRhZY0vchxpkMEayj6j JfBJKyYhHHRyILKI9zFg/RT47yOW9dV5k5SOLshNSssQXELTQCYwbv8e6gDSE2rxMse2 GX0IQzsyLxR6prilhiVZcKYJgvc687ORXwIwEA9bHaU35m4FiKe9jbDmNoX2ux2g4AjP CDiA== X-Gm-Message-State: AKGB3mK/A9pFnYY9ZhXcqzh1LYBwcA27k4K65NfUXz2VNK7UDrB2MXhV 7AZbxGhZHyncdxRwW8Z/rr2icPSt537fBRYVLVc= X-Google-Smtp-Source: ACJfBotqkU2+mwKNOJFkL2L96RTCGHwmLvxeRinA17bpxMk7FZD1mT2C9Tq4sIKoJCSZpXDTay6posBmvaKucn2F97Y= X-Received: by 10.223.157.137 with SMTP id p9mr7163042wre.92.1513279450012; Thu, 14 Dec 2017 11:24:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.151.116 with HTTP; Thu, 14 Dec 2017 11:24:09 -0800 (PST) In-Reply-To: References: From: Noam Postavsky Date: Thu, 14 Dec 2017 14:24:09 -0500 X-Google-Sender-Auth: weFRYRslsPgsn3lbSqW40pVVSZs Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) 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: 0.5 (/) On Thu, Dec 14, 2017 at 12:05 PM, Hariharan Rangasamy wrote: > Emacs becomes unresponsive when typing {-[]-} when both haskell mode and > electric pair mode are enabled. > > Install haskell mode from https://github.com/haskell/haskell-mode > > * emacs -Q > * enable electric-pair-mode > * enable haskell mode in scratch buffer > * type {--} > * try to input brackets > {-[]-} > > On pressing [ emacs becomes unresponsive, the mouse pointer rotates > continuously. On giving C-g repeatedly, the brackets are inserted and > emacs becomes responsive again. Also when i send SIGUSR2 signal emacs > becomes responsive. > > The bug was posted in > https://www.reddit.com/r/emacs/comments/7jb4qu/bug_with_haskellmode_and_electricpairmode_doesnt/ > In the original post the user mentioned emacs was crashing but i was > able to reproduce the emacs hang only. > > I was able to reproduce this issue easily on two different systems. > Let me know if you are unable to reproduce the issue or if you need > more info. I can reproduce also in 25.3, not in 24.5. Probably same issue as Bug#23443, i.e., electric-pair-mode needs to clear the cache after it finishes messing with the syntax table. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 14 17:34:40 2017 Received: (at control) by debbugs.gnu.org; 14 Dec 2017 22:34:40 +0000 Received: from localhost ([127.0.0.1]:34277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePc5Q-0001IM-3s for submit@debbugs.gnu.org; Thu, 14 Dec 2017 17:34:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePc5O-0001I8-6N for control@debbugs.gnu.org; Thu, 14 Dec 2017 17:34:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePc5I-0001vP-EE for control@debbugs.gnu.org; Thu, 14 Dec 2017 17:34:33 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePc5I-0001vH-Bh for control@debbugs.gnu.org; Thu, 14 Dec 2017 17:34:32 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ePc5H-00067H-T4 for control@debbugs.gnu.org; Thu, 14 Dec 2017 17:34:32 -0500 Subject: control message for bug 29710 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Thu, 14 Dec 2017 17:34:31 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control 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: -5.0 (-----) merge 29715 29710 From unknown Fri Sep 05 21:09:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#29710: Emacs becomes unresponsive when typing brackets (haskell-mode) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Dec 2017 02:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Hariharan Rangasamy Cc: 29710@debbugs.gnu.org, Linus Shoravi Received: via spool by 29710-submit@debbugs.gnu.org id=B29710.151330509222850 (code B ref 29710); Fri, 15 Dec 2017 02:32:02 +0000 Received: (at 29710) by debbugs.gnu.org; 15 Dec 2017 02:31:32 +0000 Received: from localhost ([127.0.0.1]:34389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePfme-0005wP-3c for submit@debbugs.gnu.org; Thu, 14 Dec 2017 21:31:32 -0500 Received: from mail-it0-f42.google.com ([209.85.214.42]:43694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePfma-0005w5-6i; Thu, 14 Dec 2017 21:31:29 -0500 Received: by mail-it0-f42.google.com with SMTP id u62so16178730ita.2; Thu, 14 Dec 2017 18:31:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1YlPLQ2oDJEqBBTDdqbxZW9LJpErtykcVc0gjkdCabE=; b=XIyjzOseq1zO6T2MOvtaLe4bakTMofAS6LmGMLjLnGtP0qEN/r7TTw3U2DLVRR4E3y wVJTBFko854a3fZLOCM0l5C4SmS3OqTM7bUXTjoVWrHOkeO59jVwWuNzMo0iMtbWyRHR 6QnNQ/scJk/ms74ZQfydnJ1zR9TDZPy3qGNqE9S2nAjL6dOOdjLrtSGzXlJREEfMWnAb +o1O5rduKueP8S6FOFMcAQ6ntuzE1HjvQlAaRwmvbKbtiJUvM3hhzNKO9NSYu3WSFTuX LlLMGFv0MtHQVG9ZXjZxAKJHY5QoG8eoPCDQUhbOf6yuyah0Q6cZJcG7mTaRSg1J08IN UBGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=1YlPLQ2oDJEqBBTDdqbxZW9LJpErtykcVc0gjkdCabE=; b=YuAFl+mtdwTmbNNPalMOKYrFZ8LEy/GSGo66RLV2hOiwOooEKSnUYt7R9rXTAIYm6Z G/LIVC8Q5GDJlRBHlazmgd3czfncGV+uU5UnCTy1/q9IWRc2qw3O2ZHh2zutHAXPD0qn qrRuDnpJIb1D5EY8pHbcSI1Jr8Lnbn7ss5wxwsQsWdz10n7aZBNq9qxkegtF5nyIzUpm VQ4ArZbf633Np9rh8N3+phf/aCpXzprAzvqOHGuwUGXO3bhevgL2xj67Y23+iw/LWsZq QieTKG3VqGHgWPs1wG6PJTHsQ2v95Gj1TsHw/BwdoLASL+OuEufMqFIAWAB0P+RG9/fw BKNQ== X-Gm-Message-State: AKGB3mJtPfuzekq3H+DUgvR6jke3wmdkIFvK/gMBRY5o4fGlIvEHVzU+ OPfC9XG884QshxQqsBnymCpcjA== X-Google-Smtp-Source: ACJfBouO9Jx+DEN4kJzGw3WdKjyKi5CuqgHtjbGg2bUS+J/C4bw2mChmASvYkCELTM73l25NOuhcsw== X-Received: by 10.36.22.147 with SMTP id a141mr6144936ita.30.1513305082491; Thu, 14 Dec 2017 18:31:22 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g187sm3274209itb.29.2017.12.14.18.31.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Dec 2017 18:31:21 -0800 (PST) From: Noam Postavsky References: Date: Thu, 14 Dec 2017 21:31:20 -0500 In-Reply-To: (Noam Postavsky's message of "Thu, 14 Dec 2017 14:24:09 -0500") Message-ID: <871sjwd8nb.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) 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: 0.5 (/) --=-=-= Content-Type: text/plain tags 29710 + patch quit Noam Postavsky writes: > I can reproduce also in 25.3, not in 24.5. Probably same issue as > Bug#23443, i.e., electric-pair-mode needs to clear the cache after it > finishes messing with the syntax table. Here's a patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Don-t-mess-up-syntax-ppss-cache-in-electric-pair-.patch Content-Description: patch >From 5b3f0dfb1673617e4646be2be0874b168acc46c4 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 14 Dec 2017 21:25:13 -0500 Subject: [PATCH v1] Don't mess up syntax-ppss cache in electric-pair (Bug#29710) In Emacs 25 and above, calling `scan-sexps', `parse-partial-sexp', or similar may update the syntax-ppss cache if `parse-sexp-lookup-properties' is non-nil. Therefore, when calling any of these functions with a different than normal syntax-table, the cache must be cleaned afterwards. * lisp/elec-pair.el (electric-pair--with-uncached-syntax): New macro. (electric-pair--syntax-ppss, electric-pair--balance-info): Use it. --- lisp/elec-pair.el | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index 7f523d1df4..bdf4bd14b5 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -24,6 +24,7 @@ ;;; Code: (require 'electric) +(eval-when-compile (require 'cl-lib)) ;;; Electric pairing. @@ -222,6 +223,18 @@ electric-pair--insert (electric-pair-mode nil)) (self-insert-command 1))) +(cl-defmacro electric-pair--with-uncached-syntax ((table &optional start-scan) &rest body) + "Like `with-syntax-table', but flush the syntax-ppss cache after." + ;; See Bug#29710 and Bug#23443. + (declare (debug ((form &optional form) body)) (indent 1)) + (let ((start-scan-var (make-symbol "start-scan"))) + `(let ((syntax-propertize-function nil) + (,start-scan-var ,(or start-scan '(point)))) + (unwind-protect + (with-syntax-table ,table + ,@body) + (syntax-ppss-flush-cache ,start-scan-var))))) + (defun electric-pair--syntax-ppss (&optional pos where) "Like `syntax-ppss', but sometimes fallback to `parse-partial-sexp'. @@ -240,7 +253,8 @@ electric-pair--syntax-ppss (skip-syntax-forward " >!") (point))))) (if s-or-c-start - (with-syntax-table electric-pair-text-syntax-table + (electric-pair--with-uncached-syntax (electric-pair-text-syntax-table + s-or-c-start) (parse-partial-sexp s-or-c-start pos)) ;; HACK! cc-mode apparently has some `syntax-ppss' bugs (if (memq major-mode '(c-mode c++ mode)) @@ -293,7 +307,8 @@ electric-pair--balance-info (cond ((< direction 0) (condition-case nil (eq (char-after pos) - (with-syntax-table table + (electric-pair--with-uncached-syntax + (table) (matching-paren (char-before (scan-sexps (point) 1))))) @@ -323,7 +338,7 @@ electric-pair--balance-info (save-excursion (while (not outermost) (condition-case err - (with-syntax-table table + (electric-pair--with-uncached-syntax (table) (scan-sexps (point) (if (> direction 0) (point-max) (- (point-max)))) -- 2.11.0 --=-=-=-- From unknown Fri Sep 05 21:09:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#29710: Emacs becomes unresponsive when typing brackets (haskell-mode) Resent-From: Hariharan Rangasamy Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Dec 2017 03:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 29710@debbugs.gnu.org, Linus Shoravi Received: via spool by 29710-submit@debbugs.gnu.org id=B29710.151330876510587 (code B ref 29710); Fri, 15 Dec 2017 03:33:01 +0000 Received: (at 29710) by debbugs.gnu.org; 15 Dec 2017 03:32:45 +0000 Received: from localhost ([127.0.0.1]:34413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePgjr-0002kf-8l for submit@debbugs.gnu.org; Thu, 14 Dec 2017 22:32:45 -0500 Received: from mail-qt0-f173.google.com ([209.85.216.173]:36919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePgjp-0002kQ-8M for 29710@debbugs.gnu.org; Thu, 14 Dec 2017 22:32:41 -0500 Received: by mail-qt0-f173.google.com with SMTP id f2so10608196qtj.4 for <29710@debbugs.gnu.org>; Thu, 14 Dec 2017 19:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VV7UL6PMQ/MHz0w8gLkbLT+bjkb1sK728fGo3pGzC38=; b=dpEEo6sdguRbFlA/mU2UffGeZ4FnxZ89Za77K23ijMLGzdLxKJoJ0C2HMQ6nj98u+x 8f2I7zbcfa8U9xD9WQvTaH51xCGGiUJpyDR8TY3HPJOEAB5osRlgho9x+RpLAW20b/Tp IJ7giPKPm6mgzrvN+siW7sVJ5EURP8e4M3pBy2tm78Di1+pECPxH8cozjNUObv8eYHfO 00w+1xcmqDXPEL3gIi7k1z5piEBUVrvnSv4ZCY6L0hmJ5GAbuu3gimdVSDVeYHlgwarw IgEVx33KbEk8/uRIH3+kIzzblgQ4+RdmJeAjNPYPGc2zTYGQknSgn0lCr9tic/mHW09Y 73cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VV7UL6PMQ/MHz0w8gLkbLT+bjkb1sK728fGo3pGzC38=; b=imQMF2OIubmvJQ7Q65C3uVXogJGTWOfyA8ApMBaVzzWBxqFu6PIU2zSc5dyevQ0e20 sGZ+kfjYjOcCeVB6Td2lsVIwRxSyPqK54oWMOgjcFpnpHw9qycUVav5xOBCBcEiQvNDz dv9W9DNZTCwFgWvKTO1RZI17VE9JiaYsu13cmLEcuj2Eb8Spjl9cgp9q3xF5t4Kx2h0x +Q3QfWfeWW5IeDwXe8inrXnSV5G6NuRMAvUGe4fogZAIBFg/kmJQCH+RSpQtwphCPmTe 2GAk45eaRigXVWhz+fYAI6Lb2aFiQn4E9Yz4IDyANFC38jJkdP5rIMijXCv7hZMN10fU iAgQ== X-Gm-Message-State: AKGB3mIUTg9vfwET+5Q/jIxzsMlxE2kivScus3palp3wzrfhmBWlr9ru 7aW0s8Hnuky47wYUUeZ9ltOQ+FulIniIa0JqSOo= X-Google-Smtp-Source: ACJfBosT1QIMo+s3udFLYEBrE8h3lK3pfBPdyvkudM2KTmwq/rZ6QZmI229w2usWfdMD0YXGuD+kDFHl/HKZag9QSLY= X-Received: by 10.237.62.240 with SMTP id o45mr19815968qtf.141.1513308755714; Thu, 14 Dec 2017 19:32:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.82.9 with HTTP; Thu, 14 Dec 2017 19:32:35 -0800 (PST) In-Reply-To: <871sjwd8nb.fsf@users.sourceforge.net> References: <871sjwd8nb.fsf@users.sourceforge.net> From: Hariharan Rangasamy Date: Fri, 15 Dec 2017 09:02:35 +0530 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) 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: -0.0 (/) Hi Noam, After applying the patch, the issue is fixed. Thanks, Hari On Fri, Dec 15, 2017 at 8:01 AM, Noam Postavsky wrote: > tags 29710 + patch > quit > > Noam Postavsky writes: > >> I can reproduce also in 25.3, not in 24.5. Probably same issue as >> Bug#23443, i.e., electric-pair-mode needs to clear the cache after it >> finishes messing with the syntax table. > > Here's a patch: > From unknown Fri Sep 05 21:09:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#29710: Emacs becomes unresponsive when typing brackets (haskell-mode) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Dec 2017 08:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: hariharanrangasamy@gmail.com, 29710@debbugs.gnu.org, linusshoravi@gmail.com Reply-To: Eli Zaretskii Received: via spool by 29710-submit@debbugs.gnu.org id=B29710.15133280618215 (code B ref 29710); Fri, 15 Dec 2017 08:55:02 +0000 Received: (at 29710) by debbugs.gnu.org; 15 Dec 2017 08:54:21 +0000 Received: from localhost ([127.0.0.1]:34559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePll7-00028R-8I for submit@debbugs.gnu.org; Fri, 15 Dec 2017 03:54:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePll5-00028E-R1 for 29710@debbugs.gnu.org; Fri, 15 Dec 2017 03:54:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePll0-0000Pw-1Y for 29710@debbugs.gnu.org; Fri, 15 Dec 2017 03:54:14 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePlku-0000LF-1B; Fri, 15 Dec 2017 03:54:08 -0500 Received: from [176.228.60.248] (port=4487 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ePlkt-0007Fg-Ia; Fri, 15 Dec 2017 03:54:07 -0500 Date: Fri, 15 Dec 2017 10:54:07 +0200 Message-Id: <83ind8tlqo.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <871sjwd8nb.fsf@users.sourceforge.net> (message from Noam Postavsky on Thu, 14 Dec 2017 21:31:20 -0500) References: <871sjwd8nb.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) > From: Noam Postavsky > Date: Thu, 14 Dec 2017 21:31:20 -0500 > Cc: 29710@debbugs.gnu.org, Linus Shoravi > > > I can reproduce also in 25.3, not in 24.5. Probably same issue as > > Bug#23443, i.e., electric-pair-mode needs to clear the cache after it > > finishes messing with the syntax table. > > Here's a patch: Thanks, this is okay for the release branch, but please add some commentary to the new macro explaining why it is needed and when it should be used. From unknown Fri Sep 05 21:09:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#29710: Emacs becomes unresponsive when typing brackets (haskell-mode) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Dec 2017 02:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: hariharanrangasamy@gmail.com, 29710@debbugs.gnu.org, linusshoravi@gmail.com Received: via spool by 29710-submit@debbugs.gnu.org id=B29710.151347633222069 (code B ref 29710); Sun, 17 Dec 2017 02:06:01 +0000 Received: (at 29710) by debbugs.gnu.org; 17 Dec 2017 02:05:32 +0000 Received: from localhost ([127.0.0.1]:37906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQOKZ-0005jp-VJ for submit@debbugs.gnu.org; Sat, 16 Dec 2017 21:05:32 -0500 Received: from mail-it0-f50.google.com ([209.85.214.50]:34693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQOKY-0005jW-6b; Sat, 16 Dec 2017 21:05:30 -0500 Received: by mail-it0-f50.google.com with SMTP id m11so2101671iti.1; Sat, 16 Dec 2017 18:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=kCN95gDEBv8uIu0kpmT9ojy8aBw5OdeL9FiE4eNyhUU=; b=d7v6sE53PYxqshiCpHETwD3q5Ydt+TLsTN8817TRR5WUZ+rmBtB9PaNEHCfTRIDVDu AeCR2HM3+gGywxywsfmXbX7HqNJxb0h/uYHkarsQdo5T6BbyfDEEQc3T4pWE0bbnB1oO upGCN1BOtoBC/QSyG6AsrmkuPLPKMNtxKRuIkcemDPWL+fjCI2jCQQ5/61kIboApKDvD CEP7fQjK06isfaliYoaS3JNUM6+UJRxxYgsQTnUDWXhPTbedhdqYIDbHWUIF5Vd7xHL8 +5hs7zmkNd2hl2pVBFgyy8EmZE66rj2oQcBshto+P0veKad6Mot2cJInxXun1609R7tj W03w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=kCN95gDEBv8uIu0kpmT9ojy8aBw5OdeL9FiE4eNyhUU=; b=W3ir/Xv6Ge1MmQf+UWfzsx9iEhS9or/GHsRhFEdimFAN3Sxt7J7NX9+SOeaUglDxUr 9CmKgOz6h/5wcAuVGCSKhUeapba3k4xFgToCy7xOflYQAVxRbV5tqbg5WzlCwPCRD0uF irNC87wn/zIxorwMFzc/+sGoP7HoxWmcFhPW+rIiGjWYAgqFKYog32/oIm6q2AXShO9D WVpwMm27bhBQWNzE0GWc3OEMbCI1ezGAsxQy5mKx4g+MQQ2t71SUGQN7H6/ix4hSYZRU jFkYAIls/ZYqosbIlYMI69px397ucY3ouAqAZU9+bSb+lfw7EB8wKL0xYnEqIvhDcj6F XXkA== X-Gm-Message-State: AKGB3mJLB93VGTG83hQR311zgkQRfg/KuakCHndbDhx7KXqADD1a4Ebh /uem6SFW40dEPc5K6PwIAWaY6A== X-Google-Smtp-Source: ACJfBou2u1AmhQFx4vvBNB/YPiUtocoQ5G8x7lEc4N/eq6mtSprCQwHZleT+mrRVdrnoJFbM+wVD9A== X-Received: by 10.36.121.130 with SMTP id z124mr15297584itc.25.1513476324482; Sat, 16 Dec 2017 18:05:24 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id i76sm5503198itf.3.2017.12.16.18.05.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Dec 2017 18:05:23 -0800 (PST) From: Noam Postavsky References: <871sjwd8nb.fsf@users.sourceforge.net> <83ind8tlqo.fsf@gnu.org> Date: Sat, 16 Dec 2017 21:05:21 -0500 In-Reply-To: <83ind8tlqo.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 15 Dec 2017 10:54:07 +0200") Message-ID: <87k1xmaz32.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) 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: -0.2 (/) tags 29710 fixed close 29710 26.1 quit Eli Zaretskii writes: > Thanks, this is okay for the release branch, but please add some > commentary to the new macro explaining why it is needed and when it > should be used. Done. [1: 89cfdbf729]: 2017-12-16 21:02:38 -0500 Don't mess up syntax-ppss cache in electric-pair (Bug#29710) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=89cfdbf729bc731331358e0efc69547547aa3ca2