unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17589: 24.3.91; lisp/frameset.el
@ 2014-05-25 20:49 eg5cue
  2014-05-26 17:18 ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: eg5cue @ 2014-05-25 20:49 UTC (permalink / raw)
  To: 17589

cmdline: emacs -Q
version: git 24.3.91.1 (branch emacs-24)

frame 'a': (C-x r f a)
changing buffers and windows ...
frame 'b': (C-x r f b)
when i want to go back to 'a' (C-x r j a) emacs can't remember the frame and
open random buffer instead. (no error)
i tried both GUI and terminal versions. 









In GNU Emacs 24.3.91.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8)
 of 2014-05-25 on XX
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
System Description:	Gentoo Base System release 2.2

Configured using:
 `configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --libdir=/usr/lib64 --disable-silent-rules
 --disable-dependency-tracking --program-suffix=-emacs-24-git
 --infodir=/usr/share/info/emacs-24-git --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --with-gameuser=games --without-compress-install
 --with-file-notification=inotify --enable-acl --with-dbus --with-gnutls
 --with-gpm --without-hesiod --without-kerberos --without-kerberos5
 --with-xml2 --without-selinux --with-wide-int --with-zlib
 --with-sound=alsa --with-x --without-ns --without-gconf
 --without-gsettings --without-toolkit-scroll-bars --without-gif
 --without-jpeg --without-png --without-rsvg --without-tiff --with-xpm
 --without-imagemagick --with-xft --without-libotf --without-m17n-flt
 --with-x-toolkit=gtk3 GENTOO_PACKAGE=app-editors/emacs-git-24.4.9999
 'CFLAGS=-O2 -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Memory information:
((conses 16 185981 8887)
 (symbols 48 30733 0)
 (miscs 40 73 106)
 (strings 32 47584 5705)
 (string-bytes 1 1463860)
 (vectors 16 22398)
 (vector-slots 8 506557 4327)
 (floats 8 125 71)
 (intervals 56 301 0)
 (buffers 960 15)
 (heap 1024 41524 1001))





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-25 20:49 bug#17589: 24.3.91; lisp/frameset.el eg5cue
@ 2014-05-26 17:18 ` Juanma Barranquero
  2014-05-26 17:49   ` Arash Cue
  0 siblings, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-26 17:18 UTC (permalink / raw)
  To: eg5cue; +Cc: 17589

> when i want to go back to 'a' (C-x r j a) emacs can't remember the frame and
> open random buffer instead. (no error)

Could you please give a step-by-step recipe starting from emacs -Q and
describing the buffers that you do see at each step?

TIA,

   Juanma





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-26 17:18 ` Juanma Barranquero
@ 2014-05-26 17:49   ` Arash Cue
  2014-05-26 19:04     ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: Arash Cue @ 2014-05-26 17:49 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17589

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

sry, now i noticed it only happens when different files with the same name
opened in each frame... , here's what i did:

emacs -Q
opening file a/util.c and a/util.h side by side, save window configuration
in register (C-x r f a)
then file b/util.c and b/util.h, (C-x r f b)

when i want to restore register 'a' (C-x r j a) emacs opens random buffers
instead, but register 'b' works.

i tried last commit of branch 'emacs-24' today and it still happens, but
emacs-24.3 works fine.


On Mon, May 26, 2014 at 5:18 PM, Juanma Barranquero <lekktu@gmail.com>wrote:

> > when i want to go back to 'a' (C-x r j a) emacs can't remember the frame
> and
> > open random buffer instead. (no error)
>
> Could you please give a step-by-step recipe starting from emacs -Q and
> describing the buffers that you do see at each step?
>
> TIA,
>
>    Juanma
>

[-- Attachment #2: Type: text/html, Size: 1610 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-26 17:49   ` Arash Cue
@ 2014-05-26 19:04     ` Juanma Barranquero
  2014-05-26 20:32       ` Stefan Monnier
  0 siblings, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-26 19:04 UTC (permalink / raw)
  To: Arash Cue; +Cc: 17589

On Mon, May 26, 2014 at 7:49 PM, Arash Cue <eg5cue@gmail.com> wrote:

> sry, now i noticed it only happens when different files with the same name
> opened in each frame...

Interesting.

Saving a frame configuration to a register really does a very
low-level saving of the frame, so I suppose it keeps pointers to the
buffers even if they are renamed.

Framesets (or, really, window states) on the other hand, save the
buffer *names*. So if you rename a buffer, as it happens when you
visit another file with the same name, the frameset's window state
loses the reference to the original buffer.

As framesets used in frameset-to-register (C-x r f R) are intended for
in-session use only, I suppose I could hook into uniquify or some
other hook and dynamically alter the in-memory frameset(s), but it
seems quite hackish. I'll have to think about it.

    J





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-26 19:04     ` Juanma Barranquero
@ 2014-05-26 20:32       ` Stefan Monnier
  2014-05-26 20:42         ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: Stefan Monnier @ 2014-05-26 20:32 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Arash Cue, 17589

> Framesets (or, really, window states) on the other hand, save the
> buffer *names*. So if you rename a buffer, as it happens when you
> visit another file with the same name, the frameset's window state
> loses the reference to the original buffer.

Saving buffer names is indeed a problem.  I think we should try and
remember the actual buffer whenever possible (i.e. until we want to
print the object), and when printing, we should try and print
a description of the buffer, e.g. its file-name if it's visiting a file
(I guess the data used in bookmarks would be a good starting point).


        Stefan





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-26 20:32       ` Stefan Monnier
@ 2014-05-26 20:42         ` Juanma Barranquero
  2014-05-27  7:34           ` martin rudalics
  0 siblings, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-26 20:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Arash Cue, 17589

On Mon, May 26, 2014 at 10:32 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:

> Saving buffer names is indeed a problem.  I think we should try and
> remember the actual buffer whenever possible (i.e. until we want to
> print the object) and when printing, we should try and print
> a description of the buffer, e.g. its file-name if it's visiting a file

Framesets treat window states (from window-state-get) as opaque
objects. I'm not sure what kind of changes would be required (in the
window state's API, I mean, not framesets) to implement what you
suggest.

Martin?





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-26 20:42         ` Juanma Barranquero
@ 2014-05-27  7:34           ` martin rudalics
  2014-05-27  8:32             ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: martin rudalics @ 2014-05-27  7:34 UTC (permalink / raw)
  To: Juanma Barranquero, Stefan Monnier; +Cc: Arash Cue, 17589

 >> Saving buffer names is indeed a problem.  I think we should try and
 >> remember the actual buffer whenever possible (i.e. until we want to
 >> print the object)

Indeed.  This would help when buffers get renamed in between.

 > and when printing, we should try and print
 >> a description of the buffer, e.g. its file-name if it's visiting a file
 >
 > Framesets treat window states (from window-state-get) as opaque
 > objects. I'm not sure what kind of changes would be required (in the
 > window state's API, I mean, not framesets) to implement what you
 > suggest.

Currently `window-state-put' relies on buffer files names restored to
their pre-`window-state-put' values.  We probably want a more general
solution in desktop.el to restore the connection between files visited
and the names of the respective buffers in some unified manner.

martin





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27  7:34           ` martin rudalics
@ 2014-05-27  8:32             ` Juanma Barranquero
  2014-05-27  9:13               ` martin rudalics
  0 siblings, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-27  8:32 UTC (permalink / raw)
  To: martin rudalics; +Cc: 17589, Arash Cue

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

On May 27, 2014 9:34 AM, "martin rudalics" <rudalics@gmx.at> wrote:

>  We probably want a more general
> solution in desktop.el to restore the connection between files visited
> and the names of the respective buffers in some unified manner.

That won't help in this particular case, where buffers are live in the same
session, just renamed since the call to window-state-get, and desktop.el
isn't involved at all.

I think we'd need an optional arg to w-s-g to use in live sessions, where
it would store refs to live buffers instead of their names (and code in
w-s-p to deal with it, of course).

[-- Attachment #2: Type: text/html, Size: 764 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27  8:32             ` Juanma Barranquero
@ 2014-05-27  9:13               ` martin rudalics
  2014-05-27  9:40                 ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: martin rudalics @ 2014-05-27  9:13 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17589, Arash Cue

 >>   We probably want a more general
 >> solution in desktop.el to restore the connection between files visited
 >> and the names of the respective buffers in some unified manner.
 >
 > That won't help in this particular case, where buffers are live in the same
 > session, just renamed since the call to window-state-get, and desktop.el
 > isn't involved at all.

Yes.  I meant that in the line before.

 > I think we'd need an optional arg to w-s-g to use in live sessions

WRITABLE?

 > , where
 > it would store refs to live buffers instead of their names (and code in
 > w-s-p to deal with it, of course).

Wouldn't `get-buffer' in `window-state-put-2' handle that already?

martin





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27  9:13               ` martin rudalics
@ 2014-05-27  9:40                 ` Juanma Barranquero
  2014-05-27 10:08                   ` martin rudalics
  0 siblings, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-27  9:40 UTC (permalink / raw)
  To: martin rudalics; +Cc: 17589, Arash Cue

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

On May 27, 2014 11:14 AM, "martin rudalics" <rudalics@gmx.at> wrote:

> Yes.  I meant that in the line before.

OK

> WRITABLE?

Not sure what you mean here.

> Wouldn't `get-buffer' in `window-state-put-2' handle that already?

Likely, yes.

    J

[-- Attachment #2: Type: text/html, Size: 470 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27  9:40                 ` Juanma Barranquero
@ 2014-05-27 10:08                   ` martin rudalics
  2014-05-27 10:53                     ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: martin rudalics @ 2014-05-27 10:08 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17589, Arash Cue

 >> WRITABLE?
 >
 > Not sure what you mean here.

If the WRITABLE argument of `window-state-get' is non-nil use the
buffer name and the buffer object otherwise.

martin





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 10:08                   ` martin rudalics
@ 2014-05-27 10:53                     ` Juanma Barranquero
  2014-05-27 13:09                       ` martin rudalics
  0 siblings, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-27 10:53 UTC (permalink / raw)
  To: martin rudalics; +Cc: 17589, Arash Cue

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

On May 27, 2014 12:09 PM, "martin rudalics" <rudalics@gmx.at> wrote:

> If the WRITABLE argument of `window-state-get' is non-nil use the
> buffer name and the buffer object otherwise.

Oh, I see. Yes, that makes sense.

[-- Attachment #2: Type: text/html, Size: 339 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 10:53                     ` Juanma Barranquero
@ 2014-05-27 13:09                       ` martin rudalics
  2014-05-27 13:11                         ` Juanma Barranquero
  2014-05-27 16:45                         ` Arash Cue
  0 siblings, 2 replies; 32+ messages in thread
From: martin rudalics @ 2014-05-27 13:09 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17589, Arash Cue

 >> If the WRITABLE argument of `window-state-get' is non-nil use the
 >> buffer name and the buffer object otherwise.
 >
 > Oh, I see. Yes, that makes sense.

Could you test it?


--- lisp/window.el	2014-05-25 10:06:35 +0000
+++ lisp/window.el	2014-05-27 12:57:50 +0000
@@ -4875,7 +4875,7 @@
  		(let ((point (window-point window))
  		      (start (window-start window)))
  		  `((buffer
-		     ,(buffer-name buffer)
+		     ,(if writable (buffer-name buffer) buffer)
  		     (selected . ,selected)
  		     (hscroll . ,(window-hscroll window))
  		     (fringes . ,(window-fringes window))


martin





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 13:09                       ` martin rudalics
@ 2014-05-27 13:11                         ` Juanma Barranquero
  2014-05-27 13:30                           ` Stefan Monnier
  2014-05-27 16:45                         ` Arash Cue
  1 sibling, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-27 13:11 UTC (permalink / raw)
  To: martin rudalics; +Cc: 17589, Arash Cue

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

On May 27, 2014 3:09 PM, "martin rudalics" <rudalics@gmx.at> wrote:

> Could you test it?

Yes, tonight. I don't have access to Emacs right now.

    J

[-- Attachment #2: Type: text/html, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 13:11                         ` Juanma Barranquero
@ 2014-05-27 13:30                           ` Stefan Monnier
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Monnier @ 2014-05-27 13:30 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Arash Cue, 17589

> I don't have access to Emacs right now.

Call 911!


        Stefan





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 13:09                       ` martin rudalics
  2014-05-27 13:11                         ` Juanma Barranquero
@ 2014-05-27 16:45                         ` Arash Cue
  2014-05-27 17:14                           ` martin rudalics
  1 sibling, 1 reply; 32+ messages in thread
From: Arash Cue @ 2014-05-27 16:45 UTC (permalink / raw)
  To: martin rudalics; +Cc: Juanma Barranquero, 17589

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

i changed this line
(if writable (buffer-name buffer) buffer)
to
(if writable buffer (buffer-name buffer))
and it get fixed. ^_^


On Tue, May 27, 2014 at 1:09 PM, martin rudalics <rudalics@gmx.at> wrote:

> >> If the WRITABLE argument of `window-state-get' is non-nil use the
> >> buffer name and the buffer object otherwise.
> >
> > Oh, I see. Yes, that makes sense.
>
> Could you test it?
>
>
> --- lisp/window.el      2014-05-25 10:06:35 +0000
> +++ lisp/window.el      2014-05-27 12:57:50 +0000
> @@ -4875,7 +4875,7 @@
>                 (let ((point (window-point window))
>                       (start (window-start window)))
>                   `((buffer
> -                    ,(buffer-name buffer)
> +                    ,(if writable (buffer-name buffer) buffer)
>                      (selected . ,selected)
>                      (hscroll . ,(window-hscroll window))
>                      (fringes . ,(window-fringes window))
>
>
> martin
>

[-- Attachment #2: Type: text/html, Size: 1882 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 16:45                         ` Arash Cue
@ 2014-05-27 17:14                           ` martin rudalics
  2014-05-27 22:34                             ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: martin rudalics @ 2014-05-27 17:14 UTC (permalink / raw)
  To: Arash Cue; +Cc: Juanma Barranquero, 17589

 > (if writable (buffer-name buffer) buffer)
 > to
 > (if writable buffer (buffer-name buffer))
 > and it get fixed. ^_^

Because `frameset-save' calls `window-state-get' with WRITABLE t.
Probably `frameset-save' could use a WRITABLE argument too (passing it
on to `window-state-get') and `frameset-to-register' would call
`frameset-save' with WRITABLE nil.  IIUC this should fix your bug but
not the problem of restoring framesets from printed representations.

martin





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 17:14                           ` martin rudalics
@ 2014-05-27 22:34                             ` Juanma Barranquero
  2014-05-28  0:16                               ` Arash Cue
                                                 ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-27 22:34 UTC (permalink / raw)
  To: martin rudalics; +Cc: 17589, Arash Cue

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

On Tue, May 27, 2014 at 7:14 PM, martin rudalics <rudalics@gmx.at> wrote:

> Probably `frameset-save' could use a WRITABLE argument too (passing it
> on to `window-state-get') and `frameset-to-register' would call
> `frameset-save' with WRITABLE nil.

Yep, that's the only way I see to solve this. That, or some horrible
hack in frameset-to-register which I don't even want to start thinking
about.

Arash, could you please try with Martin's proposed change to window.el
plus the attached patch to frameset.el?

TIA,

    J

[-- Attachment #2: 17589.diff --]
[-- Type: text/plain, Size: 2075 bytes --]

=== modified file 'lisp/frameset.el'
--- lisp/frameset.el	2014-03-27 01:01:36 +0000
+++ lisp/frameset.el	2014-05-27 22:31:49 +0000
@@ -748,7 +748,8 @@
 ;;;###autoload
 (cl-defun frameset-save (frame-list
 			 &key app name description
-			      filters predicate properties)
+			      filters predicate properties
+			      in-session)
   "Return a frameset for FRAME-LIST, a list of frames.
 Dead frames and non-frame objects are silently removed from the list.
 If nil, FRAME-LIST defaults to the output of `frame-list' (all live frames).
@@ -758,13 +759,16 @@
 `frameset-filter-alist' is used instead.
 PREDICATE is a predicate function, which must return non-nil for frames that
 should be saved; if PREDICATE is nil, all frames from FRAME-LIST are saved.
-PROPERTIES is a user-defined property list to add to the frameset."
+PROPERTIES is a user-defined property list to add to the frameset.
+IN-SESSION, if non-nil, means that the resulting frameset is meant to be
+used in the current Emacs session and not serialized to an external store."
   (let* ((list (or (copy-sequence frame-list) (frame-list)))
 	 (frameset--target-display nil)
 	 (frames (cl-delete-if-not #'frame-live-p
 				   (if predicate
 				       (cl-delete-if-not predicate list)
 				     list)))
+	 (writable (not in-session))
 	 fs)
     (frameset--record-minibuffer-relationships frames)
     (setq fs (frameset--make
@@ -779,7 +783,7 @@
 						  (or filters
 						      frameset-filter-alist)
 						  t)
-			  (window-state-get (frame-root-window frame) t)))
+			  (window-state-get (frame-root-window frame) writable)))
 		       frames)))
     (cl-assert (frameset-valid-p fs))
     fs))
@@ -1277,7 +1281,8 @@
 		(registerv-make
 		 (vector (frameset-save nil
 					:app 'register
-					:filters frameset-session-filter-alist)
+					:filters frameset-session-filter-alist
+					:in-session t)
 			 ;; frameset-save does not include the value of point
 			 ;; in the current buffer, so record that separately.
 			 (frameset-frame-id nil)


^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 22:34                             ` Juanma Barranquero
@ 2014-05-28  0:16                               ` Arash Cue
  2014-05-28  4:50                                 ` Juanma Barranquero
  2014-05-28  0:22                               ` Stefan Monnier
  2020-09-09 12:06                               ` Lars Ingebrigtsen
  2 siblings, 1 reply; 32+ messages in thread
From: Arash Cue @ 2014-05-28  0:16 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17589

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

i applied these changes and it somehow fixed the issue but now i can't
restore my frame configurations after saving and reading the session
`desktop-save', `desktop-read'.



On Tue, May 27, 2014 at 10:34 PM, Juanma Barranquero <lekktu@gmail.com>wrote:

> On Tue, May 27, 2014 at 7:14 PM, martin rudalics <rudalics@gmx.at> wrote:
>
> > Probably `frameset-save' could use a WRITABLE argument too (passing it
> > on to `window-state-get') and `frameset-to-register' would call
> > `frameset-save' with WRITABLE nil.
>
> Yep, that's the only way I see to solve this. That, or some horrible
> hack in frameset-to-register which I don't even want to start thinking
> about.
>
> Arash, could you please try with Martin's proposed change to window.el
> plus the attached patch to frameset.el?
>
> TIA,
>
>     J
>

[-- Attachment #2: Type: text/html, Size: 1298 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 22:34                             ` Juanma Barranquero
  2014-05-28  0:16                               ` Arash Cue
@ 2014-05-28  0:22                               ` Stefan Monnier
  2014-05-28  4:55                                 ` Juanma Barranquero
  2014-05-28  5:28                                 ` Juanma Barranquero
  2020-09-09 12:06                               ` Lars Ingebrigtsen
  2 siblings, 2 replies; 32+ messages in thread
From: Stefan Monnier @ 2014-05-28  0:22 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Arash Cue, 17589

> Yep, that's the only way I see to solve this. That, or some horrible
> hack in frameset-to-register which I don't even want to start thinking
> about.

Or to always save window-state in a "non-writable" form, and then
provide a separate function to turn this into a writable form.  If we
can always know right from the start if we'll write the window-state,
then we don't need that, but if we may sometimes need a window-state
which we may or may not later write to a file, then a separate function
would be needed.


        Stefan





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28  0:16                               ` Arash Cue
@ 2014-05-28  4:50                                 ` Juanma Barranquero
  2014-05-28  5:26                                   ` Juanma Barranquero
  2014-05-28 11:35                                   ` Arash Cue
  0 siblings, 2 replies; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-28  4:50 UTC (permalink / raw)
  To: Arash Cue; +Cc: 17589

On Wed, May 28, 2014 at 2:16 AM, Arash Cue <eg5cue@gmail.com> wrote:

> i applied these changes and it somehow fixed the issue but now i can't
> restore my frame configurations after saving and reading the session
> `desktop-save', `desktop-read'.

That's weird, because these changes do not affect deskop saving at all.

Did you apply Martin's change, or your reversed (and erroneous)
version of Martin's change?

    J





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28  0:22                               ` Stefan Monnier
@ 2014-05-28  4:55                                 ` Juanma Barranquero
  2014-05-28  5:28                                 ` Juanma Barranquero
  1 sibling, 0 replies; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-28  4:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Arash Cue, 17589

On Wed, May 28, 2014 at 2:22 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:

> Or to always save window-state in a "non-writable" form, and then
> provide a separate function to turn this into a writable form.  If we
> can always know right from the start if we'll write the window-state,
> then we don't need that, but if we may sometimes need a window-state
> which we may or may not later write to a file, then a separate function
> would be needed.

I thought of it, but then that "carries over" to framesets, and
suddenly you need a function to make a frameset writable, as they
would by default be non-writable (because, as this bug shows, you do
not know beforehand if you will want to write a frameset or not). Very
ugly, IMO.

    J





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28  4:50                                 ` Juanma Barranquero
@ 2014-05-28  5:26                                   ` Juanma Barranquero
  2014-05-28 11:35                                   ` Arash Cue
  1 sibling, 0 replies; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-28  5:26 UTC (permalink / raw)
  To: Arash Cue; +Cc: 17589

On Wed, May 28, 2014 at 6:50 AM, Juanma Barranquero <lekktu@gmail.com> wrote:

> That's weird, because these changes do not affect deskop saving at all.

Though there's still bug#17090: unusable frameset data is saved to the
desktop as part of register-alist. But it shouldn't (and doesn't, in
my tests) affect saving and restoring the desktop; it just breaks M-x
list-registers.

    J





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28  0:22                               ` Stefan Monnier
  2014-05-28  4:55                                 ` Juanma Barranquero
@ 2014-05-28  5:28                                 ` Juanma Barranquero
  2014-05-28 13:05                                   ` Stefan Monnier
  1 sibling, 1 reply; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-28  5:28 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Arash Cue, 17589

On Wed, May 28, 2014 at 2:22 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:

> Or to always save window-state in a "non-writable" form, and then
> provide a separate function to turn this into a writable form.  If we
> can always know right from the start if we'll write the window-state,
> then we don't need that, but if we may sometimes need a window-state
> which we may or may not later write to a file, then a separate function
> would be needed.

I thought of that, but it doesn't really change the need to have a
:in-session arg in frameset-save, unless you also want that
frameset-save returns non-writable framesets and add a
frameset-writable function, which is very ugly.

    J





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28  4:50                                 ` Juanma Barranquero
  2014-05-28  5:26                                   ` Juanma Barranquero
@ 2014-05-28 11:35                                   ` Arash Cue
  2014-05-30  2:10                                     ` Juanma Barranquero
  1 sibling, 1 reply; 32+ messages in thread
From: Arash Cue @ 2014-05-28 11:35 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17589

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

no, i applied Martin's change and your's.


On Wed, May 28, 2014 at 4:50 AM, Juanma Barranquero <lekktu@gmail.com>wrote:

> On Wed, May 28, 2014 at 2:16 AM, Arash Cue <eg5cue@gmail.com> wrote:
>
> > i applied these changes and it somehow fixed the issue but now i can't
> > restore my frame configurations after saving and reading the session
> > `desktop-save', `desktop-read'.
>
> That's weird, because these changes do not affect deskop saving at all.
>
> Did you apply Martin's change, or your reversed (and erroneous)
> version of Martin's change?
>
>     J
>

[-- Attachment #2: Type: text/html, Size: 1066 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28  5:28                                 ` Juanma Barranquero
@ 2014-05-28 13:05                                   ` Stefan Monnier
  2014-05-30  2:17                                     ` Juanma Barranquero
  0 siblings, 1 reply; 32+ messages in thread
From: Stefan Monnier @ 2014-05-28 13:05 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Arash Cue, 17589

> :in-session arg in frameset-save, unless you also want that
> frameset-save returns non-writable framesets and add a
> frameset-writable function,

Right, that would be the idea.

> which is very ugly.

One way to make it less ugly is to fold the "make it writable" thingy
directly into the print code.  We've already had some discussions about
that in the past.  For example, we could provide
a `print-non-readable-function' which the C printing routines would
call when bumping into a non-readable object and which could return
either a string to print instead.


        Stefan





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28 11:35                                   ` Arash Cue
@ 2014-05-30  2:10                                     ` Juanma Barranquero
  0 siblings, 0 replies; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-30  2:10 UTC (permalink / raw)
  To: Arash Cue; +Cc: 17589

> no, i applied Martin's change and your's.

Then please send a recipe to reproduce it, because I can't just with
these patches.

TIA,

    Juanma





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-28 13:05                                   ` Stefan Monnier
@ 2014-05-30  2:17                                     ` Juanma Barranquero
  0 siblings, 0 replies; 32+ messages in thread
From: Juanma Barranquero @ 2014-05-30  2:17 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Arash Cue, 17589

On Wed, May 28, 2014 at 3:05 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:

> Right, that would be the idea.

I think the current interfaces (window-state-get|put and
frameset-save|restore, with an optional WRITABLE or IN-SESSION arg)
are way preferable. Seems messy to introduce frameset-writable (or
whatever) when the framesets are intended to be writable and the
in-memory-only case is just an exception.

> One way to make it less ugly is to fold the "make it writable" thingy
> directly into the print code.

The difference between a "writable frameset" and a non-writable one is
not a matter of how to print some values, in the sense that you can
decide how to write it just by looking at the value. Some you have to
save in specific ways to be able to restore them.

     J





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2014-05-27 22:34                             ` Juanma Barranquero
  2014-05-28  0:16                               ` Arash Cue
  2014-05-28  0:22                               ` Stefan Monnier
@ 2020-09-09 12:06                               ` Lars Ingebrigtsen
  2021-10-10 22:46                                 ` Stefan Kangas
  2 siblings, 1 reply; 32+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-09 12:06 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Arash Cue, Stefan Monnier, 17589

Juanma Barranquero <lekktu@gmail.com> writes:

> Arash, could you please try with Martin's proposed change to window.el
> plus the attached patch to frameset.el?

[...]

> -			      filters predicate properties)
> +			      filters predicate properties
> +			      in-session)

[...]

> +IN-SESSION, if non-nil, means that the resulting frameset is meant to be
> +used in the current Emacs session and not serialized to an external store."

(This was six years ago.)

Martin's patch was applied, but Juanma's wasn't.  Arash said that it
fixed the observed bug, but there were other issues?  The thread isn't
quite clear here...

Is this still something that should be fixed, or has the bug gone away
in the years since this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2020-09-09 12:06                               ` Lars Ingebrigtsen
@ 2021-10-10 22:46                                 ` Stefan Kangas
  2021-10-11  7:55                                   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 32+ messages in thread
From: Stefan Kangas @ 2021-10-10 22:46 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Juanma Barranquero, Arash Cue, Stefan Monnier, 17589

tags 17589 + patch
thanks

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Juanma Barranquero <lekktu@gmail.com> writes:
>
>> Arash, could you please try with Martin's proposed change to window.el
>> plus the attached patch to frameset.el?
>
> [...]
>
>> -			      filters predicate properties)
>> +			      filters predicate properties
>> +			      in-session)
>
> [...]
>
>> +IN-SESSION, if non-nil, means that the resulting frameset is meant to be
>> +used in the current Emacs session and not serialized to an external store."
>
> (This was six years ago.)
>
> Martin's patch was applied, but Juanma's wasn't.  Arash said that it
> fixed the observed bug, but there were other issues?  The thread isn't
> quite clear here...
>
> Is this still something that should be fixed, or has the bug gone away
> in the years since this?

More information was requested, but none was given within 12 months.

I guess if Juanma's patch fixes an issue it should be installed though?





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2021-10-10 22:46                                 ` Stefan Kangas
@ 2021-10-11  7:55                                   ` Lars Ingebrigtsen
  2021-10-11 11:41                                     ` Stefan Kangas
  0 siblings, 1 reply; 32+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-11  7:55 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Juanma Barranquero, Arash Cue, Stefan Monnier, 17589

Stefan Kangas <stefan@marxist.se> writes:

>> Martin's patch was applied, but Juanma's wasn't.  Arash said that it
>> fixed the observed bug, but there were other issues?  The thread isn't
>> quite clear here...
>>
>> Is this still something that should be fixed, or has the bug gone away
>> in the years since this?
>
> More information was requested, but none was given within 12 months.
>
> I guess if Juanma's patch fixes an issue it should be installed though?

Not if it leads to other regressions.  :-)  Re-skimming this thread, I'm
not sure what the conclusion was...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#17589: 24.3.91; lisp/frameset.el
  2021-10-11  7:55                                   ` Lars Ingebrigtsen
@ 2021-10-11 11:41                                     ` Stefan Kangas
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Kangas @ 2021-10-11 11:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen
  Cc: Juanma Barranquero, Arash Cue, Stefan Monnier, 17589-done

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> I guess if Juanma's patch fixes an issue it should be installed though?
>
> Not if it leads to other regressions.  :-)  Re-skimming this thread, I'm
> not sure what the conclusion was...

Given that it's been years, perhaps we should just close this.  No one
replied back within 12 months.

If any of this is still important, it'll come back up.

I'm therefore closing this bug report.

If this conclusion is incorrect and this is still an issue, please reply
to this email (use "Reply to all" in your email client) and we can
reopen the bug report.





^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2021-10-11 11:41 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-25 20:49 bug#17589: 24.3.91; lisp/frameset.el eg5cue
2014-05-26 17:18 ` Juanma Barranquero
2014-05-26 17:49   ` Arash Cue
2014-05-26 19:04     ` Juanma Barranquero
2014-05-26 20:32       ` Stefan Monnier
2014-05-26 20:42         ` Juanma Barranquero
2014-05-27  7:34           ` martin rudalics
2014-05-27  8:32             ` Juanma Barranquero
2014-05-27  9:13               ` martin rudalics
2014-05-27  9:40                 ` Juanma Barranquero
2014-05-27 10:08                   ` martin rudalics
2014-05-27 10:53                     ` Juanma Barranquero
2014-05-27 13:09                       ` martin rudalics
2014-05-27 13:11                         ` Juanma Barranquero
2014-05-27 13:30                           ` Stefan Monnier
2014-05-27 16:45                         ` Arash Cue
2014-05-27 17:14                           ` martin rudalics
2014-05-27 22:34                             ` Juanma Barranquero
2014-05-28  0:16                               ` Arash Cue
2014-05-28  4:50                                 ` Juanma Barranquero
2014-05-28  5:26                                   ` Juanma Barranquero
2014-05-28 11:35                                   ` Arash Cue
2014-05-30  2:10                                     ` Juanma Barranquero
2014-05-28  0:22                               ` Stefan Monnier
2014-05-28  4:55                                 ` Juanma Barranquero
2014-05-28  5:28                                 ` Juanma Barranquero
2014-05-28 13:05                                   ` Stefan Monnier
2014-05-30  2:17                                     ` Juanma Barranquero
2020-09-09 12:06                               ` Lars Ingebrigtsen
2021-10-10 22:46                                 ` Stefan Kangas
2021-10-11  7:55                                   ` Lars Ingebrigtsen
2021-10-11 11:41                                     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).