From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27115: Infinite loop created by fixing 26097 Date: Wed, 31 May 2017 12:26:04 +0300 Message-ID: <8337ble5sj.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1496222839 28855 195.159.176.226 (31 May 2017 09:27:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 May 2017 09:27:19 +0000 (UTC) Cc: 27115@debbugs.gnu.org To: Codrut Gusoi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 31 11:27:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFzuI-00072a-QT for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 May 2017 11:27:11 +0200 Original-Received: from localhost ([::1]:58086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFzuM-00062V-Mc for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 May 2017 05:27:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFzuE-00061q-BK for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 05:27:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFzuB-0004um-7W for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 05:27:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFzuB-0004ue-4g for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 05:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dFzuA-0004mg-W0 for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 05:27:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 May 2017 09:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27115 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27115-submit@debbugs.gnu.org id=B27115.149622276818308 (code B ref 27115); Wed, 31 May 2017 09:27:02 +0000 Original-Received: (at 27115) by debbugs.gnu.org; 31 May 2017 09:26:08 +0000 Original-Received: from localhost ([127.0.0.1]:46182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFztH-0004lE-OU for submit@debbugs.gnu.org; Wed, 31 May 2017 05:26:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44825) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFztF-0004kj-9G for 27115@debbugs.gnu.org; Wed, 31 May 2017 05:26:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFzt7-0004dh-1P for 27115@debbugs.gnu.org; Wed, 31 May 2017 05:26:00 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFzt6-0004da-Nr; Wed, 31 May 2017 05:25:56 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4243 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dFzt4-0007MI-Rm; Wed, 31 May 2017 05:25:55 -0400 In-reply-to: (message from Codrut Gusoi on Sun, 28 May 2017 14:39:42 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133080 Archived-At: > From: Codrut Gusoi > Date: Sun, 28 May 2017 14:39:42 +0300 > > 1) I am using Spacemacs > (https://github.com/sdwolf/spacemacs/tree/develop) with evil and helm. > 2) I have linum active. > 3) I press "M-x" which is bound to (helm-M-x). This opens helm and > triggers something called "Auto Evilification". Somewhere in this > process the following message is displayed: > > ``` > Auto-evilification could not remap these functions in map ‘edebug-mode-map’: > - ‘edebug-Go-nonstop-mode’ originally mapped on ‘G’ > ``` > > This is a single string with multiple "\n" inside it that can be > generated by the following code (extracted from Spacemacs): > > ``` > (setq my-map-symbol 'edebug-mode-map) > (setq my-pending-funcs '((edebug-Go-nonstop-mode . 71))) > (message (concat (format (concat "Auto-evilification could not remap > these " "functions in map `%s': \n") my-map-symbol) (mapconcat (lambda > (x) (format " - `%s' originally mapped on `%s'" (car x) > (single-key-description (cdr x)))) my-pending-funcs "\n"))) > ``` > > 4) After the above message is displayed emacs freezes. This seems to be due to a bug in Spacemacs's customization of linum-mode. The details are below, but first 2 possible workarounds: Workaround #1: set resize-mini-windows to nil. Workaround #2: Remove the after-advice from linum-update-window: M-: (advice-remove 'linum-update-window 'spacemacs//linum-update-window-scale-fix) RET Details: The problem starts with linum's linum-after-scroll function, which is installed in the window-scroll-functions hook, called by redisplay. linum-after-scroll calls linum-update, which calls linum-update-window, which decides, in the above scenario, to set the window's left margin width to 3. On a TTY, this requires adjustment of the frame's glyph matrices, which causes the frame's garbaged flag to become set. This alone would not have caused redisplay to infloop, because the next redisplay retry would find the window's margins already set to the correct value, and would not require adjustment of frame's glyph matrices. However, Spacemacs installs an after-advice for linum-update-window, which in this scenario resets the margin width back to 1. So, the next redisplay retry will again try to enlarge the margin width to 3, which will cause the frame's garbaged flag to be set, etc. etc., ad nauseam. I think the bug is in Spacemacs's advice function, but I have no clear understanding what it tries to do, and why in this case it decides to reset the margin width to 1. So I installed a band-aid, which will discontinue the retries after a few attempts, just so Emacs remains usable. Note that in the above scenario this causes the frame's display to be slightly incorrect: the mode line of one of the windows is not redrawn. I'm deliberately not going to try to fix this, because I think the underlying bug is in Spacemacs, and should be fixed there. Last, but not least: thank you for giving me a login on your system and arranging for a very easy reproduction of the problem. This made debugging very easy. I'll leave this bug open, in case followup discussions bring up additional issues or better ideas for fixing this scenario.