[Python-mode] [ python-mode-Patches-1466941 ] Use defface, not make-face, for creating font lock faces

SourceForge.net noreply at sourceforge.net
Mon Apr 10 17:28:26 CEST 2006


Patches item #1466941, was opened at 2006-04-08 21:25
Message generated for change (Comment added) made by osku_salerma
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1466941&group_id=86916

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Osku Salerma (osku_salerma)
Assigned to: Nobody/Anonymous (nobody)
Summary: Use defface, not make-face, for creating font lock faces

Initial Comment:
The normal way of customizing font lock faces does not
work with python-mode since it does not use the defface
function. The attached patch against python-mode 4.7
fixes this, and one can now use customize-faces to
customize python-mode's faces.

This is tested on emacs 21.4; I have no idea if xemacs
support this or not.

----------------------------------------------------------------------

>Comment By: Osku Salerma (osku_salerma)
Date: 2006-04-10 18:28

Message:
Logged In: YES 
user_id=1474072

The documentation for defface in emacs 21.4 is basically
identical to the one you posted. It it not a recent
addition; according to
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/custom.el?rev=1.1&root=emacs&view=markup
it has been in existence at least since April 1997, the date
that the file custom.el was created.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2006-04-09 19:07

Message:
Logged In: YES 
user_id=44345

XEmacs has defface.  Can you compare this documentation with what's in 
GNU Emacs?  I don't have a recent GNU Emacs handy.  /usr/bin/emacs on my 
Mac says it's version 21.2.1.  Apropos in that environment does not turn up
a defface macro.  Is it a recent addition?

`defface' (buffer: *Hyper Apropos*, mode: Hyper-Apropos)


Compiled Lisp macro,
(loaded from "/Users/skip/src/xemacs-21.5/lisp/custom.elc"):

  arguments: (face spec doc &rest args)

  Declare FACE as a customizable face that defaults to SPEC.
  FACE does not need to be quoted.

  Third argument DOC is the face documentation.

  If FACE has been set with `custom-set-face', set the face attributes
  as specified by that function, otherwise set the face attributes
  according to SPEC.

  The remaining arguments should have the form

     [KEYWORD VALUE]...

  The following KEYWORDs are defined:

  :group  VALUE should be a customization group.
	  Add FACE to that group.

  SPEC should be an alist of the form ((DISPLAY ATTS)...).

  ATTS is a list of face attributes and their values.  The possible
  attributes are defined in the variable `custom-face-attributes'.

  The ATTS of the first entry in SPEC where the DISPLAY matches the
  frame should take effect in that frame.  DISPLAY can either be the
  symbol t, which will match all frames, or an alist of the form
  ((REQ ITEM...)...)

  For the DISPLAY to match a FRAME, the REQ property of the frame must
  match one of the ITEM.  The following REQ are defined:

  `type' (the value of `window-system')
    Should be one of `x', `mswindows', or `tty'.

  `class' (the frame's color support)
    Should be one of `color', `grayscale', or `mono'.

  `background' (what color is used for the background text)
    Should be one of `light' or `dark'.

  Read the section about customization in the Emacs Lisp manual for more
  information.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1466941&group_id=86916


More information about the Python-mode mailing list