]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/eieio-opt.el
authors.el trivia
[gnu-emacs] / lisp / emacs-lisp / eieio-opt.el
index b2359f74a17f63b0a492af4ca516d659bbbb5e4c..10816aaa43c38b7e32a7fad85813726d51cff5f4 100644 (file)
@@ -1,11 +1,12 @@
 ;;; eieio-opt.el -- eieio optional functions (debug, printing, speedbar)
 
-;; Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2008,
-;;   2009  Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1998-2003, 2005, 2008-2012
+;;   Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Version: 0.2
 ;; Keywords: OO, lisp
+;; Package: eieio
 
 ;; This file is part of GNU Emacs.
 
@@ -31,6 +32,7 @@
 (require 'eieio)
 
 ;;; Code:
+;;;###autoload
 (defun eieio-browse (&optional root-class)
   "Create an object browser window to show all objects.
 If optional ROOT-CLASS, then start with that, otherwise start with
@@ -43,15 +45,14 @@ variable `eieio-default-superclass'."
   (if (not root-class) (setq root-class 'eieio-default-superclass))
   (if (not (class-p root-class)) (signal 'wrong-type-argument (list 'class-p root-class)))
   (display-buffer (get-buffer-create "*EIEIO OBJECT BROWSE*") t)
-  (save-excursion
-    (set-buffer (get-buffer "*EIEIO OBJECT BROWSE*"))
+  (with-current-buffer (get-buffer "*EIEIO OBJECT BROWSE*")
     (erase-buffer)
     (goto-char 0)
     (eieio-browse-tree root-class "" "")
     ))
 
 (defun eieio-browse-tree (this-root prefix ch-prefix)
-  "Recursively, draws the children of the given class on the screen.
+  "Recursively draw the children of the given class on the screen.
 Argument THIS-ROOT is the local root of the tree.
 Argument PREFIX is the character prefix to use.
 Argument CH-PREFIX is another character prefix to display."
@@ -71,8 +72,10 @@ Argument CH-PREFIX is another character prefix to display."
 
 ;;; CLASS COMPLETION / DOCUMENTATION
 
+;;;###autoload
 (defalias 'describe-class 'eieio-describe-class)
 
+;;;###autoload
 (defun eieio-describe-class (class &optional headerfcn)
   "Describe a CLASS defined by a string or symbol.
 If CLASS is actually an object, then also display current values of that object.
@@ -89,7 +92,7 @@ Optional HEADERFCN should be called to insert a few bits of info first."
     (princ "Class ")
     (prin1 class)
     (terpri)
-    ;; Inheritence tree information
+    ;; Inheritance tree information
     (let ((pl (class-parents class)))
       (when pl
        (princ " Inherits from ")
@@ -161,8 +164,7 @@ Optional HEADERFCN should be called to insert a few bits of info first."
            (terpri)
            (terpri))
          (setq methods (cdr methods))))))
-  (save-excursion
-    (set-buffer (help-buffer))
+  (with-current-buffer (help-buffer)
     (buffer-string)))
 
 (defun eieio-describe-class-slots (class)
@@ -239,6 +241,7 @@ Outputs to the standard output."
            prot (cdr prot)
            i (1+ i)))))
 
+;;;###autoload
 (defun eieio-describe-constructor (fcn)
   "Describe the constructor function FCN.
 Uses `eieio-describe-class' to describe the class being constructed."
@@ -302,9 +305,11 @@ are not abstract."
 ;;; METHOD COMPLETION / DOC
 
 (defalias 'describe-method 'eieio-describe-generic)
+;;;###autoload
 (defalias 'describe-generic 'eieio-describe-generic)
 (defalias 'eieio-describe-method 'eieio-describe-generic)
 
+;;;###autoload
 (defun eieio-describe-generic (generic)
   "Describe the generic function GENERIC.
 Also extracts information about all methods specific to this generic."
@@ -376,8 +381,7 @@ Also extracts information about all methods specific to this generic."
            (terpri)
            (terpri)))
        (setq i (1+ i)))))
-  (save-excursion
-    (set-buffer (help-buffer))
+  (with-current-buffer (help-buffer)
     (buffer-string)))
 
 (defun eieio-lambda-arglist (func)
@@ -389,7 +393,8 @@ Also extracts information about all methods specific to this generic."
 
 (defun eieio-all-generic-functions (&optional class)
   "Return a list of all generic functions.
-Optional CLASS argument returns only those functions that contain methods for CLASS."
+Optional CLASS argument returns only those functions that contain
+methods for CLASS."
   (let ((l nil) tree (cn (if class (symbol-name class) nil)))
     (mapatoms
      (lambda (symbol)
@@ -551,8 +556,9 @@ Optional argument HISTORYVAR is the variable to use as history."
 
 ;;; HELP AUGMENTATION
 ;;
+;;;###autoload
 (defun eieio-help-mode-augmentation-maybee (&rest unused)
-  "For buffers thrown into help mode, augment for eieio.
+  "For buffers thrown into help mode, augment for EIEIO.
 Arguments UNUSED are not used."
   ;; Scan created buttons so far if we are in help mode.
   (when (eq major-mode 'help-mode)
@@ -600,13 +606,13 @@ Arguments UNUSED are not used."
 (eval-when-compile
   (condition-case nil
       (require 'speedbar)
-    (error (message "Error loading speedbar... ignored."))))
+    (error (message "Error loading speedbar... ignored"))))
 
 (defvar eieio-class-speedbar-key-map nil
   "Keymap used when working with a project in speedbar.")
 
 (defun eieio-class-speedbar-make-map ()
-  "Make a keymap for eieio under speedbar."
+  "Make a keymap for EIEIO under speedbar."
   (setq eieio-class-speedbar-key-map (speedbar-make-specialized-keymap))
 
   ;; General viewing stuff
@@ -637,8 +643,8 @@ Arguments UNUSED are not used."
 
 (defun eieio-class-speedbar (dir-or-object depth)
   "Create buttons in speedbar that represents the current project.
-DIR-OR-OBJECT is the object to expand, or nil, and DEPTH is the current
-expansion depth."
+DIR-OR-OBJECT is the object to expand, or nil, and DEPTH is the
+current expansion depth."
   (when (eq (point-min) (point-max))
     ;; This function is only called once, to start the whole deal.
     ;; Ceate, and expand the default object.
@@ -694,4 +700,8 @@ INDENT is the current indentation level."
 
 (provide 'eieio-opt)
 
+;; Local variables:
+;; generated-autoload-file: "eieio.el"
+;; End:
+
 ;;; eieio-opt.el ends here