unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: RE: "grouping" buffers
Date: Sun, 31 May 2020 09:39:10 -0700 (PDT)	[thread overview]
Message-ID: <70f92c1a-baaf-4270-ae0c-e3dd40820c37@default> (raw)
In-Reply-To: <5C48EC33-AB2C-4131-AF5F-2BF6D376EC2D@traduction-libre.org>

> > Frame Titles
> 
> > Every frame has a name parameter; this serves as the default for the
> frame title which window systems typically display at the top of the
> frame. You can specify a name explicitly by setting the name frame
> property.
> 
> I don't know how to "set the name frame property". But there is
> probably a place in the elisp manual that says how to do that.

The general way to change frame parameters is to
use function `modify-frame-parameters'.

There are also functions `set-frame-parameter' and
`set-frame-position'.

And I pointed you to code (in `frame-cmds.el')
that defines a command to rename a frame.  You're
free to use or adapt that.
 
> I think there should be a command that does that in frame.el.

Maybe so, but it's simple to define your own.  Even
if you don't want to use a 3rd-party library such
as `frame-cmds.el', you can reuse or adapt some of
its code, if you like.

> >> or to call a frame to the front for example, like I'd call
> >> a buffer to the front.
> >
> > By "call to the front", do you mean select the frame,
> > giving it focus?  That's standard command `select-frame' or
> > `select-frame-by-name' (or function `select-frame-set-focus').
> 
> When I call select-frame I get "command-execute: select-frame must be
> bound to an event with parameters" I don't know what that means.

Yes, that's not covered well in the manuals, IMO.
You might consider filing a bug report.  The doc
should probably say that that command should be
bound to a mouse event.  Or perhaps that error
message could be made more clear.

Bind such a command to a menu item or some other
mouse event, and Bob's your uncle.

Googling for exactly that error message shows you
some info about this, but not much.  Here's one
search hit:

https://stackoverflow.com/questions/4013079/mouse-buffer-menu-with-keyboard

> Thanks to autocompletion I found about select-frame-by-name, and well,
> that worked fine, but as far as I can tell it's documented neither in
> the elisp manual nor in the emacs manual.

Most commands are not documented in the manuals.
It's not the purpose of the manuals to exhaustively
document each function, variable, etc.

(But if you feel that some specific function or
variable merits mention in a manual, you can
suggest that using `M-x report-emacs-bug'.)

The place to start, for info, is the doc string.
Then go to the source code.  `select-frame-by-name'
is defined in `frame.el'.  (But yeah, `select-frame'
is defined in C source code.)

> >> I can call it to the front or to the back, I can modify its
> >> contents, I can rearrange the size and placement of each frame, etc.
> >
> > Dunno what you mean by modify its contents.
> 
> Since in macos 1 frame = 1 window = 1 buffer, I can write something
> like "set contents of document (read "buffer") of front window (read
> "frame") to [whatever]"

In Emacs I guess you're talking about changing the
content of a buffer.  You know how to do that.  And
to do it with code, the buffer doesn't even need to
be displayed. 

> > Most frame changes are done ultimately with
> > `modify-frame-parameters'.
> 
> I see. Maybe the section I quoted above could have an explicit link to
> that section. I mean, *all* sections in the Emacs manual should have a
> link to the relevant part of the Elisp manual...

If you want such suggestions to have an effect on
the Emacs developers, consider filing an enhancement
request: `M-x report-emacs-bug'.

> Now it occurs to me that the tab feature that has been recently
> included in Emacs is easier to use out of the box than frames. For ex,
> by default I can call a menu where all the tabs are listed and I can
> select any one of them.
> 
> Although it is a different "menu", I just checked and F10 menu does
> have a frame item but it's buried inside the Buffer item.

Yes.

Library `menu-bar+.el' gives you a top-level `Frames'
menu, with these items (the `Frames' under `Buffers'
continues to just list frames for selection).

 Hide Frames / Show Buffers  (C-M-Z)
 Iconify All Frames  <vertical-line> <S-down-mouse-1>
 ______________
 Maximize Frame
 Maximize Frame Horizontally
 Maximize Frame Vertically
 Toggle Max Frame
 Toggle Max Frame Horizontally
 Toggle Max Frame Vertically
 ______________
 Tile Frames Horizontally...
 Tile Frames Vertically...
 ______________
 Set Frame Parameter from Frame...
 Set All Frame Parameters from Frame...
 Fit This Frame              C-x C-_
 Delete Frame                C-x 5 0
 New Frame                   C-x 5 2
 New Frame on Display...

And if you also use Icicles then there is an
`Icicles' submenu, with these multicommand
items:

 + Change Background of Frame...
 + Change Foreground of Frame...
 + Change Font of Frame...

> In conclusion, I think there could be the following modifications to
> the system to improve usability:
> 
> Short term:
> 1) Assign a C-x 5 default keybinding to "select-frame-by-name"
> 2) Add a C-x 5 bound command for renaming a frame
> 3) Document select-frame-by-name in the 2 manuals
> 4) Move the F10 "Frames" menu item to the menu root
> 
> Medium term:
> 4) Systematically add links to the Elisp manual in the Emacs manual. To
> make sure that new users get a habit to checking the two.

See above.  `M-x report-emacs-bug'.  That's for
enhancement requests, as well as bug reports.

FWIW, I agree with your general assessment that
Emacs has relatively poor support for frames,
or put differently, frames are the poor cousins
of Emacs windows.

One reason for this is no doubt that Emacs has
much less control over frames - behavior and
appearance.  Window managers have ultimate
control, and different window mgrs behave
differently.  All Emacs can do is to request
or suggest something of a window mgr.

Another reason (my guess) is that (partly
because Emacs has relatively poor support for
frames) Emacs users and developers use frames
less.  So they don't tend to develop new
features taking frames into account much, and
they might not test things much taking frames
into account.

See this page for more about this issue/problem:

https://www.emacswiki.org/emacs/OneOnOneEmacs

> I also need to understand why "select-frame" spits that error
> message...

See above.



  parent reply	other threads:[~2020-05-31 16:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  6:26 "grouping" buffers Jean-Christophe Helary
2020-05-27 21:02 ` Douglas Lewan
2020-05-31  3:33   ` Perspectives (was Re: "grouping" buffers) Jean-Christophe Helary
2020-05-27 22:58 ` "grouping" buffers Jakub Jankiewicz
2020-05-31  2:45   ` Jean-Christophe Helary
2020-05-31  3:49     ` Drew Adams
2020-05-31  5:02       ` Jean-Christophe Helary
2020-05-31  7:21         ` Yuri Khan
2020-05-31  7:34           ` Jean-Christophe Helary
2020-05-31 12:35             ` Perry Smith
2020-05-31 16:39         ` Drew Adams [this message]
2020-05-31 14:31     ` Eli Zaretskii
2020-05-31 14:41       ` Jean-Christophe Helary

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=70f92c1a-baaf-4270-ae0c-e3dd40820c37@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jean.christophe.helary@traduction-libre.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.
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).