From: Eli Zaretskii <eliz@gnu.org>
To: michael_heerdegen@web.de
Cc: 7587@debbugs.gnu.org
Subject: bug#7587: 23.2; `format-mode-line' makes Emacs crash
Date: Fri, 10 Dec 2010 18:02:21 +0200 [thread overview]
Message-ID: <83k4jh1ur6.fsf@gnu.org> (raw)
In-Reply-To: <87d3pd5mca.fsf@web.de>
> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Tue, 07 Dec 2010 22:01:25 +0100
> Cc:
>
> if I evaluate the following sexp in a fresh emacs -Q (e.g. with
> `eval-expression'):
>
> (progn
> (face-remap-add-relative 'mode-line :height 1.0)
> (format-mode-line mode-line-format t))
>
> Emacs instantly crashes.
This happens because, for some reason I don't understand, when
face-remapping-alist is non-nil, lookup_basic_face insists on getting
only one of the basic faces, and otherwise aborts:
if (NILP (Vface_remapping_alist))
return face_id; /* Nothing to do. */
switch (face_id)
{
case DEFAULT_FACE_ID: name = Qdefault; break;
case MODE_LINE_FACE_ID: name = Qmode_line; break;
case MODE_LINE_INACTIVE_FACE_ID: name = Qmode_line_inactive; break;
case HEADER_LINE_FACE_ID: name = Qheader_line; break;
case TOOL_BAR_FACE_ID: name = Qtool_bar; break;
case FRINGE_FACE_ID: name = Qfringe; break;
case SCROLL_BAR_FACE_ID: name = Qscroll_bar; break;
case BORDER_FACE_ID: name = Qborder; break;
case CURSOR_FACE_ID: name = Qcursor; break;
case MOUSE_FACE_ID: name = Qmouse; break;
case MENU_FACE_ID: name = Qmenu; break;
default:
abort (); /* the caller is supposed to pass us a basic face id */
}
This is inconsistent, because if face-remapping-alist _is_ nil, the
function returns face_id unaltered, no matter if it is or isn't a
basic face.
Any objections to the following patch? On the release branch as well?
=== modified file 'src/xfaces.c'
--- src/xfaces.c 2010-08-06 10:12:41 +0000
+++ src/xfaces.c 2010-12-10 15:58:25 +0000
@@ -4673,9 +4673,6 @@ lookup_basic_face (struct frame *f, int
case CURSOR_FACE_ID: name = Qcursor; break;
case MOUSE_FACE_ID: name = Qmouse; break;
case MENU_FACE_ID: name = Qmenu; break;
-
- default:
- abort (); /* the caller is supposed to pass us a basic face id */
}
/* Do a quick scan through Vface_remapping_alist, and return immediately
next prev parent reply other threads:[~2010-12-10 16:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-07 21:01 bug#7587: 23.2; `format-mode-line' makes Emacs crash Michael Heerdegen
2010-12-10 16:02 ` Eli Zaretskii [this message]
2010-12-10 16:39 ` Eli Zaretskii
2010-12-10 20:50 ` Stefan Monnier
2010-12-10 22:40 ` Eli Zaretskii
2010-12-16 2:17 ` Chong Yidong
2010-12-16 4:39 ` Drew Adams
2010-12-16 5:37 ` Eli Zaretskii
2010-12-16 5:35 ` Eli Zaretskii
2010-12-18 8:56 ` Eli Zaretskii
2010-12-20 15:29 ` Chong Yidong
2010-12-20 18:33 ` Eli Zaretskii
2010-12-25 10:18 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83k4jh1ur6.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=7587@debbugs.gnu.org \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.