Move lisp/emacs-lisp/authors.el to admin/
[bpt/emacs.git] / lisp / frameset.el
index 05fae1b..b943d47 100644 (file)
@@ -940,7 +940,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 +950,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 +1004,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)
@@ -1146,8 +1140,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))))
@@ -1271,6 +1265,17 @@ Called from `jump-to-register'.  Internal use only."
        (set-frame-selected-window frame window)
        (with-current-buffer buffer (goto-char (aref data 2)))))))
 
+;;;###autoload
+(defun frameset--print-register (data)
+  "Print basic info about frameset stored in DATA.
+Called from `list-registers' and `view-register'.  Internal use only."
+  (let* ((fs (aref data 0))
+        (ns (length (frameset-states fs))))
+    (princ (format "a frameset (%d frame%s, saved on %s)."
+                  ns
+                  (if (= 1 ns) "" "s")
+                  (format-time-string "%c" (frameset-timestamp fs))))))
+
 ;;;###autoload
 (defun frameset-to-register (register)
   "Store the current frameset in register REGISTER.
@@ -1288,7 +1293,7 @@ Interactively, reads the register using `register-read-with-preview'."
                         ;; in the current buffer, so record that separately.
                         (frameset-frame-id nil)
                         (point-marker))
-                :print-func (lambda (_data) (princ "a frameset."))
+                :print-func #'frameset--print-register
                 :jump-func #'frameset--jump-to-register)))
 
 (provide 'frameset)