From 30545916edad04fb361ce02d05818d04f1e951d5 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Fri, 14 Apr 2006 18:49:18 +0000 Subject: [PATCH] * mh-compat.el (mh-font-lock-add-keywords): New alias for font-lock-add-keywords. Returns nil on XEmacs. * mh-e.el: Add MH-E function and variable keywords such as mh-defun-compat and mh-defcustom to font-lock-keywords. --- lisp/mh-e/ChangeLog | 8 ++++++++ lisp/mh-e/mh-compat.el | 7 ++++++- lisp/mh-e/mh-e.el | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index a7dc14a0d4..8bd41929cd 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,11 @@ +2006-04-14 Bill Wohler + + * mh-compat.el (mh-font-lock-add-keywords): New alias for + font-lock-add-keywords. Returns nil on XEmacs. + + * mh-e.el: Add MH-E function and variable keywords such as + mh-defun-compat and mh-defcustom to font-lock-keywords. + 2006-04-13 Bill Wohler * mh-e.el (customize-package-emacs-version-alist) diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 256a8cfe83..ababe9652f 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el @@ -40,7 +40,7 @@ ;; versions of Gnus. ;; Items are listed alphabetically (except for mh-require which is -;; needed by a lesser character). +;; needed sooner it would normally appear). (require 'mh-acros) @@ -115,6 +115,11 @@ introduced in Emacs 22." `(face-background ,face ,frame) `(face-background ,face ,frame ,inherit))) +(mh-defun-compat mh-font-lock-add-keywords font-lock-add-keywords + (mode keywords &optional how) + "XEmacs does not have `image-search-load-path'. +This function returns nil on that system.") + (mh-defun-compat mh-image-load-path-for-library image-load-path-for-library (library image &optional path no-error) "Return a suitable search path for images used by LIBRARY. diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 23744d8ec8..b107de8611 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -109,6 +109,26 @@ (require 'mh-buffers) (require 'mh-compat) +(mh-font-lock-add-keywords + 'emacs-lisp-mode + (eval-when-compile + `((,(concat "(\\(" + ;; Function declarations (use font-lock-function-name-face). + "\\(mh-def\\(un\\|macro\\)-compat\\)\\|" + ;; Variable declarations (use font-lock-variable-name-face). + "\\(mh-def\\(custom\\|face\\)\\)\\|" + ;; Group declarations (use font-lock-type-face). + "\\(mh-defgroup\\)" + "\\)\\>" + ;; Any whitespace and defined object. + "[ \t'\(]*" + "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?") + (1 font-lock-keyword-face) + (7 (cond ((match-beginning 2) font-lock-function-name-face) + ((match-beginning 4) font-lock-variable-name-face) + (t font-lock-type-face)) + nil t))))) + ;;; Global Variables -- 2.20.1