]> code.delx.au - gnu-emacs/commitdiff
* mh-compat.el (mh-font-lock-add-keywords): New alias for
authorBill Wohler <wohler@newt.com>
Fri, 14 Apr 2006 18:49:18 +0000 (18:49 +0000)
committerBill Wohler <wohler@newt.com>
Fri, 14 Apr 2006 18:49:18 +0000 (18:49 +0000)
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
lisp/mh-e/mh-compat.el
lisp/mh-e/mh-e.el

index a7dc14a0d4117618cba1d6c518cdb37dd21896f2..8bd41929cd302776e530c041c7575763b0247ed2 100644 (file)
@@ -1,3 +1,11 @@
+2006-04-14  Bill Wohler  <wohler@newt.com>
+
+       * 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  <wohler@newt.com>
 
        * mh-e.el (customize-package-emacs-version-alist)
index 256a8cfe8313aec9a6e046e501d43a13d3a6ee1b..ababe9652ff6a226374b3fd6e34d10ad6870f008 100644 (file)
@@ -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.
index 23744d8ec8c29c9dd5e5e385b9955e7b4d238bb9..b107de861153db7a75011f7ce0a5600afc4f8630 100644 (file)
 (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)))))
+
 \f
 
 ;;; Global Variables