all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Miles Bader" <miles@gnu.org>
Cc: Emacs-Devel <emacs-devel@gnu.org>
Subject: Re: face-remapping patch
Date: Tue, 27 May 2008 22:54:55 -0400	[thread overview]
Message-ID: <jwvzlqbi23o.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <fc339e4a0805261949l6c1395c1s588949ae3232de99@mail.gmail.com> (Miles Bader's message of "Tue, 27 May 2008 11:49:15 +0900")

> I've attached my face-remapping patch to this message (I needed to
> untangle it from some other changes).

> I've used regularly in my personal emacs for many years, and in light
> testing the patch seems to work fine against the current trunk.

It looks pretty good.  Is there any reason why you added redundant tests
like !NILP (Vface_remapping_alist)?  I'd expect at least in my case that
face-remapping-alist would almost never be nil so this extra test would
end up redundant.


        Stefan


> +int
> +lookup_named_face (f, symbol, signal_p)
> +     struct frame *f;
> +     Lisp_Object symbol;
> +     int signal_p;
> +{
> +  return lookup_named_face_1 (f, symbol, 0);
> +}

Why have a `signal_p' arg that's not used?
Also, the ChangeLog entry doesn't make much sense:

	(lookup_named_face_1): Renamed from `lookup_named_face'.  Add
	`signal_p' argument.  Pass new last arg to `get_lface_attributes', and
	return -1 if it fails.
	(lookup_named_face): Redefined in terms of `lookup_named_face_1'.

The signal_p arg was there before, it's not added.  Am I missing something?

> +  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:
> +      return face_id;		/* Give up.  */

Does this default case correspond to a bug?  if so shouldn't it `abort'?
If not, shouldn't it obey Vface_remapping_alist?

> +  mapping = assq_no_quit (name, Vface_remapping_alist);
> +  if (NILP (mapping))
> +    return face_id;		/* Give up.  */
> +
> +  remapped_face_id = lookup_named_face_1 (f, name, 0);

This looks odd: we look up Vface_remapping_alist and then ignore the
actual result (other than its being null or not).  Is it just an
optimization to avoid calling lookup_named_face_1?  If so, a comment is
in order.




  parent reply	other threads:[~2008-05-28  2:54 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27  2:49 face-remapping patch Miles Bader
2008-05-28  2:03 ` Florian Beck
2008-05-28  2:31   ` Miles Bader
2008-05-29  1:38   ` Richard M Stallman
2008-05-28  2:54 ` Stefan Monnier [this message]
2008-05-28  3:30   ` Miles Bader
2008-05-28  7:22     ` David Reitter
2008-05-28  7:29       ` Miles Bader
2008-05-28  8:05         ` Miles Bader
2008-05-28  9:30           ` David Kastrup
2008-05-28 13:13             ` Miles Bader
2008-05-28 13:33               ` David Kastrup
2008-05-28  9:33         ` David Reitter
2008-05-28 13:21           ` Miles Bader
2008-05-28 14:33             ` David Reitter
2008-05-28 19:25           ` Face realization (was: face-remapping patch) Stefan Monnier
2008-05-28 19:54             ` David Reitter
2008-05-29 15:25               ` Face realization Stefan Monnier
2008-05-28 19:25       ` face-remapping patch Stefan Monnier
2008-05-28 20:21         ` David Kastrup
2008-05-28 20:31           ` David Kastrup
2008-05-29  6:02             ` tomas
2008-05-29 18:14             ` Stephen J. Turnbull
2008-05-29 22:15               ` David Kastrup
2008-05-30  4:48                 ` Stephen J. Turnbull
2008-05-30 13:32               ` Richard M Stallman
2008-05-30 13:50                 ` David Kastrup
2008-05-31 15:17                   ` Richard M Stallman
2008-05-31 15:38                     ` David Kastrup
2008-06-01 14:03                       ` Richard M Stallman
2008-05-29 10:25           ` Richard M Stallman
2008-05-29 11:14             ` David Kastrup
2008-05-29 15:45           ` Specifiers (was: face-remapping patch) Stefan Monnier
2008-05-29 16:21             ` Specifiers David Kastrup
2008-05-29 17:36               ` Specifiers Stefan Monnier
2008-05-29 18:17               ` Specifiers Stephen J. Turnbull
2008-05-30  2:08             ` Specifiers (was: face-remapping patch) Richard M Stallman
2008-05-30  2:21               ` Specifiers Stefan Monnier
2008-05-30  5:31                 ` Specifiers David Kastrup
2008-05-30 14:10                   ` Specifiers Stefan Monnier
2008-05-30 14:14                     ` Specifiers David Kastrup
2008-05-30 15:11                       ` Specifiers Stefan Monnier
2008-05-31 15:16                         ` Specifiers Richard M Stallman
2008-05-29 15:56           ` face-remapping patch Stefan Monnier
2008-05-29 16:27             ` David Kastrup
2008-05-29  8:47   ` Miles Bader
2008-05-29 15:59     ` Stefan Monnier
2008-05-29 18:28     ` Eli Zaretskii
2008-05-30  3:42       ` Miles Bader
2008-05-28 14:46 ` Chong Yidong
2008-05-28 14:57   ` David Reitter
2008-05-28 16:33   ` Miles Bader
2008-05-30 15:10     ` Chong Yidong
2008-06-01  2:43       ` Miles Bader
2008-05-28 16:37 ` Dan Nicolaescu
2008-05-28 17:45   ` Miles Bader

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=jwvzlqbi23o.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    /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.