all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* frame names on tty are different than the ones on X-frames
@ 2018-02-26 19:57 Andrés Ramírez
  2018-02-26 20:28 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Andrés Ramírez @ 2018-02-26 19:57 UTC (permalink / raw)
  To: emacs-devel

Hi.

Frame names on tty's are:
--8<---------------cut here---------------start------------->8---
F1
F2
...
--8<---------------cut here---------------end--------------->8---

Frame names on X-frames are the buffer name

Why on tty frames the frame names could not be the buffer-name?. Is
there an option for that?


When using select-frame-by-name You could watch the name.

AR



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

* Re: frame names on tty are different than the ones on X-frames
  2018-02-26 19:57 frame names on tty are different than the ones on X-frames Andrés Ramírez
@ 2018-02-26 20:28 ` Eli Zaretskii
  2018-02-26 20:55   ` andrés ramírez
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2018-02-26 20:28 UTC (permalink / raw)
  To: Andrés Ramírez; +Cc: emacs-devel

> From: rrandresf@gmail.com (Andrés Ramírez)
> Date: Mon, 26 Feb 2018 13:57:11 -0600
> 
> Frame names on tty's are:
> --8<---------------cut here---------------start------------->8---
> F1
> F2
> ...
> --8<---------------cut here---------------end--------------->8---
> 
> Frame names on X-frames are the buffer name

No.  GUI frames don't really have names, they have titles.  Only TTY
frames have real names, those Fn strings.  A name of a frame cannot
change, otherwise it's not useful for specifying the frame.

> Why on tty frames the frame names could not be the buffer-name?

What would that be useful for?

In any case, you can supply a name for a frame using set-frame-name,
if you don't like the Fn notation.

> When using select-frame-by-name You could watch the name.

It's an illusion created by that function.  That function is
mainly/only useful for TTY frames, because you have no other
convenient way of selecting a specific frame quickly: you only see one
frame, the current one, and have no idea what buffer is displayed on
others.  That's why that function was written; but in order to make it
work with any kind of frames, it was extended to GUI frames, although
it has no real utility in that case.



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

* Re: frame names on tty are different than the ones on X-frames
  2018-02-26 20:28 ` Eli Zaretskii
@ 2018-02-26 20:55   ` andrés ramírez
  2018-02-26 21:06     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: andrés ramírez @ 2018-02-26 20:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Hi Eli.

> > When using select-frame-by-name You could watch the name.
> It's an illusion created by that function.  That function is
> mainly/only useful for TTY frames, because you have no other
> convenient way of selecting a specific frame quickly: you only see one
> frame, the current one, and have no idea what buffer is displayed on
> others.  That's why that function was written; but in order to make it
> work with any kind of frames, it was extended to GUI frames, although
> it has no real utility in that case.

On my workflow. I have a bash alias myemacs (for not polluting my main
emacs-dev session). I use this specific
emacs session (the one invoked with the alias) as a file explorer, on
different usb pen drives. So when I have 4 pendrives or tar.gz
files (It meants 4 different emacs instances ran by the alias). And the two main one emacs
sessions (ran by --daemon). the emacs-dev-session and the emacs-mail-session (which uses
url-retrieve-synchronously){which hangs emacs for a few seconds}.
On the emacs-dev-session (with uptimes of months). I have several frames emms, erc, my-org-notes-frame, bbdb,
and my project-directory.

Then In total I have:
six emacs sessions
--8<---------------cut here---------------start------------->8---
dev
mail
pendrive1
tar.gz
pendrive2
pics
--8<---------------cut here---------------end--------------->8---

with a total of 10 frames. Then M-TAB is not useful for discriminating
the frame I want to point out. So on my main dev session (with a custom
icon). select-frame-by-name is my friend. other-frame is not very useful
on this case. I have heard about helm-frame. But helm is not part of my
tooling. the last helm version does not run on emacs-23. And my dot
emacs files support all the different versions of emacs from 23 until
master (27). But probably some guys have solved this problem with
another method.

Also on a touch device with a keyboard It is very nice cycling on the
emacs-frames avoiding the phone-app the sms-app the youtube-app.

Perhaps It is time of dropping emacs-23 and start using
helm-frame :). Thanks for the info Eli
AR



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

* Re: frame names on tty are different than the ones on X-frames
  2018-02-26 20:55   ` andrés ramírez
@ 2018-02-26 21:06     ` Eli Zaretskii
  2018-02-27  1:40       ` andrés ramírez
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2018-02-26 21:06 UTC (permalink / raw)
  To: andrés ramírez; +Cc: emacs-devel

> From: andrés ramírez <rrandresf@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 26 Feb 2018 14:55:38 -0600
> 
> On my workflow. I have a bash alias myemacs (for not polluting my main
> emacs-dev session). I use this specific
> emacs session (the one invoked with the alias) as a file explorer, on
> different usb pen drives. So when I have 4 pendrives or tar.gz
> files (It meants 4 different emacs instances ran by the alias). And the two main one emacs
> sessions (ran by --daemon). the emacs-dev-session and the emacs-mail-session (which uses
> url-retrieve-synchronously){which hangs emacs for a few seconds}.
> On the emacs-dev-session (with uptimes of months). I have several frames emms, erc, my-org-notes-frame, bbdb,
> and my project-directory.
> 
> Then In total I have:
> six emacs sessions
> --8<---------------cut here---------------start------------->8---
> dev
> mail
> pendrive1
> tar.gz
> pendrive2
> pics
> --8<---------------cut here---------------end--------------->8---
> 
> with a total of 10 frames. Then M-TAB is not useful for discriminating
> the frame I want to point out.

You can give your frames descriptive names, then use those names to
call out the frame you want.



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

* Re: frame names on tty are different than the ones on X-frames
  2018-02-26 21:06     ` Eli Zaretskii
@ 2018-02-27  1:40       ` andrés ramírez
  2018-02-27 13:13         ` Christian Lynbech
  0 siblings, 1 reply; 6+ messages in thread
From: andrés ramírez @ 2018-02-27  1:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

> You can give your frames descriptive names, then use those names to
> call out the frame you want.

Thanks Eli. That could be helpful too.



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

* Re: frame names on tty are different than the ones on X-frames
  2018-02-27  1:40       ` andrés ramírez
@ 2018-02-27 13:13         ` Christian Lynbech
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Lynbech @ 2018-02-27 13:13 UTC (permalink / raw)
  To: andrés ramírez; +Cc: Eli Zaretskii, emacs-devel

I too have a multi-frame setup, though it has not got quite as many
frames and I use it mostly in graphical environments.

I define my frames with frame paramaters such as:

                ((name . "((MAIN))")
		 (icon-name . "((MAIN))")
                 ...)

and then I have functions such as

    (defun my-select-main (&optional arg)
      "Fast select of main buffer.
    Optional argument ARG (prefix arg.) means iconify current frame."
      (interactive "P")
      (my-select-frame 'main arg))

This I bind to keys (in my case for the main frame: F8 2)

It calls `my-select-frame' which is defined as:

    (defun my-select-frame (name &optional discard)
      "Select, raise and show frame NAME.
    NAME may be either a frame object or a symbol that will then be interpreted
    by  `my-frame-configuration'.
    Optional argument DISCARD means get rid of current frame."
      (interactive)
      (let* ((current-frame (selected-frame))
             (frame-conf (my-frame-configuration name))
             (frame-exists t))
        (cond
          ((framep name)
           (make-frame-visible name)
           (raise-frame (select-frame name))
           (and discard (iconify-frame current-frame)))
          ((not frame-conf)
           (warn "No definition for %s" name))
          ((stringp frame-conf)
           (switch-to-buffer frame-conf))
          (t
           (condition-case nil
                           (select-frame-by-name (cdr (assq 'name frame-conf)))
                           (error (setq frame-exists nil)))
           (if (not frame-exists)
               (raise-frame (select-frame (funcall 'make-frame frame-conf))))
           (and discard (iconify-frame current-frame)))))
      (sit-for 0.1)
      (frame-reposition)
      (other-frame 0)		 ;hack to place mouse cursor in corner
      (sit-for 0.1)
      (setq current-prefix-arg nil))

The function `my-frame-configuration' just is a small utility function
to return the desired configuration of a certain frame (using the symbol
'main to signify the main frame) such that I can select the frame if it
exists or create it on demand if not.

Some window managers are diligent about putting the icon name under the
icon, others are not, but I mostly use the keyboard shortcuts anyway.


------------------------+-----------------------------------------------------
Christian Lynbech       | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)



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

end of thread, other threads:[~2018-02-27 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26 19:57 frame names on tty are different than the ones on X-frames Andrés Ramírez
2018-02-26 20:28 ` Eli Zaretskii
2018-02-26 20:55   ` andrés ramírez
2018-02-26 21:06     ` Eli Zaretskii
2018-02-27  1:40       ` andrés ramírez
2018-02-27 13:13         ` Christian Lynbech

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.