Merge changes from emacs-23 branch.
[bpt/emacs.git] / lisp / calc / calc-help.el
index 79026df..47c9513 100644 (file)
@@ -1,7 +1,7 @@
 ;;; calc-help.el --- help display functions for Calc,
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
@@ -110,8 +110,7 @@ C-w  Describe how there is no warranty for Calc."
 (defun calc-describe-bindings ()
   (interactive)
   (describe-bindings)
-  (save-excursion
-    (set-buffer "*Help*")
+  (with-current-buffer "*Help*"
     (let ((inhibit-read-only t))
       (goto-char (point-min))
       (when (search-forward "Major Mode Bindings:" nil t)
@@ -129,7 +128,7 @@ C-w  Describe how there is no warranty for Calc."
               (dig2 (char-after (match-beginning 3))))
           (delete-region (match-end 1) (match-end 0))
           (goto-char (match-beginning 1))
-          (delete-backward-char 1)
+          (delete-char -1)
           (delete-char 5)
           (insert (format "%c .. %c" (min dig1 dig2) (max dig1 dig2)))))
       (goto-char (point-min)))))
@@ -178,8 +177,7 @@ C-w  Describe how there is no warranty for Calc."
       (if (string-match "\\(DEL\\|\\LFD\\|RET\\|SPC\\|TAB\\)" desc)
           (setq desc (replace-match "<\\&>" nil nil desc)))
       (if briefly
-         (let ((msg (save-excursion
-                      (set-buffer (get-buffer-create "*Calc Summary*"))
+         (let ((msg (with-current-buffer (get-buffer-create "*Calc Summary*")
                       (if (= (buffer-size) 0)
                           (progn
                             (message "Reading Calc summary from manual...")
@@ -283,7 +281,7 @@ C-w  Describe how there is no warranty for Calc."
                                (beginning-of-line)
                                (princ (buffer-substring pt (point))))
                              (setq notes (cdr notes)))
-                           (print-help-return-message)))
+                           (help-print-return-message)))
                      (calc-unread-command (cdr key)))))
              (if (or (null defn) (integerp defn))
                  (message "%s is undefined" desc)
@@ -416,8 +414,7 @@ C-w  Describe how there is no warranty for Calc."
 (defun calc-full-help ()
   (interactive)
   (with-output-to-temp-buffer "*Help*"
-    (princ (format "GNU Emacs Calculator version %s.\n"
-                  calc-version))
+    (princ "GNU Emacs Calculator.\n")
     (princ "  By Dave Gillespie.\n")
     (princ (format "  %s\n\n" emacs-copyright))
     (princ "Type `h s' for a more detailed summary.\n")
@@ -449,6 +446,7 @@ C-w  Describe how there is no warranty for Calc."
            '(calc-inverse-prefix-help
              calc-hyperbolic-prefix-help
              calc-inv-hyp-prefix-help
+              calc-option-prefix-help
              calc-a-prefix-help
              calc-b-prefix-help
              calc-c-prefix-help
@@ -467,7 +465,7 @@ C-w  Describe how there is no warranty for Calc."
              calc-shift-Y-prefix-help
              calc-shift-Z-prefix-help
              calc-z-prefix-help)))
-    (print-help-return-message)))
+    (help-print-return-message)))
 
 (defun calc-h-prefix-help ()
   (interactive)
@@ -515,6 +513,11 @@ C-w  Describe how there is no warranty for Calc."
      "I H + a S (general invert func); v h (rtail)")
    "inverse-hyperbolic" nil))
 
+(defun calc-option-prefix-help ()
+  (interactive)
+  (calc-do-prefix-help
+   '("")
+   "option" nil))
 
 (defun calc-f-prefix-help ()
   (interactive)