From: Christian Lynbech <christian@defun.dk>
To: "andrés ramírez" <rrandresf@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: frame names on tty are different than the ones on X-frames
Date: Tue, 27 Feb 2018 14:13:57 +0100 [thread overview]
Message-ID: <m2d10qlgmi.fsf@defun.dk> (raw)
In-Reply-To: <87o9kb8b15.fsf@gmail.com> ("andrés ramírez"'s message of "Mon, 26 Feb 2018 19:40:54 -0600")
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)
prev parent reply other threads:[~2018-02-27 13:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=m2d10qlgmi.fsf@defun.dk \
--to=christian@defun.dk \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rrandresf@gmail.com \
/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.