all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "grouping" buffers
@ 2020-05-22  6:26 Jean-Christophe Helary
  2020-05-27 21:02 ` Douglas Lewan
  2020-05-27 22:58 ` "grouping" buffers Jakub Jankiewicz
  0 siblings, 2 replies; 13+ messages in thread
From: Jean-Christophe Helary @ 2020-05-22  6:26 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Short of running multiple emacs sessions, is there a way to "group" buffers in a frame so as to have multiple frames with different contents (and possibly shared buffers) ?



Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune





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

* Re: "grouping" buffers
  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
  1 sibling, 1 reply; 13+ messages in thread
From: Douglas Lewan @ 2020-05-27 21:02 UTC (permalink / raw)
  To: Jean-Christophe Helary, Help Gnu Emacs mailing list

On 5/22/20 2:26 AM, Jean-Christophe Helary wrote:
> Short of running multiple emacs sessions, is there a way to "group" buffers in a frame so as to have multiple frames with different contents (and possibly shared buffers) ?

I think you used the right term there: "frame". I could image code in my 
.emacs (or its brethren), to load individual projects each into its own 
frame.

If you're looking for something more general or flexible, then this 
could be an opportunity to write such a utility. I'm guessing you'll 
want a more precise description than ...'way to "group" buffers...'. (Or 
you might want to embrace writing prototypes and enduring false starts.)

>
>
>
> Jean-Christophe Helary
> -----------------------------------------------
> http://mac4translators.blogspot.com @brandelune
>
>
>
-- 
,Doug
d.lewan2000@gmail.com
(908) 720 7908

On 2020 May 18 I learned that 1,499,722 is practically 0.




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

* Re: "grouping" buffers
  2020-05-22  6:26 "grouping" buffers Jean-Christophe Helary
  2020-05-27 21:02 ` Douglas Lewan
@ 2020-05-27 22:58 ` Jakub Jankiewicz
  2020-05-31  2:45   ` Jean-Christophe Helary
  1 sibling, 1 reply; 13+ messages in thread
From: Jakub Jankiewicz @ 2020-05-27 22:58 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: Help Gnu Emacs mailing list

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

> Short of running multiple emacs sessions, is there a way to "group" buffers
> in a frame so as to have multiple frames with different contents (and
> possibly shared buffers) ?

You can have single instance of Emacs and multiple Frames (which other
programs call windows) those windows can have Emacs windows (which other
programs call panels). Every frame will share bufferes, because it will be the
same instance of Emacs.

Just use `M-x new-frame` to open new Frame.

--
Jakub Jankiewicz, Web Developer
https://jcubic.pl/me

[-- Attachment #2: Podpis cyfrowy OpenPGP --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: "grouping" buffers
  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 14:31     ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Jean-Christophe Helary @ 2020-05-31  2:45 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list



> On May 28, 2020, at 7:58, Jakub Jankiewicz <jcubic@onet.pl> wrote:
> 
>> Short of running multiple emacs sessions, is there a way to "group" buffers
>> in a frame so as to have multiple frames with different contents (and
>> possibly shared buffers) ?
> 
> You can have single instance of Emacs and multiple Frames (which other
> programs call windows) those windows can have Emacs windows (which other
> programs call panels). Every frame will share bufferes, because it will be the
> same instance of Emacs.

I understand basic use of frames.

First, I'm asking if there is a way to group buffers in frames. So that frame A works on buffers 1-2-3, frame B has buffers 4-5-6, frame C has buffers 1-4-7-8 for ex.

Second, the utilities for manipulating frames and buffers within frames are extremely limited. There does not seem to be a way to "name" a given frame, or to call a frame to the front for example, like I'd call a buffer to the front. There does not seem a way to specify a frame to send commands to either.

Let me give you an example.

On macos, with AppleScript, in most applications (but 1 frame = 1 window = 1 buffer), I can access the name of a given frame, I change its name, 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.

I can't work on "buffers" because the concept does not exist, but I think you see what I mean.

I can't seem to be able to do that in emacs for emacs frames.


-- 
Jean-Christophe Helary @brandelune
http://mac4translators.blogspot.com




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

* Perspectives (was Re: "grouping" buffers)
  2020-05-27 21:02 ` Douglas Lewan
@ 2020-05-31  3:33   ` Jean-Christophe Helary
  0 siblings, 0 replies; 13+ messages in thread
From: Jean-Christophe Helary @ 2020-05-31  3:33 UTC (permalink / raw)
  To: Douglas Lewan; +Cc: Help Gnu Emacs mailing list



> On May 28, 2020, at 6:02, Douglas Lewan <d.lewan2000@gmail.com> wrote:
> 
> On 5/22/20 2:26 AM, Jean-Christophe Helary wrote:
>> Short of running multiple emacs sessions, is there a way to "group" buffers in a frame so as to have multiple frames with different contents (and possibly shared buffers) ?
> 
> I think you used the right term there: "frame". I could image code in my .emacs (or its brethren), to load individual projects each into its own frame.
> 
> If you're looking for something more general or flexible, then this could be an opportunity to write such a utility. I'm guessing you'll want a more precise description than ...'way to "group" buffers...'. (Or you might want to embrace writing prototypes and enduring false starts.)


I just found

https://github.com/nex3/perspective-el

"The Perspective package provides multiple named workspaces (or "perspectives") in Emacs, similar to multiple desktops in window managers like Awesome and XMonad, and Spaces on the Mac.

Each perspective has its own buffer list and its own window layout. This makes it easy to work on many separate projects without getting lost in all the buffers. Switching to a perspective activates its window configuration, and when in a perspective, only its buffers are available (by default).

Each Emacs frame has a distinct list of perspectives.

Perspective supports saving its state to a file, so long-lived work sessions may be saved and recovered as needed."

It looks like that's what I'm looking for.

It's not compatible with desktop.el because it offers its own facilities.

-- 
Jean-Christophe Helary @brandelune
http://mac4translators.blogspot.com




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

* RE: "grouping" buffers
  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 14:31     ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Drew Adams @ 2020-05-31  3:49 UTC (permalink / raw)
  To: Jean-Christophe Helary, Help Gnu Emacs mailing list

> The utilities for manipulating frames and buffers within frames
> are extremely limited.  There does not seem to be a way to "name" a
> given frame, 

In `frame-cmds.el' you have command `rename-frame'.  Doc:

 Rename a frame named OLD-NAME to NEW-NAME.
 Prefix arg non-nil means rename all frames named OLD-NAME to NEWNAME.
 OLD-NAME may be a frame, its name, or nil.  Default is `selected-frame'.
 NEW-NAME is a string or nil.  Default NEW-NAME is current `buffer-name'.

The code is about 7 lines long.  Ultimately it uses
standard function `modify-frame-parameters'.

> 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').

Or do you mean change its z-order value (bring it
forward)?  That's standard command `raise-frame'.

(Use `i frame z-order' in the Elisp manual.  That takes
you to node `Raising, Lowering and Restacking Frames'.)

> On macos ... I can access the name of a given frame,

Function `get-frame-name' from library `frame-fns.el'.
Essentially (cdr (assq 'name (frame-parameters frame)).

Many of the functions and commands in `frame-fns.el'
and `frame-cmds.el' have simple, short, definitions.

> I change its name, 

`rename-frame' - see above.

> 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.

But repositioning and resizing aren't hard.
`frame-cmds.el' has several commands for such things,
including incremental movement (e.g. `move-frame-up)
and incremental resizing (e.g. `enlarge-frame').

The latter is just this:
(set-frame-height frame (+ (frame-height frame) increment))

> I can't work on "buffers" because the concept does not exist, but I
> think you see what I mean.

No, I'm not sure I do.

> I can't seem to be able to do that in emacs for emacs frames.

Most frame changes are done ultimately with
`modify-frame-parameters'.  The Elisp manual is
pretty good on this subject.  Start with node
`Frames'.
___

https://www.emacswiki.org/emacs/download/frame-cmds.el

https://www.emacswiki.org/emacs/download/frame-fns.el




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

* Re: "grouping" buffers
  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 16:39         ` Drew Adams
  0 siblings, 2 replies; 13+ messages in thread
From: Jean-Christophe Helary @ 2020-05-31  5:02 UTC (permalink / raw)
  To: Drew Adams; +Cc: Help Gnu Emacs mailing list

Thank you Drew.

> On May 31, 2020, at 12:49, Drew Adams <drew.adams@oracle.com> wrote:
> 
>> The utilities for manipulating frames and buffers within frames
>> are extremely limited.  There does not seem to be a way to "name" a
>> given frame, 
> 
> In `frame-cmds.el' you have command `rename-frame'.  Doc:

Sorry. The "default" utilities... I was only looking at the Emacs manual and at some command names I found with C-h.

Also, which-key shows that there are only very few C-x 5 prefixed commands. From a basic Emacs user’s point of view *that* is extremely limited.

Now that you mention the elisp manual, I checked it and found a few interesting things.

===============================
> 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.

I think there should be a command that does that in frame.el.

> Normally you don’t specify the name explicitly,

That's quite a statement...

Maybe that should be "Normally Emacs computes..."

> and Emacs computes the frame name automatically based on a template stored in the variable frame-title-format. Emacs recomputes the name each time the frame is redisplayed.
===============================


>> 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.

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.

>> 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]"

But that was just an example of how frames are easy to manipulate and access out of the box in macos/applescript.

>> I can't seem to be able to do that in emacs for emacs frames.
> 
> 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...

> The Elisp manual is
> pretty good on this subject.  Start with node
> `Frames'.

Indeed.

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.

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.

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

Thank you again for the references.

-- 
Jean-Christophe Helary @brandelune
http://mac4translators.blogspot.com




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

* Re: "grouping" buffers
  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 16:39         ` Drew Adams
  1 sibling, 1 reply; 13+ messages in thread
From: Yuri Khan @ 2020-05-31  7:21 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: Help Gnu Emacs mailing list

On Sun, 31 May 2020 at 12:03, Jean-Christophe Helary
<jean.christophe.helary@traduction-libre.org> wrote:

> > 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.

I did this:

    (set-frame-parameter nil 'name "Hello World!")

and the title of my WM window that displays the current Emacs frame
changed. Of course this made it less convenient: now it displays a
static string, whereas previously, per my ‘frame-title-format’
configuration, it displayed the unsaved status and name of the buffer
in the currently selected window in that frame: •README.md – Emacs. So
yes:

> > Normally you don’t specify the name explicitly[…]


> 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]"
>
> But that was just an example of how frames are easy to manipulate and access out of the box in macos/applescript.

That is a consequence of that simple model (1 frame = 1 window = 1
buffer). In Emacs, the model is more complex, so you have to say “the
buffer shown in the selected window of the current frame”.
Fortunately, that is abbreviated to “the buffer shown in the currently
selected window”, and that to “the current buffer”, and that is
represented by passing nil to pretty much every function that accepts
a buffer argument.

Alternatively, you can refer to individual buffers, windows, and
frames, most easily by using the values of (current-buffer),
(selected-window), and (selected-frame). Also there are functions to
explore the frame/window/buffer structure, and the function
(get-buffer BUFFER-OR-NAME) to get a buffer by name. It’s harder to
talk about names of windows and frames because these things are
ephemeral.

If in your workflow you need a frame that you control, you arrange for
your code to create it and stash the reference into a private
variable, then refer to the frame via that variable.



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

* Re: "grouping" buffers
  2020-05-31  7:21         ` Yuri Khan
@ 2020-05-31  7:34           ` Jean-Christophe Helary
  2020-05-31 12:35             ` Perry Smith
  0 siblings, 1 reply; 13+ messages in thread
From: Jean-Christophe Helary @ 2020-05-31  7:34 UTC (permalink / raw)
  To: Yuri Khan; +Cc: Help Gnu Emacs mailing list



> On May 31, 2020, at 16:21, Yuri Khan <yuri.v.khan@gmail.com> wrote:
> 
>> 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.
> 
> I did this:
> 
>    (set-frame-parameter nil 'name "Hello World!")

Thank you.

> and the title of my WM window that displays the current Emacs frame
> changed. Of course this made it less convenient: now it displays a
> static string, whereas previously, per my ‘frame-title-format’
> configuration, it displayed the unsaved status and name of the buffer
> in the currently selected window in that frame: •README.md – Emacs.

That's what the manual says. Basically, the name reflects the mode line info. I understand it can be useful, but it's also redundant. Also, I don't need all that when I work with multiple frames. I need to have an idea of what kind of buffers I mainly work with there (hence the subject title: "grouping buffers"). So having a name derived from the *state of the current buffer* in that frame is not useful for me.

> If in your workflow you need a frame that you control, you arrange for
> your code to create it and stash the reference into a private
> variable, then refer to the frame via that variable.

I'm not sure what I *need* in technical terms. In practical terms I need to keep the context of a given work, so I want to split my activity between "enclosed" sections of my emacs session. But it looks like the perspective.el mode that I found earlier is close to what I want, so before reinventing a wheel that seems pretty complex, I think I'm going to see how that mode works :)

-- 
Jean-Christophe Helary @brandelune
http://mac4translators.blogspot.com




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

* Re: "grouping" buffers
  2020-05-31  7:34           ` Jean-Christophe Helary
@ 2020-05-31 12:35             ` Perry Smith
  0 siblings, 0 replies; 13+ messages in thread
From: Perry Smith @ 2020-05-31 12:35 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: Help Gnu Emacs mailing list, Yuri Khan

I don’t what the default ^h-a binding is.  It is some restricted form of “apropos”.  One thing I do is change this mapping from the default to “apropos”.  It gives a more complete list of commands, functions, variables, etc.

    (define-key help-map (kbd "a") ‘apropos)


> On May 31, 2020, at 2:34 AM, Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org> wrote:
> 
> 
> 
>> On May 31, 2020, at 16:21, Yuri Khan <yuri.v.khan@gmail.com> wrote:
>> 
>>> 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.
>> 
>> I did this:
>> 
>>   (set-frame-parameter nil 'name "Hello World!")
> 
> Thank you.
> 
>> and the title of my WM window that displays the current Emacs frame
>> changed. Of course this made it less convenient: now it displays a
>> static string, whereas previously, per my ‘frame-title-format’
>> configuration, it displayed the unsaved status and name of the buffer
>> in the currently selected window in that frame: •README.md – Emacs.
> 
> That's what the manual says. Basically, the name reflects the mode line info. I understand it can be useful, but it's also redundant. Also, I don't need all that when I work with multiple frames. I need to have an idea of what kind of buffers I mainly work with there (hence the subject title: "grouping buffers"). So having a name derived from the *state of the current buffer* in that frame is not useful for me.
> 
>> If in your workflow you need a frame that you control, you arrange for
>> your code to create it and stash the reference into a private
>> variable, then refer to the frame via that variable.
> 
> I'm not sure what I *need* in technical terms. In practical terms I need to keep the context of a given work, so I want to split my activity between "enclosed" sections of my emacs session. But it looks like the perspective.el mode that I found earlier is close to what I want, so before reinventing a wheel that seems pretty complex, I think I'm going to see how that mode works :)
> 
> -- 
> Jean-Christophe Helary @brandelune
> http://mac4translators.blogspot.com
> 
> 




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

* Re: "grouping" buffers
  2020-05-31  2:45   ` Jean-Christophe Helary
  2020-05-31  3:49     ` Drew Adams
@ 2020-05-31 14:31     ` Eli Zaretskii
  2020-05-31 14:41       ` Jean-Christophe Helary
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2020-05-31 14:31 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org>
> Date: Sun, 31 May 2020 11:45:34 +0900
> 
> First, I'm asking if there is a way to group buffers in frames. So that frame A works on buffers 1-2-3, frame B has buffers 4-5-6, frame C has buffers 1-4-7-8 for ex.

AFAIR, this happens by default: as long as you display a buffer only
in a certain frame, that frame will "prefer" such buffers to the rest
of them.



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

* Re: "grouping" buffers
  2020-05-31 14:31     ` Eli Zaretskii
@ 2020-05-31 14:41       ` Jean-Christophe Helary
  0 siblings, 0 replies; 13+ messages in thread
From: Jean-Christophe Helary @ 2020-05-31 14:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Help Gnu Emacs mailing list



> On May 31, 2020, at 23:31, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org>
>> Date: Sun, 31 May 2020 11:45:34 +0900
>> 
>> First, I'm asking if there is a way to group buffers in frames. So that frame A works on buffers 1-2-3, frame B has buffers 4-5-6, frame C has buffers 1-4-7-8 for ex.
> 
> AFAIR, this happens by default: as long as you display a buffer only
> in a certain frame, that frame will "prefer" such buffers to the rest
> of them.

Thank you Eli. That's interesting. I'll test that.

-- 
Jean-Christophe Helary @brandelune
http://mac4translators.blogspot.com




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

* RE: "grouping" buffers
  2020-05-31  5:02       ` Jean-Christophe Helary
  2020-05-31  7:21         ` Yuri Khan
@ 2020-05-31 16:39         ` Drew Adams
  1 sibling, 0 replies; 13+ messages in thread
From: Drew Adams @ 2020-05-31 16:39 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: Help Gnu Emacs mailing list

> > 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.



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

end of thread, other threads:[~2020-05-31 16:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2020-05-31 14:31     ` Eli Zaretskii
2020-05-31 14:41       ` Jean-Christophe Helary

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.