]> code.delx.au - gnu-emacs/blobdiff - lisp/winner.el
(antlr-c-common-init): Undo last change.
[gnu-emacs] / lisp / winner.el
index 56d9be8b40bd068eddd34cdb1d998c820f3116b6..3443fcb0a9fa098aa1ac1dbd3b95b72bdbe99d80 100644 (file)
@@ -1,12 +1,11 @@
 ;;; winner.el --- Restore old window configurations
 
-;; Copyright (C) 1997, 1998 Free Software Foundation. Inc.
+;; Copyright (C) 1997, 1998, 2001 Free Software Foundation. Inc.
 
-;; Author: Ivar Rummelhoff <ivarr@ifi.uio.no>
-;; Maintainer: Ivar Rummelhoff <ivarr@ifi.uio.no>
+;; Author: Ivar Rummelhoff <ivarru@math.uio.no>
 ;; Created: 27 Feb 1997
 ;; Time-stamp: <1998-08-21 19:51:02 ivarr>
-;; Keywords: windows
+;; Keywords: convenience frames
 
 ;; This file is part of GNU Emacs.
 
 ;;; Code:
 
 (eval-when-compile
-  (require 'cl)
+  (require 'cl))
 
+(eval-when-compile
   (cond
-   ((eq (sref (emacs-version) 0) ?X)
+   ((eq (aref (emacs-version) 0) ?X)
     (defmacro winner-active-region ()
       '(region-active-p))
     (defsetf winner-active-region () (store)
@@ -67,7 +67,8 @@
   (defmacro defcustom (symbol &optional initvalue docs &rest rest)
     (list 'defvar symbol initvalue docs)))
 
-\f;;;###autoload
+\f
+;;;###autoload
 (defcustom winner-mode nil
   "Toggle winner-mode.
 Setting this variable directly does not take effect;
@@ -144,6 +145,16 @@ use either \\[customize] or the function `winner-mode'."
 ;; Frames affected by the previous command.
 (defvar winner-last-frames nil)
 
+
+(defun winner-equal (a b)
+  "Check two Winner configurations A and B for equality.
+Winner configurations are of the form (CONFIG BUFFERS),
+where CONFIG is a window configuration and BUFFERS is a list of
+buffers."
+  (and (compare-window-configurations (car a) (car b))
+       (equal (cdr a) (cdr b))))
+
+
 ;; Save the current window configuration, if it has changed.
 ;; Then return frame, else return nil.
 (defun winner-insert-if-new (frame)
@@ -326,7 +337,8 @@ use either \\[customize] or the function `winner-mode'."
       (split-window)
       winner-var)))
 
-\f;;;###autoload
+\f
+;;;###autoload
 (defun winner-mode (&optional arg)
   "Toggle Winner mode.
 With arg, turn Winner mode on if and only if arg is positive."
@@ -425,10 +437,6 @@ In other words, \"undo\" changes in window configuration."
 \f
 ;;; To be evaluated when the package is loaded:
 
-(if (fboundp 'compare-window-configurations)
-    (defalias 'winner-equal 'compare-window-configurations)
-  (defalias 'winner-equal 'equal))
-
 (unless winner-mode-map
   (setq winner-mode-map (make-sparse-keymap))
   (define-key winner-mode-map [(control x) left] 'winner-undo)