diff lisp/packages/apropos.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents ac2d302a0011
children 49a24b4fd526
line wrap: on
line diff
--- a/lisp/packages/apropos.el	Mon Aug 13 08:46:35 2007 +0200
+++ b/lisp/packages/apropos.el	Mon Aug 13 08:46:56 2007 +0200
@@ -66,22 +66,34 @@
   "*Whether the apropos commands should do more.
 Slows them down more or less.  Set this non-nil if you have a fast machine.")
 
-(defvar apropos-symbol-face 'bold
+;; XEmacs addition
+(defvar apropos-symbol-face (if (boundp 'font-lock-keyword-face)
+				font-lock-keyword-face
+			      'bold)
   "*Face for symbol name in apropos output or `nil'.  
 This looks good, but slows down the commands several times.")
 
-(defvar apropos-keybinding-face 'underline
+;; XEmacs addition
+(defvar apropos-keybinding-face (if (boundp 'font-lock-string-face)
+				    font-lock-string-face
+				  'underline)
   "*Face for keybinding display in apropos output or `nil'.  
 This looks good, but slows down the commands several times.")
 
-(defvar apropos-label-face 'italic
+;; XEmacs addition
+(defvar apropos-label-face (if (boundp 'font-lock-comment-face)
+			       font-lock-comment-face
+			     'italic)
   "*Face for label (Command, Variable ...) in apropos output or `nil'.
 If this is `nil' no mouse highlighting occurs.
 This looks good, but slows down the commands several times.
 When this is a face name, as it is initially, it gets transformed to a
 text-property list for efficiency.")
 
-(defvar apropos-property-face 'bold-italic
+;; XEmacs addition
+(defvar apropos-property-face (if (boundp 'font-lock-variable-name-face)
+				  font-lock-variable-name-face
+				'bold-italic)
   "*Face for property name in apropos output or `nil'.  
 This looks good, but slows down the commands several times.")
 
@@ -94,7 +106,7 @@
   (let ((map (make-sparse-keymap)))
     (define-key map [(control m)] 'apropos-follow)
     (define-key map [(button2up)] 'apropos-mouse-follow)
-    (define-key map [(button2down)] 'undefined)
+    (define-key map [(button2)] 'undefined)
     map)
   "Keymap used in Apropos mode.")
 
@@ -111,6 +123,8 @@
 (defvar apropos-item ()
   "Current item in or for apropos-accumulator.")
 
+(defvar apropos-mode-hook nil) ; XEmacs
+
 (defun apropos-mode ()
   "Major mode for following hyperlinks in output of apropos commands.
 
@@ -119,7 +133,8 @@
   (kill-all-local-variables)
   (use-local-map apropos-mode-map)
   (setq major-mode 'apropos-mode
-	mode-name "Apropos"))
+	mode-name "Apropos")
+  (run-hooks 'apropos-mode-hook)) ; XEmacs
 
 
 ;; For auld lang syne:
@@ -461,7 +476,8 @@
 	  (sort apropos-accumulator (lambda (a b)
 				      (string-lessp (car a) (car b)))))
     (and apropos-label-face
-	 (symbolp apropos-label-face)
+	 (or (symbolp apropos-label-face)
+	     (facep apropos-label-face)) ; XEMacs
 	 (setq apropos-label-face `(face ,apropos-label-face
 					 mouse-face highlight)))
     (with-output-to-temp-buffer "*Apropos*"
@@ -629,4 +645,6 @@
     (princ ")")
     (print-help-return-message)))
 
+(provide 'apropos) ; XEmacs
+
 ;;; apropos.el ends here