]> code.delx.au - gnu-emacs/blobdiff - lisp/apropos.el
Fix previous change.
[gnu-emacs] / lisp / apropos.el
index 1befefe881477e15258de234032dd1a01a189913..b9d7e3ff41d40c5aead2136e38b1e772e74d976a 100644 (file)
@@ -1,6 +1,6 @@
 ;;; apropos.el --- apropos commands for users and programmers
 
-;; Copyright (C) 1989,94,1995,2001,02,03,2004  Free Software Foundation, Inc.
+;; Copyright (C) 1989,94,1995,2001,02,03,04,2005  Free Software Foundation, Inc.
 
 ;; Author: Joe Wells <jbw@bigbird.bu.edu>
 ;; Rewritten: Daniel Pfeiffer <occitan@esperanto.org>
@@ -322,13 +322,13 @@ Value is a list of offsets of the words into the string."
 
 (defun apropos-score-doc (doc)
   "Return apropos score for documentation string DOC."
-  (if doc
-      (let ((score 0)
-           (l (length doc))
-           i)
-       (dolist (s (apropos-calc-scores doc apropos-all-words) score)
-         (setq score (+ score 50 (/ (* (- l s) 50) l)))))
-      0))
+  (let ((l (length doc)))
+    (if (> l 0)
+       (let ((score 0)
+             i)
+         (dolist (s (apropos-calc-scores doc apropos-all-words) score)
+           (setq score (+ score 50 (/ (* (- l s) 50) l)))))
+      0)))
 
 (defun apropos-score-symbol (symbol &optional weight)
   "Return apropos score for SYMBOL."
@@ -860,13 +860,12 @@ If non-nil TEXT is a string that will be printed as a heading."
                                              key))
                       key)
                     item ", "))
-                (insert "M-x")
-                (put-text-property (- (point) 3) (point)
-                                   'face apropos-keybinding-face)
-                (insert " " (symbol-name symbol) " ")
-                (insert "RET")
-                (put-text-property (- (point) 3) (point)
-                                   'face apropos-keybinding-face)))
+                (insert "M-x ... RET")
+                (when apropos-keybinding-face
+                  (put-text-property (- (point) 11) (- (point) 8)
+                                     'face apropos-keybinding-face)
+                  (put-text-property (- (point) 3) (point)
+                                     'face apropos-keybinding-face))))
          (terpri)
          (apropos-print-doc 2
                             (if (commandp symbol)