unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.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 14:21:16 +0700	[thread overview]
Message-ID: <CAP_d_8VKcYSaynvcGYN1sx0TcjmAgVcqA+ESKD-VsMdwvp+VsQ@mail.gmail.com> (raw)
In-Reply-To: <5C48EC33-AB2C-4131-AF5F-2BF6D376EC2D@traduction-libre.org>

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.



  reply	other threads:[~2020-05-31  7:21 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 [this message]
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

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=CAP_d_8VKcYSaynvcGYN1sx0TcjmAgVcqA+ESKD-VsMdwvp+VsQ@mail.gmail.com \
    --to=yuri.v.khan@gmail.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).