Drew Adams <drew.adams at oracle.com>
[bpt/emacs.git] / lisp / help.el
index 8c0f92f..b957f88 100644 (file)
@@ -1,7 +1,7 @@
 ;;; help.el --- help commands for Emacs
 
 ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;;   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: help, internal
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -46,6 +46,7 @@
     (define-key map "." 'display-local-help)
     (define-key map "?" 'help-for-help)
 
+    (define-key map "\C-a" 'about-emacs)
     (define-key map "\C-c" 'describe-copying)
     (define-key map "\C-d" 'describe-distribution)
     (define-key map "\C-e" 'view-emacs-problems)
@@ -225,6 +226,7 @@ w  where-is.  Type a command name; it displays which keystrokes
 .  display-local-help.  Display any available local help at point
         in the echo area.
 
+C-a Display information about Emacs.
 C-c Display Emacs copying permission (GNU General Public License).
 C-d Display Emacs ordering information.
 C-e Display info about Emacs problems.
@@ -332,7 +334,7 @@ With argument, display info only for the selected version."
   (when (consp version)
     (let* ((all-versions
            (let (res)
-             (mapcar
+             (mapc
               (lambda (file)
                 (with-temp-buffer
                   (insert-file-contents
@@ -491,6 +493,7 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
                  "Where is command: ")
                obarray 'commandp t))
      (list (if (equal val "") fn (intern val)) current-prefix-arg)))
+  (unless definition (error "No command"))
   (let ((func (indirect-function definition))
         (defs nil)
         (standard-output (if insert (current-buffer) t)))
@@ -641,7 +644,7 @@ temporarily enables it to allow getting help on disabled items and buttons."
           (list
            key
            (prefix-numeric-value current-prefix-arg)
-           ;; If KEY is a down-event, read and discard the
+           ;; If KEY is a down-event, read and include the
            ;; corresponding up-event.  Note that there are also
            ;; down-events on scroll bars and mode lines: the actual
            ;; event then is in the second element of the vector.
@@ -957,14 +960,14 @@ This applies to `help', `apropos' and `completion' buffers, and some others."
     (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window)))
 
 (defun resize-temp-buffer-window ()
-  "Resize the current window to fit its contents.
+  "Resize the selected window to fit its contents.
 Will not make it higher than `temp-buffer-max-height' nor smaller than
 `window-min-height'.  Do nothing if it is the only window on its frame, if it
 is not as wide as the frame or if some of the window's contents are scrolled
 out of view."
   (unless (or (one-window-p 'nomini)
               (not (pos-visible-in-window-p (point-min)))
-              (/=  (frame-width) (window-width)))
+              (not (window-full-width-p)))
     (fit-window-to-buffer
      (selected-window)
      (if (functionp temp-buffer-max-height)