(frameset): Use type vector, not list (incompatible change).
Do not declare a new constructor, use the default one.
Upgrade suggested properties `app', `name' and `desc' to slots `app',
`name' and `description', respectively, and add read-only slot `timestamp'.
Doc fixes.
(frameset-copy, frameset-persistent-filter-alist)
(frameset-filter-alist, frameset-switch-to-gui-p)
(frameset-switch-to-tty-p, frameset-filter-tty-to-GUI)
(frameset-filter-sanitize-color, frameset-filter-minibuffer)
(frameset-filter-iconified, frameset-keep-original-display-p):
Doc fixes.
(frameset-filter-shelve-param, frameset-filter-unshelve-param):
Rename from frameset-filter-(save|restore)-param. All callers changed.
Doc fix.
(frameset-p): Adapt to change to vector and be more thorough.
Change arg name to OBJECT. Doc fix.
(frameset-prop): Rename arg PROP to PROPERTY. Doc fix.
(frameset-session-filter-alist): Rename from frameset-live-filter-alist.
All callers changed.
(frameset-frame-with-id): Rename from frameset-locate-frame-id.
All callers changed.
(frameset--record-minibuffer-relationships): Rename from
frameset--process-minibuffer-frames. All callers changed.
(frameset-save): Add new keyword arguments APP, NAME and DESCRIPTION.
Use new default constructor (again). Doc fix.
(frameset--find-frame-if): Rename from `frameset--find-frame.
All callers changed.
(frameset--reuse-frame): Rename arg FRAME-CFG to PARAMETERS.
(frameset--initial-params): Rename arg FRAME-CFG to PARAMETERS.
Doc fix.
(frameset--restore-frame): Rename args FRAME-CFG and WINDOW-CFG to
PARAMETERS and WINDOW-STATE, respectively.
(frameset-restore): Add new keyword argument PREDICATE.
Reset frameset--target-display to nil. Doc fix.
lisp/desktop.el (desktop-save-frameset): Use new frameset-save args.
Use lexical-binding.
(frameset): Add docstring. Move :version property to its
own `version' slot.
(frameset-copy): Rename from copy-frameset.
(frameset-p): Check more thoroughly.
(frameset-prop): Do not check for :version, which is no longer a prop.
(frameset-live-filter-alist, frameset-persistent-filter-alist):
Use new :never value instead of t.
(frameset-filter-alist): Expand and clarify docstring.
(frameset-filter-tty-to-GUI, frameset-filter-sanitize-color)
(frameset-filter-minibuffer, frameset-filter-save-param)
(frameset-filter-restore-param, frameset-filter-iconified):
Add pointer to docstring of frameset-filter-alist.
(frameset-filter-params): Rename filter values to be more meaningful:
:never instead of t, and reverse the meanings of :save and :restore.
(frameset--process-minibuffer-frames): Clarify error message.
(frameset-save): Avoid unnecessary and confusing call to framep.
Use new BOA constructor for framesets.
(frameset--reuse-list): Doc fix.
(frameset--restore-frame): Rename from frameset--get-frame. Doc fix.
(frameset--minibufferless-last-p): Rename from frameset--sort-states.
(frameset-minibufferless-first-p): Doc fix.
Rename from frameset-sort-frames-for-deletion.
(frameset-restore): Doc fixes. Use new function names.
Most changes suggested by Drew Adams <drew.adams@oracle.com>.
* lisp/desktop.el (desktop-clear): Use new name of sort predicate.
(frameset-live-filter-alist, frameset-persistent-filter-alist):
New variables.
(frameset-filter-alist): Use them. Add autoload cookie.
(frameset-filter-tty-to-GUI): Move from desktop.el and rename.
(frameset--set-id, frameset--reuse-frame): Rename `frame-id' to
`frameset--id' (it's supposed to be internal to frameset.el).
(frameset--process-minibuffer-frames): Ditto. Doc fix.
(frameset--initial-params): New function.
(frameset--get-frame): Use it. Doc fix.
(frameset--move-onscreen): Accept new PRED value for FORCE-ONSCREEN.
Accept :all, not 'all.
(frameset-restore): Add new predicate values for FORCE-ONSCREEN and
FORCE-DISPLAY. Use :keywords for constant arguments to avoid collision
with fbound symbols. Fix frame id matching, and remove matching ids if
the frame being restored is deleted. Obey :delete.
* lisp/desktop.el (desktop-restore-forces-onscreen)
(desktop-restore-reuses-frames): Document :keyword constant values.
(desktop-filter-parameters-alist): Remove, now identical to
frameset-filter-alist.
(desktop--filter-tty*): Remove, moved to frameset.el.
(desktop-save-frameset, desktop-restore-frameset):
Do not pass :filters argument.
(desktop--make-frame): Include `minibuffer' in the minimal set of parameters
passed when creating a frame, because the minibuffer status of a frame cannot
be changed later.
(desktop-restoring-reuses-frames): New option.
(desktop--compute-pos, desktop--move-onscreen): New functions.
(desktop--make-frame): Use desktop--move-onscreen.
(desktop--make-frame): Do not pass the `fullscreen' parameter to
modify-frame-parameters if the value has not changed.
(desktop--make-frame): On cl-delete-if call, check parameter name,
not full parameter.
(desktop-before-saving-frames-functions): New hook.
(desktop--process-minibuffer-frames): Set desktop-mini parameter only
for frames being saved. Rename from desktop--save-minibuffer-frames.
(desktop-save-frames): Run hook desktop-before-saving-frames-functions.
Do not save frames with non-nil `desktop-dont-save' parameter. Filter
out deleted frames.
(desktop--find-frame): Use cl-find-if.
(desktop--select-frame): Use cl-(first|second|third) to access values
of desktop-mini.
(desktop--make-frame): Use cl-delete-if.
(desktop--sort-states): Fix sorting of minibuffer-owning frames.
(desktop-restore-frames): Use cl-(first|second|third) to access values
of desktop-mini. Look for visible frame at the end, not while
restoring frames.
(desktop-saved-frame-states): Rename from desktop--saved-states;
all users changed.
(desktop-save-frames): Rename from desktop--save-frames.
Do not save state to desktop file.
(desktop-save): Save desktop-saved-frame-states to desktop file
and reset to nil.
(desktop-restoring-frames-p): New function.
(desktop-restore-frames): Use it. Rename from desktop--restore-frames.
(desktop-read): Use desktop-restoring-frames-p. Do not try to fix
buffer-lists when restoring frames. Suggested by Martin Rudalics.
(desktop-restore-in-current-display): Now offer more options.
(desktop-restoring-reuses-frames): New customization option.
(desktop--saved-states): Doc fix.
(desktop-filter-parameters-alist): New variable, renamed and expanded from
desktop--excluded-frame-parameters.
(desktop--target-display): New variable.
(desktop-switch-to-gui-p, desktop-switch-to-tty-p, desktop--filter-tty*)
(desktop--filter-*-color, desktop--filter-minibuffer)
(desktop--filter-restore-desktop-parm, desktop--filter-save-desktop-parm)
(desktop-restore-in-original-display-p): New functions.
(desktop--filter-frame-parms): Use new desktop-filter-parameters-alist.
(desktop--save-minibuffer-frames): New function, inspired by a similar
function from Martin Rudalics.
(desktop--save-frames): Call it; play nice with desktop-globals-to-save.
(desktop--restore-in-this-display-p): Remove.
(desktop--find-frame): Rename from desktop--find-frame-in-display and add
predicate argument.
(desktop--make-full-frame): Remove, integrated into desktop--make-frame.
(desktop--reuse-list): New variable.
(desktop--select-frame, desktop--make-frame, desktop--sort-states):
New functions.
(desktop--restore-frames): Add support for "minibuffer-special" frames.
(desktop--v2s): Remove unused local variable.
(desktop-save-buffer): Make defvar-local; adjust docstring.
(desktop-auto-save-timeout, desktop-owner): Use ignore-errors.
(desktop-clear, desktop-save-buffer-p): Use string-match-p.
(desktop-restore-frames): Rename from desktop-save-windows.
(desktop-restore-in-current-display): New customization option.
(desktop--excluded-frame-parameters): Add `font'.
(desktop--save-frames): Rename from desktop--save-windows.
(desktop--restore-in-this-display-p): New function.
(desktop--make-full-frame): Remove unwanted width/height from
full(width|height) frames.
(desktop--restore-frames): Rename from desktop--restore-windows.
Obey desktop-restore-current-display. Do not delete old frames or
select a new frame unless we were able to restore at least one frame.
It is still experimental and disabled by default.
* lisp/desktop.el (desktop--save-windows): Put the selected frame at
the head of the list.
(desktop--make-full-frame): New function.
(desktop--restore-windows): Try to re-select the frame that was
selected upon saving. Do not abort if some frames fail to restore,
just show an error message and contnue. Set up maximized frames so
they have default non-maximized dimensions.
* etc/NEWS: Document new Desktop option `desktop-save-windows'.
* lisp/desktop.el (desktop-save-windows): New defcustom.
(desktop--saved-states): New var.
(desktop--excluded-frame-parameters): New defconst.
(desktop--filter-frame-parms, desktop--find-frame-in-display)
(desktop--restore-windows, desktop--save-windows): New functions.
(desktop-save): Call `desktop--save-windows'.
(desktop-read): Call `desktop--restore-windows'.
(desktop-file-checksum): New variable.
(desktop-save): Add optional arg `auto-save' and don't auto-save
if nothing changed.
(desktop-auto-save-timer): New variable.
(desktop-auto-save, desktop-auto-save-set-timer): New functions.
(after-init-hook): Call `desktop-auto-save-set-timer'.
Suggested by Reuben Thomas <rrt@sc3d.org> in
<http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00327.html>.
* lisp/vc/vc-dir.el (vc-dir-mode): Autoload it (for desktop restore).
Set buffer-local value of desktop-save-buffer.
(vc-dir-desktop-buffer-misc-data, vc-dir-restore-desktop-buffer):
New functions.
(desktop-buffer-mode-handlers): Add vc-dir-mode entry.
* lisp/desktop.el (desktop-save-buffer-p): Treat vc-dir like dired.