diff options
| author | Juanma Barranquero | 2014-02-19 22:04:06 +0100 |
|---|---|---|
| committer | Juanma Barranquero | 2014-02-19 22:04:06 +0100 |
| commit | 94e5e202d952ac74c6540ed41b1bac957855c5fa (patch) | |
| tree | d8c5043c1cd01c195dd28562f40a5676f9571ea9 | |
| parent | c0733b63c5cae787e791f22b6eadd01e1baefe71 (diff) | |
| download | emacs-94e5e202d952ac74c6540ed41b1bac957855c5fa.tar.gz emacs-94e5e202d952ac74c6540ed41b1bac957855c5fa.zip | |
lisp/frameset.el (frameset-restore): Remove duplicate ids only when needed.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/frameset.el | 23 |
2 files changed, 17 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 733c83f467c..94a194bbd99 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-02-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * frameset.el (frameset-restore): Delay removing an old frame's | ||
| 4 | duplicate id until the new frame has been correctly created. | ||
| 5 | |||
| 1 | 2014-02-19 Michael Albinus <michael.albinus@gmx.de> | 6 | 2014-02-19 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/tramp.el (tramp-handle-make-symbolic-link): New defun. | 8 | * net/tramp.el (tramp-handle-make-symbolic-link): New defun. |
diff --git a/lisp/frameset.el b/lisp/frameset.el index 977cc8433d4..f0d38d911f3 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el | |||
| @@ -1116,7 +1116,7 @@ All keyword parameters default to nil." | |||
| 1116 | (force-display (if (functionp force-display) | 1116 | (force-display (if (functionp force-display) |
| 1117 | (funcall force-display frame-cfg window-cfg) | 1117 | (funcall force-display frame-cfg window-cfg) |
| 1118 | force-display)) | 1118 | force-display)) |
| 1119 | frame to-tty) | 1119 | frame to-tty duplicate) |
| 1120 | ;; Only set target if forcing displays and the target display is different. | 1120 | ;; Only set target if forcing displays and the target display is different. |
| 1121 | (cond ((frameset-keep-original-display-p force-display) | 1121 | (cond ((frameset-keep-original-display-p force-display) |
| 1122 | (setq frameset--target-display nil)) | 1122 | (setq frameset--target-display nil)) |
| @@ -1134,16 +1134,14 @@ All keyword parameters default to nil." | |||
| 1134 | (or (eq force-display :delete) | 1134 | (or (eq force-display :delete) |
| 1135 | (and to-tty | 1135 | (and to-tty |
| 1136 | (eq (cdr (assq 'minibuffer frame-cfg)) 'only)))) | 1136 | (eq (cdr (assq 'minibuffer frame-cfg)) 'only)))) |
| 1137 | ;; If keeping non-reusable frames, and the frameset--id of one of them | 1137 | ;; To avoid duplicating frame ids after restoration, we note any |
| 1138 | ;; matches the id of a frame being restored (because, for example, the | 1138 | ;; existing frame whose id matches a frame configuration in the |
| 1139 | ;; frameset has already been read in the same session), remove the | 1139 | ;; frameset. Once the frame config is properly restored, we can |
| 1140 | ;; frameset--id from the non-reusable frame, which is not useful anymore. | 1140 | ;; reset the old frame's id to nil. |
| 1141 | (when (and other-frames | 1141 | (setq duplicate (and other-frames |
| 1142 | (or (eq reuse-frames :keep) (consp reuse-frames))) | 1142 | (or (eq reuse-frames :keep) (consp reuse-frames)) |
| 1143 | (let ((dup (frameset-frame-with-id (frameset-cfg-id frame-cfg) | 1143 | (frameset-frame-with-id (frameset-cfg-id frame-cfg) |
| 1144 | other-frames))) | 1144 | other-frames))) |
| 1145 | (when dup | ||
| 1146 | (set-frame-parameter dup 'frameset--id nil)))) | ||
| 1147 | ;; Restore minibuffers. Some of this stuff could be done in a filter | 1145 | ;; Restore minibuffers. Some of this stuff could be done in a filter |
| 1148 | ;; function, but it would be messy because restoring minibuffers affects | 1146 | ;; function, but it would be messy because restoring minibuffers affects |
| 1149 | ;; global state; it's best to do it here than add a bunch of global | 1147 | ;; global state; it's best to do it here than add a bunch of global |
| @@ -1177,6 +1175,9 @@ All keyword parameters default to nil." | |||
| 1177 | (setq frame (frameset--restore-frame frame-cfg window-cfg | 1175 | (setq frame (frameset--restore-frame frame-cfg window-cfg |
| 1178 | (or filters frameset-filter-alist) | 1176 | (or filters frameset-filter-alist) |
| 1179 | force-onscreen)) | 1177 | force-onscreen)) |
| 1178 | ;; Now reset any duplicate frameset--id | ||
| 1179 | (when (and duplicate (not (eq frame duplicate))) | ||
| 1180 | (set-frame-parameter duplicate 'frameset--id nil)) | ||
| 1180 | ;; Set default-minibuffer if required. | 1181 | ;; Set default-minibuffer if required. |
| 1181 | (when default (setq default-minibuffer-frame frame)))) | 1182 | (when default (setq default-minibuffer-frame frame)))) |
| 1182 | (error | 1183 | (error |