From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#7587: 23.2; `format-mode-line' makes Emacs crash Date: Thu, 16 Dec 2010 00:35:51 -0500 Message-ID: References: <87d3pd5mca.fsf@web.de> <83k4jh1ur6.fsf@gnu.org> <83fwu51cc1.fsf@gnu.org> <87ei9icvg0.fsf@stupidchicken.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1292478781 12428 80.91.229.12 (16 Dec 2010 05:53:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Dec 2010 05:53:01 +0000 (UTC) Cc: michael_heerdegen@web.de, 7587@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 16 06:52:56 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PT6lr-0003Un-J8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 06:52:55 +0100 Original-Received: from localhost ([127.0.0.1]:42230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PT6lr-0001bb-14 for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 00:52:55 -0500 Original-Received: from [140.186.70.92] (port=43440 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PT6le-0001ai-Gs for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2010 00:52:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PT6ld-0007Z6-9d for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2010 00:52:42 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PT6ld-0007Z2-6g for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2010 00:52:41 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PT6Pj-0005uW-2Q; Thu, 16 Dec 2010 00:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Dec 2010 05:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7587 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7587-submit@debbugs.gnu.org id=B7587.129247738022671 (code B ref 7587); Thu, 16 Dec 2010 05:30:03 +0000 Original-Received: (at 7587) by debbugs.gnu.org; 16 Dec 2010 05:29:40 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PT6PL-0005tc-Gd for submit@debbugs.gnu.org; Thu, 16 Dec 2010 00:29:39 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PT6PJ-0005tQ-30 for 7587@debbugs.gnu.org; Thu, 16 Dec 2010 00:29:37 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1PT6VL-0006G6-N2; Thu, 16 Dec 2010 00:35:51 -0500 In-reply-to: <87ei9icvg0.fsf@stupidchicken.com> (message from Chong Yidong on Thu, 16 Dec 2010 10:17:51 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 16 Dec 2010 00:30:03 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42550 Archived-At: > From: Chong Yidong > Cc: Stefan Monnier , Miles Bader , > michael_heerdegen@web.de, 7587@debbugs.gnu.org > Date: Thu, 16 Dec 2010 10:17:51 +0800 > > format-mode-line should not pass non-basic faces to init_iterator. Where do you see this condition enforced or assumed in the code? I see only the commentary before init_iterator, but I'm not sure which code (except lookup_basic_face) would really puke or DTWT with a non-basic face. And support for face remapping already means that you can sneak a non-basic face in, anyway. > I'm not even sure what the FACE argument to format-mode-line is > useful for The doc string and the ELisp manual clearly answer that question: format-mode-line can be used to compute the formatted string without displaying it. When you use this API that way, you can specify a face for the parts of mode line that don't have their faces specified in the mode-line format. IOW, it sounds like a deliberate feature, given the description in the ELisp manual. > it doesn't seem to be used anywhere in the sources. ?? init_iterator uses it (well, its index in the face cache) to initialize the appropriate member of the iterator object. > I've changed format-mode-line so that if you pass a face argument to > FACES, it should be one of `default', `mode-line', etc. Any other face > gets treated as `default'. Given some history of discussions here, and the fact that no one seems to be sure how this code should really work and why, I wonder why you went ahead with the change without discussing it first. I'm afraid that this change breaks backward compatibility for no good reason. Anyway, this being an incompatible change, it should be in NEWS. In addition, the ELisp manual should be modified accordingly. Also, there seems to be a bug in the change itself, in this line: + : EQ (face, Qmode_line_inactive) ? MODE_LINE_FACE_ID