(ispell-local-dictionary-alist): Add
[bpt/emacs.git] / lisp / frame.el
index 7cef0f3..4a5b09b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; frame.el --- multi-frame management independent of window systems
 
-;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003
+;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -85,8 +85,9 @@ for pop-up frames."
   :group 'frames)
 
 (setq pop-up-frame-function
-      (function (lambda ()
-                 (make-frame pop-up-frame-alist))))
+      ;; Using `function' here caused some sort of problem.
+      '(lambda ()
+        (make-frame pop-up-frame-alist)))
 
 (defcustom special-display-frame-alist
   '((height . 14) (width . 80) (unsplittable . t))
@@ -112,7 +113,7 @@ use (car ARGS) as a function to do the work.
 Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
   (if (and args (symbolp (car args)))
       (apply (car args) buffer (cdr args))
-    (let ((window (get-buffer-window buffer t)))
+    (let ((window (get-buffer-window buffer 0)))
       (or
        ;; If we have a window already, make it visible.
        (when window
@@ -130,6 +131,7 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
         (let* ((pop-up-frames nil) (pop-up-windows t)
                special-display-regexps special-display-buffer-names
                (window (display-buffer buffer)))
+          ;; Only do it if this is a new window:
           ;; (set-window-dedicated-p window t)
           window))
        ;; If no window yet, make one in a new frame.
@@ -335,10 +337,22 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
                                           frame-initial-geometry-arguments)))
                   (top (frame-parameter frame-initial-frame 'top)))
              (when (and (consp initial-top) (eq '- (car initial-top)))
-               (setq newparms
-                     (append newparms
-                             `((top . ,(+ top (* lines char-height))))
-                             nil)))
+               (let ((adjusted-top
+                      (cond ((and (consp top)
+                                  (eq '+ (car top)))
+                             (list '+
+                                   (+ (cadr top)
+                                      (* lines char-height))))
+                            ((and (consp top)
+                                  (eq '- (car top)))
+                             (list '-
+                                   (- (cadr top)
+                                      (* lines char-height))))
+                            (t (+ top (* lines char-height))))))
+                 (setq newparms
+                       (append newparms
+                               `((top . ,adjusted-top))
+                               nil))))
              (modify-frame-parameters frame-initial-frame newparms)
              (tool-bar-mode -1)))))
 
@@ -539,7 +553,7 @@ is not considered (see `next-frame')."
   (interactive)
   (select-window (next-window (selected-window)
                              (> (minibuffer-depth) 0)
-                             t))
+                             0))
   (select-frame-set-input-focus (selected-frame)))
 
 (defun previous-multiframe-window ()
@@ -547,7 +561,7 @@ is not considered (see `next-frame')."
   (interactive)
   (select-window (previous-window (selected-window)
                                  (> (minibuffer-depth) 0)
-                                 t))
+                                 0))
   (select-frame-set-input-focus (selected-frame)))
 
 (defun make-frame-on-display (display &optional parameters)
@@ -942,6 +956,18 @@ one frame, otherwise the name is displayed on the frame's caption bar."
   (interactive "sFrame name: ")
   (modify-frame-parameters (selected-frame)
                           (list (cons 'name name))))
+
+(defun frame-current-scroll-bars (&optional frame)
+  "Return the current scroll-bar settings in frame FRAME.
+Value is a cons (VERTICAL . HORISONTAL) where VERTICAL specifies the
+current location of the vertical scroll-bars (left, right, or nil),
+and HORISONTAL specifies the current location of the horisontal scroll
+bars (top, bottom, or nil)."
+  (let ((vert (frame-parameter frame 'vertical-scroll-bars))
+       (hor nil))
+    (unless (memq vert '(left right nil))
+      (setq vert default-frame-scroll-bars))
+    (cons vert hor)))
 \f
 ;;;; Frame/display capabilities.
 (defun display-mouse-p (&optional display)