From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#30852: 27.0.50; infinite loop in internal-get-lisp-face-attribute Date: Mon, 19 Mar 2018 07:56:10 -0700 Message-ID: References: <83sh8wo8qu.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1521471320 6463 195.159.176.226 (19 Mar 2018 14:55:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Mar 2018 14:55:20 +0000 (UTC) Cc: 30852@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 19 15:55:16 2018 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 1exwBu-0001Ya-KL for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Mar 2018 15:55:14 +0100 Original-Received: from localhost ([::1]:42396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exwDx-0007TD-8E for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Mar 2018 10:57:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exwDj-0007Pq-3S for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 10:57:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exwDe-0002sR-MP for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 10:57:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1exwDe-0002ro-It for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 10:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1exwDe-000347-4V for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 10:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Mar 2018 14:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30852-submit@debbugs.gnu.org id=B30852.152147137911734 (code B ref 30852); Mon, 19 Mar 2018 14:57:02 +0000 Original-Received: (at 30852) by debbugs.gnu.org; 19 Mar 2018 14:56:19 +0000 Original-Received: from localhost ([127.0.0.1]:42030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exwCx-00033C-9H for submit@debbugs.gnu.org; Mon, 19 Mar 2018 10:56:19 -0400 Original-Received: from mail-qk0-f172.google.com ([209.85.220.172]:36142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exwCv-00032y-DV for 30852@debbugs.gnu.org; Mon, 19 Mar 2018 10:56:18 -0400 Original-Received: by mail-qk0-f172.google.com with SMTP id d206so18581862qkb.3 for <30852@debbugs.gnu.org>; Mon, 19 Mar 2018 07:56:17 -0700 (PDT) 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=/5QpEC4dqNaPYTPjxKUHzwOse5Hbu3whG6sF0XwLRC4=; b=F7HEp5PSCG//F+/GY3XbZn3YR1dVY655dXjwDCMLJFr0NvpbE9w/M2fppQtSqpf5wt 8TPjcjbc7G8Wa3VLyaZm41crwkp4XaNQioDlZinYThJPlIuA4IlqictnGmWmNvZwEebA Q547n2GQPjSrlQVYYgolo7npb1oneLNFIYl8W6gAoprS2f+19EfEZU7MWGfiFGhC+wFt GxLpVYkIZgngbO08zY7FnaNGjfpxkbf3veWhXDKcopDPeCaYrj986DZgb2BPxgLS5bKj lZIjWzeMbY7GFEqaqdqQ/2+qS+r0u6v13fACb/bF8HCfxAa9Xi0ON4GwmvN24LYoIOoa 4nFA== 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=/5QpEC4dqNaPYTPjxKUHzwOse5Hbu3whG6sF0XwLRC4=; b=CWBjqvUyKebNO/RiZVv005KqgRWeOZXq/UDU8gI3ukr5OEKPKayVlnPB/fMK7VOv/Q UMi+l+MdKTc6hZewT/x2zzwUWu+Ju6ibajpB9bpgugc4C+iaB+3r/W3kS196nqieZTa9 b9QBRb9l2hz7kQNcAibvBdYhtJGkXFSon/QoyI2sNQ4Jwmq5LbsPrBJ0vA/MnYEDWxV1 EmmYwrvmBMyeAxCWE4cDqbof1+KGK2QxXM5Z+IMyWSgsQ42oTthySCcAJRTfsqk3W1KW 8SfHds/yBbjkiO+g8wHCgqTkmdAQzXrZH3Dl18fqVKFgmhc2kSNypRiDeVtx8Jx9CZE2 KHcg== X-Gm-Message-State: AElRT7FLQLkrMXECiEYvhfa7P+yhwyG3Ogp0rW2IwqGOuncEIhLRXQ53 aET/keXDUU8q3EXcHJxyD0zZTUiJx+qwwBDgRQw= X-Google-Smtp-Source: AG47ELvOi4on5DwWSTMymaVrYXwfiu6jcbKDyCccLxKw1r2fULaJ8bmCpM/JZX02y+lFFWWBN/jy+oJQz0PDXHb7HUM= X-Received: by 10.55.164.23 with SMTP id n23mr6020466qke.259.1521471371679; Mon, 19 Mar 2018 07:56:11 -0700 (PDT) Original-Received: by 10.237.60.76 with HTTP; Mon, 19 Mar 2018 07:56:10 -0700 (PDT) In-Reply-To: <83sh8wo8qu.fsf@gnu.org> 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:144406 Archived-At: On Sun, Mar 18, 2018 at 11:54 PM, Eli Zaretskii wrote: > Are you that saying eterm-256color causes Emacs to create a face alist > that is a circular list? No, the problem, which I do not fully understand, is here: https://github.com/dieggsy/eterm-256color/blob/a43f38a7d78364c34efde10dfce0d518f9f4df62/eterm-256color.el#L126-L156 (defun eterm-256color-handle-ansi-escape (handle-fun &rest args) (pcase-let (((or ;; Parameters from Emacs 27. `(,proc ,params ,char) ;; Parameters up to Emacs 26. (and `(,proc ,char) (let params ;; Hack the dynamic vars into a list. (delq nil (delq -1 (list (bound-and-true-p term-terminal-previous-parameter-4) (bound-and-true-p term-terminal-previous-parameter-3) (bound-and-true-p term-terminal-previous-parameter-2) (bound-and-true-p term-terminal-previous-parameter) (bound-and-true-p term-terminal-parameter))))))) args)) (if (eq char '?m) (while params (pcase params (`(38 5 ,color256 . ,_) (eterm-256color-handle-colors color256 'fg) (setq params (nthcdr 3 params))) (`(48 5 ,color256 . ,_) (eterm-256color-handle-colors color256 'bg) (setq params (nthcdr 3 params))) (`(,x . ,_) (eterm-256color-handle-colors x) (setq params (cdr params))))) (apply handle-fun args)))) Specifically, what happens is that the `(setq params ...)` are ineffective. `params` is always bound to what it is bound to via the pcase-let. This only happens the first time this function is run--I'm guessing if `params` is already bound as a variable (as it would be the second time) then the `setq` and the `let` affect the same thing. Changing the while loop to this fixes the bug: (setq my-params params) (while my-params (pcase my-params (`(38 5 ,color256 . ,_) (eterm-256color-handle-colors color256 'fg) (setq my-params (nthcdr 3 my-params))) (`(48 5 ,color256 . ,_) (eterm-256color-handle-colors color256 'bg) (setq my-params (nthcdr 3 my-params))) (`(,x . ,_) (eterm-256color-handle-colors x) (setq my-params (cdr my-params)))))