emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Face realization (was: face-remapping patch)


From: David Reitter
Subject: Re: Face realization (was: face-remapping patch)
Date: Wed, 28 May 2008 20:54:35 +0100

On 28 May 2008, at 20:25, Stefan Monnier wrote:

Also, as you point out, there's a gross inefficiency in that most faces
are really terminal-local rather than frame-local (after all, the
defface spec does not allow per-frame customizations), so we should
share the resulting realized faces.  If you have a patch for it, maybe
you should post it here,


Well, my patch is rather small. I simply don't run `make-face-x- resource-internal' for each frame. I think there's some way to specify the equivalent of X resources on Carbon, but that's nothing that justified the need for an operation that delayed frame creation by that much. This has worked for a lot of users since I started using it, and it sped up frame creation enormously.

I really don't know anything about X, so apologies if the below trick won't work in X based environment.



*** lisp/faces.el       13 Apr 2007 18:24:53 +0100      1.370
--- lisp/faces.el       13 Jul 2007 18:56:06 +0100      
***************
*** 320,326 ****

  (defun set-face-attributes-from-resources (face frame)
    "Set attributes of FACE from X resources for FRAME."
!   (when (memq (framep frame) '(x w32 mac))
      (dolist (definition face-x-resources)
        (let ((attribute (car definition)))
        (dolist (entry (cdr definition))
--- 320,326 ----

  (defun set-face-attributes-from-resources (face frame)
    "Set attributes of FACE from X resources for FRAME."
!   (when (eq (framep frame) 'x)
      (dolist (definition face-x-resources)
        (let ((attribute (car definition)))
        (dolist (entry (cdr definition))
***************
*** 1789,1796 ****
        (condition-case ()
          (progn
            (face-spec-set face (face-user-default-spec face) frame)
!           (if (memq window-system '(x w32 mac))
!               (make-face-x-resource-internal face frame))
            (internal-merge-in-global-face face frame))
        (error nil)))
      ;; Apply the attributes specified by frame parameters.  This
--- 1789,1796 ----
        (condition-case ()
          (progn
            (face-spec-set face (face-user-default-spec face) frame)
!            (if (eq window-system 'x)
!               (make-face-x-resource-internal face frame))
            (internal-merge-in-global-face face frame))
        (error nil)))
      ;; Apply the attributes specified by frame parameters.  This





reply via email to

[Prev in Thread] Current Thread [Next in Thread]