all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: rms@gnu.org
Cc: Eli Zaretskii <eliz@gnu.org>, cyd@stupidchicken.com, emacs-devel@gnu.org
Subject: Re: Terminology in multi-tty primitives
Date: Tue, 30 Dec 2008 11:18:15 +0900	[thread overview]
Message-ID: <87zlies8wo.fsf@xemacs.org> (raw)
In-Reply-To: <E1LHQIW-0006LK-NC@fencepost.gnu.org>

Richard M Stallman writes:

 >     I think you are wrong about suspend making no sense on GUI terminals:
 >     we have (in Emacs 23) suspend-frame that does work on GUI.
 > 
 > It does this by lumping together various different operations.
 > Really it is just a way of trying to make C-z do something meaningful
 > on window systems where suspending Emacs is not useful.
 > It is a useful command, but sheds no light on how to conceptualize the
 > interfaces at the Lisp level.

I used to agree with you, but The Kids These Days (ie, those who have
grown up with WIMPy interfaces) think of a window as a (foreground)
process.  If the window goes away, the process stops.  I think that is
well-based in psychology.  If Eli (the MS-DOS Ambassador to Emacs!) 
finds commonality there, there's *something* in common there.

In particular, on a GUI the difference between a kill -STOP'ed emacs
and one with no visible windows is hardly important to the user, who
must do something unusual to resurrect it.  So the "withdraw frame"
function (which happens to be called `suspend-frame') just keeps
withdrawing frames, and when the last one is withdrawn, emacs goes to
sleep.  On a X11-style GUI, this requires no additional work: no
window, no events, no Maya == Nirvana.  On a TTY, you need to suspend
Emacs to achieve enlightenment.  No big difference from the user's POV.

 >     Anyway, the examples I gave were just that: examples.  Here's another
 >     example: we have make-frame-on-display, make-frame-on-tty, and
 >     make-terminal-frame; and then we have make-frame that can do all of
 >     the above.  IMO, it's terribly confusing.
 > 
 > Would you like to propose a change for these, which people could consider?

The semantics are a bit delicate, but if you have/create a notion of
"current-terminal", which is the terminal from which input was last
received, then in practice most frames are created on that terminal,
and most of the rest have an implicit notion of "my terminal" (eg, an
emacsclient -nw process will use its controlling tty).  So give
make-frame a terminal parameter, and (make-frame) will use the current
terminal as default.  The general form will be

    (make-frame '((terminal DESCRIPTOR)
                  (terminal-type TYPE)))

where if 'terminal-type is absent, `make-frame' uses an heuristic to
guess it.  In particular, there should be a way to discriminate
between a human-oriented descriptor and an unambiguous internal one.

It seems to me that humans who know what they want will invariably use
a string descriptor, such as ":0" or "CON:" or "/dev/tty3".  So make
the internal type of terminals something else (the small integer
indexing a table of connections would do fine).  This internal type is
what `frame-terminal' (takes a frame argument), `get-terminal' (takes
a string and optional type argument, implements the guessing algorithm
used above, and calls `make-terminal' if an appropriate terminal
connection doesn't exist yet), and `make-terminal' (the more-or-less
internal function that does the heavy lifting) return.  Then the
general `make-frame' call above would be precisely equivalent to

    (make-frame '((terminal (get-terminal DESCRIPTOR TYPE))))

when DESCRIPTOR is a string.  Use of the internal type for DESCRIPTOR
in `get-terminal' should be an error.

Personally, I see no need whatsoever for `make-frame-on-...'
variants.  If they can't be removed for hysterical raisins, then at
least they can be deprecated in the documentation.





  reply	other threads:[~2008-12-30  2:18 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-27 18:23 Terminology in multi-tty primitives Eli Zaretskii
2008-12-28  1:00 ` Chong Yidong
2008-12-28  4:09   ` Eli Zaretskii
2008-12-28  4:28     ` Chong Yidong
2008-12-28 19:18       ` Eli Zaretskii
2008-12-28 19:43         ` Juanma Barranquero
2008-12-29  5:31         ` Chong Yidong
2008-12-29 19:26           ` Eli Zaretskii
2008-12-29 22:09         ` Richard M Stallman
2008-12-30  2:18           ` Stephen J. Turnbull [this message]
2008-12-30 22:26             ` Richard M Stallman
2008-12-31  2:06               ` Stefan Monnier
2008-12-31  2:20                 ` Dan Nicolaescu
2008-12-31  3:20                   ` Stefan Monnier
2008-12-31  4:29                     ` Eli Zaretskii
2008-12-31  6:25                       ` Stefan Monnier
2008-12-31 18:47                         ` Eli Zaretskii
2008-12-31 21:39                           ` Dan Nicolaescu
2008-12-31 21:48                             ` Eli Zaretskii
2008-12-31 21:55                               ` Dan Nicolaescu
2008-12-31 22:10                                 ` Eli Zaretskii
2008-12-31 23:03                                   ` Dan Nicolaescu
2008-12-31 16:38                 ` Richard M Stallman
2008-12-31 17:22                   ` Stefan Monnier
2008-12-31 19:05                     ` Eli Zaretskii
2009-01-01 17:13                       ` Stefan Monnier
2009-01-02 13:56                         ` Eli Zaretskii
2009-01-03  2:32                           ` Stefan Monnier
2009-01-03  9:59                             ` Eli Zaretskii
2009-01-04  3:14                               ` Stefan Monnier
2009-01-04  3:29                                 ` Chetan Pandya
2009-01-04  3:41                                   ` Jason Rumney
2009-01-04  4:54                                     ` Chetan Pandya
2008-12-30 22:27             ` Richard M Stallman
2008-12-31  5:31               ` Stephen J. Turnbull
2008-12-31  6:28                 ` Stefan Monnier
2008-12-31  8:33                   ` Stephen J. Turnbull
2008-12-31 14:18                 ` Chong Yidong
2008-12-31 15:42                   ` Stephen J. Turnbull
2008-12-28 17:29 ` Richard M Stallman
2008-12-28 19:33   ` Eli Zaretskii
2008-12-30 19:53   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2008-12-27 18:16 Eli Zaretskii

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=87zlies8wo.fsf@xemacs.org \
    --to=stephen@xemacs.org \
    --cc=cyd@stupidchicken.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /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.