all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Freezing frameset-restore
Date: Mon, 10 Mar 2014 16:06:56 +0100	[thread overview]
Message-ID: <CAAeL0SQjHjA69bK=0Zkd5ZiDx=0NbDWQYHdM4r6q0ya9G=RZMA@mail.gmail.com> (raw)
In-Reply-To: <jwvpplub17s.fsf-monnier+emacs@gnu.org>

On Mon, Mar 10, 2014 at 3:19 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:

> I'm not opposed to keywords as arguments in general:  I'm opposed to
> them when the argument is itself specified via a keyword.

OK. Ill change that, too.

> This choice is not based on an estimate of which case will be more
> common, but rather I think that given the argument name ":reuse-frames"
> a nil value which says "don't reuse any frames" is more intuitive than
> one that says "reuse all frames".  Hence the change.

Hmm. I think you're right. That's two in a row. ;-)

> Don't convert to an alist at the end: just return the hashtable.

Eh, no. As I said already, processing the frames in random (maphash)
order just isn't going to cut it if you want to delete frames.

> Again, we're talking about very few callers.  You want the code to be as
> simple as possible, since the rare callers can pay the extra price, if needed.

I'm unconvinced, but it's not a big deal. It's a much bigger deal
that, as I've argued again in my next message, I think we shouldn't be
extracting cleanup from frameset-restore.

> It's only artificial in your mind: the code already did it in two phases
> (just within the same function).

That would be an argument to split every long function along its
length, just by looking for appropriate places where it can be
"cleanly" done, but that's not an argument that I can accept.
Restoring a frameset is going from one frame configuration to another
one; cleanup isn't just something that gets accidentally done
afterwards.

> Once you change the code to return a hashtable, pcase-dolist will be
> replaced with maphash anyway ;-)

See above.

And please don't say that we can return a hash and leave the sorting
for the caller. The caller is us, we already call delete-frame, so
we'll have to add yet *more* ugly code at the point of call of
frameset-restore.

We keep having this conversation where you extract conclusions from
our two use cases; but I'm trying to design an interface for those
people out there who will perhaps have ideas and uses we cannot think
of right now. That's why there is a frameset.el library, isn't it? To
allow people to be creative with it?

> That's pretty close to the definition of over-engineering.

That's also pretty close to the definition of writing a library, as
opposed to a tightly knitted piece of code.

> Personally, I'd just ditch frameset-restore-cleanup.

I'd ditch it too, for a CLEANUP arg to frameset-restore.

> Aha!  Can you expand on this?  What do you mean exactly by
> "non-visible"?

You can create an invisible frame, save it in a frameset, then delete
it (so you have just one frame, visible), and then restore the
frameset over your only frame. Presto! If frameset-restore doesn't
protect against it, you end with just one, quite invisible, frame. So
frameset-restore checks that (except in daemon mode) at least one
frame is visible after restoration. IMO, that check should be (and it
was until now) the last step in restoration, after everything else
that affects the existing frames.

   J



  reply	other threads:[~2014-03-10 15:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  0:03 Freezing frameset-restore Juanma Barranquero
2014-03-06 17:27 ` martin rudalics
2014-03-06 17:33   ` Juanma Barranquero
2014-03-06 18:16     ` martin rudalics
2014-03-06 18:35       ` Juanma Barranquero
2014-03-06 18:41       ` Juanma Barranquero
2014-03-07  7:38         ` martin rudalics
2014-03-07 11:28           ` Juanma Barranquero
2014-03-07 15:16             ` martin rudalics
2014-03-07 20:32 ` Stefan Monnier
2014-03-07 21:34   ` Juanma Barranquero
2014-03-07 21:40     ` Juanma Barranquero
2014-03-08  0:34     ` Stefan Monnier
2014-03-08  1:42       ` Juanma Barranquero
2014-03-08  2:25         ` Juanma Barranquero
2014-03-08  4:31         ` Stefan Monnier
2014-03-08  6:00           ` Juanma Barranquero
2014-03-08 14:27             ` Stefan Monnier
2014-03-08 16:34               ` Juanma Barranquero
2014-03-08 23:45                 ` Juanma Barranquero
2014-03-10  4:29                   ` Stefan Monnier
2014-03-10  5:26                     ` Juanma Barranquero
2014-03-10 13:04                       ` Juanma Barranquero
2014-03-10 14:19                       ` Stefan Monnier
2014-03-10 15:06                         ` Juanma Barranquero [this message]
2014-03-10 18:33                           ` Juanma Barranquero
2014-03-10 23:10                             ` Stefan Monnier
2014-03-11  0:47                               ` Juanma Barranquero
2014-03-10 20:32                           ` Stefan Monnier
2014-03-10 21:07                             ` Juanma Barranquero
2014-03-09 12:29                 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAeL0SQjHjA69bK=0Zkd5ZiDx=0NbDWQYHdM4r6q0ya9G=RZMA@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.