]> code.delx.au - gnu-emacs/blobdiff - lisp/frameset.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / frameset.el
index 3a43f39600c2b1861eaf0c1be3a998697e0412ca..2453f57e228a46756f68f5731b9c7125a63c45e0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; frameset.el --- save and restore frame and window setup -*- lexical-binding: t -*-
 
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
 
 ;; Author: Juanma Barranquero <lekktu@gmail.com>
 ;; Keywords: convenience
@@ -354,12 +354,12 @@ Properties can be set with
 ;; Now, what about the filter alist variables? There are three of them,
 ;; though only two sets of parameters:
 ;;
-;; - `frameset-session-filter-alist' contains these filters that allow to
-;;   save and restore framesets in-session, without the need to serialize
-;;   the frameset or save it to disk (for example, to save a frameset in a
-;;   register and restore it later).  Filters in this list do not remove
-;;   live objects, except in `minibuffer', which is dealt especially by
-;;   `frameset-save' / `frameset-restore'.
+;; - `frameset-session-filter-alist' contains these filters that allow
+;;   saving and restoring framesets in-session, without the need to
+;;   serialize the frameset or save it to disk (for example, to save a
+;;   frameset in a register and restore it later).  Filters in this
+;;   list do not remove live objects, except in `minibuffer', which is
+;;   dealt especially by `frameset-save' / `frameset-restore'.
 ;;
 ;; - `frameset-persistent-filter-alist' is the whole deal.  It does all
 ;;   the filtering described above, and the result is ready to be saved on
@@ -664,10 +664,7 @@ nil while the filtering is done to restore it."
     ;; Set the display parameter after filtering, so that filter functions
     ;; have access to its original value.
     (when frameset--target-display
-      (let ((display (assq 'display filtered)))
-       (if display
-           (setcdr display (cdr frameset--target-display))
-         (push frameset--target-display filtered))))
+      (setf (alist-get 'display filtered) (cdr frameset--target-display)))
     filtered))
 
 \f
@@ -940,7 +937,7 @@ is the parameter alist of the frame being restored.  Internal use only."
 Setting position and size parameters as soon as possible helps reducing
 flickering; other parameters, like `minibuffer' and `border-width', can
 not be changed once the frame has been created.  Internal use only."
-  (cl-loop for param in '(left top with height border-width minibuffer)
+  (cl-loop for param in '(left top width height border-width minibuffer)
           when (assq param parameters) collect it))
 
 (defun frameset--restore-frame (parameters window-state filters force-onscreen)
@@ -950,15 +947,10 @@ PARAMETERS is the frame's parameter alist; WINDOW-STATE is its window state.
 For the meaning of FILTERS and FORCE-ONSCREEN, see `frameset-restore'.
 Internal use only."
   (let* ((fullscreen (cdr (assq 'fullscreen parameters)))
-        (lines (assq 'tool-bar-lines parameters))
         (filtered-cfg (frameset-filter-params parameters filters nil))
         (display (cdr (assq 'display filtered-cfg))) ;; post-filtering
         alt-cfg frame)
 
-    ;; This works around bug#14795 (or feature#14795, if not a bug :-)
-    (setq filtered-cfg (assq-delete-all 'tool-bar-lines filtered-cfg))
-    (push '(tool-bar-lines . 0) filtered-cfg)
-
     (when fullscreen
       ;; Currently Emacs has the limitation that it does not record the size
       ;; and position of a frame before maximizing it, so we cannot save &
@@ -1009,8 +1001,7 @@ Internal use only."
               (not (eq (frame-parameter frame 'visibility) 'icon)))
       (frameset-move-onscreen frame force-onscreen))
 
-    ;; Let's give the finishing touches (visibility, tool-bar, maximization).
-    (when lines (push lines alt-cfg))
+    ;; Let's give the finishing touches (visibility, maximization).
     (when alt-cfg (modify-frame-parameters frame alt-cfg))
     ;; Now restore window state.
     (window-state-put window-state (frame-root-window frame) 'safe)
@@ -1031,8 +1022,8 @@ Internal use only."
 (defun frameset-keep-original-display-p (force-display)
   "True if saved frames' displays should be honored.
 For the meaning of FORCE-DISPLAY, see `frameset-restore'."
-  (cond ((daemonp) t)
-       ((eq system-type 'windows-nt) nil) ;; Does ns support more than one display?
+  (cond ((eq system-type 'windows-nt) nil) ;; Does ns support more than one display?
+       ((daemonp) t)
        (t (not force-display))))
 
 (defun frameset-minibufferless-first-p (frame1 _frame2)
@@ -1081,7 +1072,7 @@ FORCE-ONSCREEN can be:
           - a list (LEFT TOP WIDTH HEIGHT), describing the workarea.
           It must return non-nil to force the frame onscreen, nil otherwise.
 
-CLEANUP-FRAMES allows to \"clean up\" the frame list after restoring a frameset:
+CLEANUP-FRAMES allows \"cleaning up\" the frame list after restoring a frameset:
   t        Delete all frames that were not created or restored upon.
   nil      Keep all frames.
   FUNC     A function called with two arguments:
@@ -1146,8 +1137,8 @@ All keyword parameters default to nil."
                     frame to-tty duplicate)
                ;; Only set target if forcing displays and the target display is different.
                (unless (or (frameset-keep-original-display-p force-display)
-                           (eq (frame-parameter nil 'display)
-                               (cdr (assq 'display frame-cfg))))
+                           (equal (frame-parameter nil 'display)
+                                  (cdr (assq 'display frame-cfg))))
                  (setq frameset--target-display (cons 'display
                                                       (frame-parameter nil 'display))
                        to-tty (null (cdr frameset--target-display))))