summaryrefslogtreecommitdiff
path: root/lisp/desktop.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2013-08-05 00:12:18 +0200
committerJuanma Barranquero <lekktu@gmail.com>2013-08-05 00:12:18 +0200
commitd5671a82b8b78b5fd8d83cfc15642d2c0eff6de2 (patch)
treeb77fc2966aca90b9ac1e72dbd73d86ea652374df /lisp/desktop.el
parent016d3f7ddcc9afd60c455cbf4dd79277080c4d4e (diff)
downloademacs-d5671a82b8b78b5fd8d83cfc15642d2c0eff6de2.tar.gz
* lisp/frameset.el: Add new predicate values for frameset-restore args.
(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.
Diffstat (limited to 'lisp/desktop.el')
-rw-r--r--lisp/desktop.el29
1 files changed, 4 insertions, 25 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 778c37484e1..ab78663c3d0 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -390,12 +390,12 @@ If `delete', frames on other displays are deleted instead of restored."
(defcustom desktop-restore-forces-onscreen t
"If t, offscreen frames are restored onscreen instead.
-If `all', frames that are partially offscreen are also forced onscren.
+If `:all', frames that are partially offscreen are also forced onscren.
NOTE: Checking of frame boundaries is only approximate and can fail
to reliably detect frames whose onscreen/offscreen state depends on a
few pixels, especially near the right / bottom borders of the screen."
:type '(choice (const :tag "Only fully offscreen frames" t)
- (const :tag "Also partially offscreen frames" 'all)
+ (const :tag "Also partially offscreen frames" :all)
(const :tag "Do not force frames onscreen" nil))
:group 'desktop
:version "24.4")
@@ -403,10 +403,10 @@ few pixels, especially near the right / bottom borders of the screen."
(defcustom desktop-restore-reuses-frames t
"If t, restoring frames reuses existing frames.
If nil, existing frames are deleted.
-If `keep', existing frames are kept and not reused."
+If `:keep', existing frames are kept and not reused."
:type '(choice (const :tag "Reuse existing frames" t)
(const :tag "Delete existing frames" nil)
- (const :tag "Keep existing frames" 'keep))
+ (const :tag "Keep existing frames" :keep))
:group 'desktop
:version "24.4")
@@ -900,25 +900,6 @@ DIRNAME must be the directory in which the desktop file will be saved."
;; ----------------------------------------------------------------------------
-(defvar desktop-filter-parameters-alist
- (append '((font-backend . t)
- (name . t)
- (outer-window-id . t)
- (parent-id . t)
- (tty . desktop--filter-tty*)
- (tty-type . desktop--filter-tty*)
- (window-id . t)
- (window-system . t))
- frameset-filter-alist)
- "Alist of frame parameters and filtering functions.
-Its format is identical to `frameset-filter-alist' (which see).")
-
-(defun desktop--filter-tty* (_current parameters saving)
- ;; Remove tty and tty-type parameters when switching
- ;; to a GUI frame.
- (or saving
- (not (frameset-switch-to-gui-p parameters))))
-
(defun desktop--check-dont-save (frame)
(not (frame-parameter frame 'desktop-dont-save)))
@@ -932,7 +913,6 @@ Frames with a non-nil `desktop-dont-save' parameter are not saved."
(let ((name (concat user-login-name "@" system-name
(format-time-string " %Y-%m-%d %T"))))
(frameset-save nil
- :filters desktop-filter-parameters-alist
:predicate #'desktop--check-dont-save
:properties (list :app desktop--app-id
:name name))))))
@@ -1049,7 +1029,6 @@ This function depends on the value of `desktop-saved-frameset'
being set (usually, by reading it from the desktop)."
(when (desktop-restoring-frameset-p)
(frameset-restore desktop-saved-frameset
- :filters desktop-filter-parameters-alist
:reuse-frames desktop-restore-reuses-frames
:force-display desktop-restore-in-current-display
:force-onscreen desktop-restore-forces-onscreen)))